Project Chrono: chrono::fea::ChMeshFileLoader Class Reference

Static Public Member Functions | List of all members
chrono::fea::ChMeshFileLoader Class Reference
Chrono::Engine » Finite Element Analysis » Utility classes

## Description

Collection of mesh file loader utilities.

`#include <ChMeshFileLoader.h>`

## Static Public Member Functions
static void | FromTetGenFile (std::shared_ptr< ChMesh > mesh, const char *filename_node, const char *filename_ele, std::shared_ptr< ChContinuumMaterial > my_material, ChVector3d pos_transform=VNULL, ChMatrix33<> rot_transform=ChMatrix33<>(1))
| Load tetrahedrons from .node and .ele files as saved by TetGen.
static void | FromAbaqusFile (std::shared_ptr< ChMesh > mesh, const char *filename, std::shared_ptr< ChContinuumMaterial > my_material, std::map< std::string, std::vector< std::shared_ptr< ChNodeFEAbase > > > &node_sets, ChVector3d pos_transform=VNULL, ChMatrix33<> rot_transform=ChMatrix33<>(1), bool discard_unused_nodes=true)
| Load tetrahedrons, if any, saved in a .inp file for Abaqus.
static void | ANCFShellFromGMFFile (std::shared_ptr< ChMesh > mesh, const char *filename, std::shared_ptr< ChMaterialShellANCF > my_material, std::vector< double > &node_ave_area, std::vector< int > &BC_nodes, ChVector3d pos_transform=VNULL, ChMatrix33<> rot_transform=ChMatrix33<>(1), double scaleFactor=1, bool printNodes=false, bool printElements=false)
static void | BSTShellFromObjFile (std::shared_ptr< ChMesh > mesh, const char *filename, std::shared_ptr< ChMaterialShellKirchhoff > my_material, double my_thickness, ChVector3d pos_transform=VNULL, ChMatrix33<> rot_transform=ChMatrix33<>(1))
| Load a triangle mesh in Wavefront OBJ file format, and convert it into a mesh of shell elements of ChElementShellBST type.

## Member Function Documentation

## ◆ ANCFShellFromGMFFile()

void chrono::fea::ChMeshFileLoader::ANCFShellFromGMFFile | ( | std::shared_ptr< ChMesh > | mesh,
|  | const char * | filename,
|  | std::shared_ptr< ChMaterialShellANCF > | my_material,
|  | std::vector< double > & | node_ave_area,
|  | std::vector< int > & | BC_nodes,
|  | ChVector3d | pos_transform = VNULL,
|  | ChMatrix33<> | rot_transform = ChMatrix33<>(1),
|  | double | scaleFactor = 1,
|  | bool | printNodes = false,
|  | bool | printElements = false )
| static

Parameters

  mesh | destination mesh
  filename | complete filename
  my_material | material to be given to the shell
  node_ave_area | output the average area of the nodes
  BC_nodes | material to be given to the shell
  pos_transform | optional displacement of imported mesh
  rot_transform | optional rotation/scaling of imported mesh
  scaleFactor | import scale factor
  printNodes | display the imported nodes
  printElements | display the imported elements

## ◆ BSTShellFromObjFile()

void chrono::fea::ChMeshFileLoader::BSTShellFromObjFile | ( | std::shared_ptr< ChMesh > | mesh,
|  | const char * | filename,
|  | std::shared_ptr< ChMaterialShellKirchhoff > | my_material,
|  | double | my_thickness,
|  | ChVector3d | pos_transform = VNULL,
|  | ChMatrix33<> | rot_transform = ChMatrix33<>(1) )
| static

Load a triangle mesh in Wavefront OBJ file format, and convert it into a mesh of shell elements of ChElementShellBST type.

Parameters

  mesh | destination mesh
  filename | .obj mesh complete filename
  my_material | material to be given to the shell elements
  my_thickness | thickness to be given to shell elements
  pos_transform | optional displacement of imported mesh
  rot_transform | optional rotation/scaling of imported mesh

## ◆ FromAbaqusFile()

void chrono::fea::ChMeshFileLoader::FromAbaqusFile | ( | std::shared_ptr< ChMesh > | mesh,
|  | const char * | filename,
|  | std::shared_ptr< ChContinuumMaterial > | my_material,
|  | std::map< std::string, std::vector< std::shared_ptr< ChNodeFEAbase > > > & | node_sets,
|  | ChVector3d | pos_transform = VNULL,
|  | ChMatrix33<> | rot_transform = ChMatrix33<>(1),
|  | bool | discard_unused_nodes = true )
| static

Load tetrahedrons, if any, saved in a .inp file for Abaqus.

Parameters

  mesh | destination mesh
  filename | input file name
  my_material | material for the created tetahedrons
  node_sets | vect of vectors of 'marked'nodes
  pos_transform | optional displacement of imported mesh
  rot_transform | optional rotation/scaling of imported mesh
  discard_unused_nodes | if true, Abaqus nodes that are not used in elements or sets are not imported in C::E

## ◆ FromTetGenFile()

void chrono::fea::ChMeshFileLoader::FromTetGenFile | ( | std::shared_ptr< ChMesh > | mesh,
|  | const char * | filename_node,
|  | const char * | filename_ele,
|  | std::shared_ptr< ChContinuumMaterial > | my_material,
|  | ChVector3d | pos_transform = VNULL,
|  | ChMatrix33<> | rot_transform = ChMatrix33<>(1) )
| static

Load tetrahedrons from .node and .ele files as saved by TetGen.

The file format for .node (with point# starting from 1) is: [# of points] [dimension (only 3)] [# of attributes (only 0)] [markers (only 0)] [node #] [x] [y] [z] [node #] [x] [y] [z] etc. The file format for .ele (with tet# starting from 1) is: [# of tetrahedrons] [dimension (only 4 supported)] [# of attributes (only 0)] [tet #] [node #] [node #] [node #] [node #] [tet #] [node #] [node #] [node #] [node #] etc. If you pass a material inherited by ChContinuumElastic, nodes with 3D motion are used, and corotational elements. If you pass a material inherited by ChContinuumPoisson3D, nodes with scalar field are used (ex. thermal, electrostatics, etc)

Parameters

  mesh | destination mesh
  filename_node | name of the .node file
  filename_ele | name of the .ele file
  my_material | material for the created tetahedrons
  pos_transform | optional displacement of imported mesh
  rot_transform | optional rotation/scaling of imported mesh

The documentation for this class was generated from the following files:

- D:/W/B/src/chrono-9.0.1/src/chrono/fea/ChMeshFileLoader.h
- D:/W/B/src/chrono-9.0.1/src/chrono/fea/ChMeshFileLoader.cpp