NetDEM v1.0
Loading...
Searching...
No Matches
netdem::TetMesh Class Reference

A class that represents a tetrahedral mesh. More...

#include <tetmesh.hpp>

Public Member Functions

 TetMesh ()
 Constructs a new TetMesh object with an empty node and element list.
 
 TetMesh (const VecXT< Vec3d > &tv, const VecXT< Vec4i > &tt)
 Constructs a new TetMesh object with the given nodes and tetrahedra.
 
 TetMesh (STLModel const &stl_model, double mesh_size)
 Constructs a new TetMesh object from an STL model with the given mesh size.
 
 TetMesh (const VecXT< Vec3d > &vv, const VecXT< Vec3i > &ff, double mesh_size)
 Constructs a new TetMesh object with the given surface nodes, surface facets, and element size.
 
void Init ()
 Initializes the tetrahedral mesh.
 
STLModel GetSurfaceSTL ()
 Creates an STL model representing the surface of the tetrahedral mesh.
 
void SaveAsVTK (std::string const &file)
 Saves the tetrahedral mesh as a VTK file.
 

Public Attributes

VecXT< Vec3dnodes
 The nodes in the tetrahedral mesh.
 
VecXT< Vec4ielements
 The tetrahedra in the mesh.
 
VecXT< Vec3ibound_facets
 The boundary facets in the mesh.
 
VecXT< Vec2ibound_edges
 The boundary edges in the mesh.
 
VecXT< int > bound_nodes
 The boundary nodes in the mesh.
 
VecXT< Vec3dsurface_nodes
 The surface nodes in the mesh.
 
VecXT< Vec3isurface_facets
 The surface facets in the mesh.
 
VecXT< VecXT< int > > surface_node_linked_boundaries
 The IDs of the boundary facets that contain each surface node.
 
VecXT< double > bound_facet_areas
 The areas of the boundary facets in the mesh.
 

Detailed Description

A class that represents a tetrahedral mesh.

The TetMesh class is responsible for creating and managing a tetrahedral mesh. It provides functionality to initialize the mesh, compute connectivity between nodes and elements, create a surface mesh, and save the mesh as a VTK file.

Examples
00_sdf_demo.cpp, and 01_sdf_error.cpp.

Constructor & Destructor Documentation

◆ TetMesh() [1/4]

TetMesh::TetMesh ( )

Constructs a new TetMesh object with an empty node and element list.

This constructor creates a new TetMesh object with an empty node and element list.

◆ TetMesh() [2/4]

TetMesh::TetMesh ( const VecXT< Vec3d > & tv,
const VecXT< Vec4i > & tt )

Constructs a new TetMesh object with the given nodes and tetrahedra.

This constructor creates a new TetMesh object with the given nodes and tetrahedra.

Parameters
tvThe nodes in the tetrahedral mesh.
ttThe tetrahedra in the mesh.

◆ TetMesh() [3/4]

TetMesh::TetMesh ( STLModel const & stl_model,
double mesh_size )

Constructs a new TetMesh object from an STL model with the given mesh size.

This constructor creates a new TetMesh object from an STL model with the given mesh size.

Parameters
stl_modelThe STL model to create the tetrahedral mesh from.
mesh_sizeThe size of the elements in the mesh.

◆ TetMesh() [4/4]

TetMesh::TetMesh ( const VecXT< Vec3d > & vv,
const VecXT< Vec3i > & ff,
double mesh_size )

Constructs a new TetMesh object with the given surface nodes, surface facets, and element size.

This constructor creates a new TetMesh object with the given surface nodes, surface facets, and element size.

Parameters
vvThe surface nodes.
ffThe surface facets.
mesh_sizeThe size of the elements in the mesh.

Member Function Documentation

◆ GetSurfaceSTL()

STLModel TetMesh::GetSurfaceSTL ( )

Creates an STL model representing the surface of the tetrahedral mesh.

This function creates an STL model representing the surface of the tetrahedral mesh.

Returns
An STL model representing the surface of the tetrahedral mesh.

◆ Init()

void TetMesh::Init ( )

Initializes the tetrahedral mesh.

This function initializes the tetrahedral mesh by computing the connectivity between nodes and elements and creating a surface mesh.

◆ SaveAsVTK()

void TetMesh::SaveAsVTK ( std::string const & file)

Saves the tetrahedral mesh as a VTK file.

This function saves the tetrahedral mesh as a VTK file with the given filename.

Parameters
fileThe name of the file to save the tetrahedral mesh to.
Examples
00_sdf_demo.cpp, and 01_sdf_error.cpp.

Member Data Documentation

◆ bound_edges

VecXT<Vec2i> netdem::TetMesh::bound_edges

The boundary edges in the mesh.

◆ bound_facet_areas

VecXT<double> netdem::TetMesh::bound_facet_areas

The areas of the boundary facets in the mesh.

◆ bound_facets

VecXT<Vec3i> netdem::TetMesh::bound_facets

The boundary facets in the mesh.

◆ bound_nodes

VecXT<int> netdem::TetMesh::bound_nodes

The boundary nodes in the mesh.

◆ elements

VecXT<Vec4i> netdem::TetMesh::elements

The tetrahedra in the mesh.

◆ nodes

VecXT<Vec3d> netdem::TetMesh::nodes

The nodes in the tetrahedral mesh.

Examples
00_sdf_demo.cpp, and 01_sdf_error.cpp.

◆ surface_facets

VecXT<Vec3i> netdem::TetMesh::surface_facets

The surface facets in the mesh.

Examples
00_sdf_demo.cpp.

◆ surface_node_linked_boundaries

VecXT<VecXT<int> > netdem::TetMesh::surface_node_linked_boundaries

The IDs of the boundary facets that contain each surface node.

◆ surface_nodes

VecXT<Vec3d> netdem::TetMesh::surface_nodes

The surface nodes in the mesh.

Examples
00_sdf_demo.cpp.

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