chrono::fea::ChContactSurfaceMesh Class Reference

Description

Class which defines a contact surface for FEA elements, using a mesh of triangles.

Differently from ChContactSurfaceNodeCloud, this also captures the node-vs-face and edge-vs-edge cases, but has a higher computational overhead.

#include <ChContactSurfaceMesh.h>

Inheritance diagram for chrono::fea::ChContactSurfaceMesh:
Collaboration diagram for chrono::fea::ChContactSurfaceMesh:

Public Member Functions

 ChContactSurfaceMesh (std::shared_ptr< ChContactMaterial > material, ChMesh *mesh=nullptr)
 
void AddFacesFromBoundary (const ChMesh &mesh, double sphere_swept=0.0, bool ccw=true, bool include_cable_elements=true, bool include_beam_elements=true)
 Utility function to add all boundary faces of the specified FEA mesh to this collision surface. More...
 
void ConstructFromTrimesh (std::shared_ptr< ChTriangleMeshConnected > trimesh, double sphere_swept=0.0)
 Construct a contact surface from a triangular mesh. More...
 
virtual ChAABB GetAABB () const override
 Get the current axis-aligned bounding box.
 
std::vector< std::shared_ptr< ChContactTriangleXYZ > > & GetTrianglesXYZ ()
 Get the list of triangles.
 
std::vector< std::shared_ptr< ChContactTriangleXYZRot > > & GetTrianglesXYZRot ()
 Get the list of triangles for nodes with rotational dofs.
 
unsigned int GetNumTriangles () const
 Get the number of triangles.
 
unsigned int GetNumVertices () const
 Get the number of vertices.
 
virtual void SyncCollisionModels () const override
 
virtual void AddCollisionModelsToSystem (ChCollisionSystem *coll_sys) const override
 
virtual void RemoveCollisionModelsFromSystem (ChCollisionSystem *coll_sys) const override
 
void OutputSimpleMesh (std::vector< ChVector3d > &vert_pos, std::vector< ChVector3d > &vert_vel, std::vector< ChVector3i > &triangles, std::vector< ChVector3b > &owns_node, std::vector< ChVector3b > &owns_edge) const
 Utility function for exporting the contact mesh in a pointer-less manner. More...
 
- Public Member Functions inherited from chrono::fea::ChContactSurface
 ChContactSurface (std::shared_ptr< ChContactMaterial > material, ChPhysicsItem *mesh=nullptr)
 
ChPhysicsItemGetPhysicsItem ()
 Get the owner physics item (e.g., an FEA mesh).
 
void SetPhysicsItem (ChPhysicsItem *physics_item)
 Set the owner physics item (e.g., an FEA mesh).
 
void DisableSelfCollisions (int family)
 Disable self-collisions (default: enabled). More...
 
std::shared_ptr< ChContactMaterial > & GetMaterialSurface ()
 Get the surface contact material.
 

Additional Inherited Members

- Protected Attributes inherited from chrono::fea::ChContactSurface
std::shared_ptr< ChContactMaterialm_material
 contact material properties
 
ChPhysicsItemm_physics_item
 associated physics item (e.g., an FEA mesh)
 
bool m_self_collide
 include self-collisions?
 
int m_collision_family
 collision family (if no self-collisions)
 

Member Function Documentation

◆ AddFacesFromBoundary()

void chrono::fea::ChContactSurfaceMesh::AddFacesFromBoundary ( const ChMesh mesh,
double  sphere_swept = 0.0,
bool  ccw = true,
bool  include_cable_elements = true,
bool  include_beam_elements = true 
)

Utility function to add all boundary faces of the specified FEA mesh to this collision surface.

The function scans all the finite elements already added in the parent ChMesh and adds the faces that are not shared (ie. the faces on the boundary 'skin'). For shells, the argument 'ccw' indicates whether the face vertices are provided in a counter-clockwise (default) or clockwise order(because shells collisions are oriented and might work only from the "outer" side). Currently supported elements that generate boundary skin:

Parameters
meshFEA mesh
sphere_sweptradius of swept sphere
ccwindicate counterclockwise vertex ordering
include_cable_elementscreate contact triangles for cable elements
include_beam_elementscreate contact triangles for beam elements

◆ ConstructFromTrimesh()

void chrono::fea::ChContactSurfaceMesh::ConstructFromTrimesh ( std::shared_ptr< ChTriangleMeshConnected trimesh,
double  sphere_swept = 0.0 
)

Construct a contact surface from a triangular mesh.

FEA nodes are created at the mesh vertex locations.

◆ OutputSimpleMesh()

void chrono::fea::ChContactSurfaceMesh::OutputSimpleMesh ( std::vector< ChVector3d > &  vert_pos,
std::vector< ChVector3d > &  vert_vel,
std::vector< ChVector3i > &  triangles,
std::vector< ChVector3b > &  owns_node,
std::vector< ChVector3b > &  owns_edge 
) const

Utility function for exporting the contact mesh in a pointer-less manner.

The mesh is specified as a set of 3D vertex points (with associated velocities) and a set of faces (indices into the vertex array). In addition, ownership of nodes and edges among the consitutent triangles is returned in 'owns_node' and 'owns_edge'.

Parameters
vert_posmesh vertices (absolute xyz positions)
vert_velvertex velocities (absolute xyz velocities)
trianglestriangle faces (indices in vertex array)
owns_nodenode ownership for each triangular face
owns_edgeedge ownership for each triangular face

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/fea/ChContactSurfaceMesh.h
  • /builds/uwsbel/chrono/src/chrono/fea/ChContactSurfaceMesh.cpp