Meshes
Comprehensive guide to working with meshes in Rodin.
Introduction
A mesh is the fundamental data structure in finite element analysis, representing the discretization of a computational domain into simple geometric elements called polytopes.
In Rodin, the Mesh class provides a complete framework for representing, manipulating, and querying finite element meshes.
Key Concepts
Domain Partition
Mathematically, a mesh partitions a domain :
where each is a polytope (e.g., triangle, tetrahedron).
Dimensions
A mesh has two important dimensions:
- Topological dimension (
getDimension()): The dimension of the highest dimensional polytopes (e.g., 2 for triangular meshes, 3 for tetrahedral) - Space dimension (
getSpaceDimension()): The dimension of the ambient space in which the mesh is embedded
Example: A 2D surface embedded in 3D space has topological dimension 2 and space dimension 3.
Mesh Entities
Meshes consist of entities of different dimensions:
| Dimension | Name | Examples |
|---|---|---|
| 0 | Vertices | Points |
| 1 | Edges | Line segments |
| 2 | Faces (2D) or Cells (2D meshes) | Triangles, Quadrilaterals |
| 3 | Cells (3D meshes) | Tetrahedra, Hexahedra |
Basic Usage
Here's a simple example creating and querying a mesh:
#include <Rodin/Geometry.h> using namespace Rodin; using namespace Rodin::Geometry; int main() { // Create a 2D triangular mesh Mesh mesh; mesh = mesh.UniformGrid(Polytope::Type::Triangle, {16, 16}); // Query mesh properties std::cout << "Dimension: " << mesh.getDimension() << std::endl; std::cout << "Vertices: " << mesh.getVertexCount() << std::endl; std::cout << "Cells: " << mesh.getCellCount() << std::endl; std::cout << "Volume: " << mesh.getVolume() << std::endl; return 0; }
Detailed Topics
For detailed information on specific aspects of working with meshes, see:
- Mesh Creation - Creating meshes from files or programmatically
- Mesh Connectivity - Understanding connectivity relations
- Mesh Iteration - Iterating over mesh entities
- Geometric Queries - Geometric queries and measurements
- Mesh Input/Output - Input/output operations
- Advanced Utilities - Advanced utilities and transformations