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 AddFace (std::shared_ptr< ChNodeFEAxyz > node1, std::shared_ptr< ChNodeFEAxyz > node2, std::shared_ptr< ChNodeFEAxyz > node3, std::shared_ptr< ChNodeFEAxyz > edge_node1, std::shared_ptr< ChNodeFEAxyz > edge_node2, std::shared_ptr< ChNodeFEAxyz > edge_node3, bool owns_node1, bool owns_node2, bool owns_node3, bool owns_edge1, bool owns_edge2, bool owns_edge3, double sphere_swept=0.0)
 Add the face specified by the three specified XYZ nodes to this collision mesh. More...
 
void AddFace (std::shared_ptr< ChNodeFEAxyzrot > node1, std::shared_ptr< ChNodeFEAxyzrot > node2, std::shared_ptr< ChNodeFEAxyzrot > node3, std::shared_ptr< ChNodeFEAxyzrot > edge_node1, std::shared_ptr< ChNodeFEAxyzrot > edge_node2, std::shared_ptr< ChNodeFEAxyzrot > edge_node3, bool owns_node1, bool owns_node2, bool owns_node3, bool owns_edge1, bool owns_edge2, bool owns_edge3, double sphere_swept=0.0)
 Add the face specified by the three given XYZROT nodes to this collision mesh. More...
 
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...
 
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

◆ AddFace() [1/2]

void chrono::fea::ChContactSurfaceMesh::AddFace ( std::shared_ptr< ChNodeFEAxyz node1,
std::shared_ptr< ChNodeFEAxyz node2,
std::shared_ptr< ChNodeFEAxyz node3,
std::shared_ptr< ChNodeFEAxyz edge_node1,
std::shared_ptr< ChNodeFEAxyz edge_node2,
std::shared_ptr< ChNodeFEAxyz edge_node3,
bool  owns_node1,
bool  owns_node2,
bool  owns_node3,
bool  owns_edge1,
bool  owns_edge2,
bool  owns_edge3,
double  sphere_swept = 0.0 
)

Add the face specified by the three specified XYZ nodes to this collision mesh.

Parameters
node1face node1
node2face node2
node3face node3
edge_node1edge node 1 (nullptr if no wing node)
edge_node2edge node 2 (nullptr if no wing node)
edge_node3edge node 3 (nullptr if no wing node)
owns_node1this collision face owns node1
owns_node2this collision face owns node2
owns_node3this collision face owns node3
owns_edge1this collision face owns edge1
owns_edge2this collision face owns edge2
owns_edge3this collision face owns edge3
sphere_sweptthickness (radius of sweeping sphere)

◆ AddFace() [2/2]

void chrono::fea::ChContactSurfaceMesh::AddFace ( std::shared_ptr< ChNodeFEAxyzrot node1,
std::shared_ptr< ChNodeFEAxyzrot node2,
std::shared_ptr< ChNodeFEAxyzrot node3,
std::shared_ptr< ChNodeFEAxyzrot edge_node1,
std::shared_ptr< ChNodeFEAxyzrot edge_node2,
std::shared_ptr< ChNodeFEAxyzrot edge_node3,
bool  owns_node1,
bool  owns_node2,
bool  owns_node3,
bool  owns_edge1,
bool  owns_edge2,
bool  owns_edge3,
double  sphere_swept = 0.0 
)

Add the face specified by the three given XYZROT nodes to this collision mesh.

Parameters
node1face node1
node2face node2
node3face node3
edge_node1edge node 1 (nullptr if no wing node)
edge_node2edge node 2 (nullptr if no wing node)
edge_node3edge node 3 (nullptr if no wing node)
owns_node1this collision face owns node1
owns_node2this collision face owns node2
owns_node3this collision face owns node3
owns_edge1this collision face owns edge1
owns_edge2this collision face owns edge2
owns_edge3this collision face owns edge3
sphere_sweptthickness (radius of sweeping sphere)

◆ 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