LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Utilities for testing sanity of mesh data structures and tests involving meshes. More...
Functions | |
void | checkEntityIndexing (const Mesh &mesh) |
Function for testing mesh indexing (should be called from google test) | |
void | checkGeometryOrientation (const Entity &e) |
Makes sure that the coordinates of the nodes obtained through e.SubEntities()[i].Geometry() match the ones obtained through e.Geometry() | |
void | checkLocalTopology (const Entity &e) |
Function for testing consistency of subentities. | |
void | checkRelCodim (const Entity &e) |
consistence check for local (relative) co-dimensions | |
bool | checkMeshCompleteness (const Mesh &mesh) |
Function testing topological completeness of a mesh. | |
std::shared_ptr< spdlog::logger > & | WatertightLogger () |
Logger that is used by isWatertightMesh() to output additional information. | |
std::vector< std::pair< lf::base::RefEl, base::glb_idx_t > > | isWatertightMesh (const Mesh &mesh, bool vertices_only=true) |
check for match of entity geometries | |
std::shared_ptr< lf::mesh::Mesh > | GenerateHybrid2DTestMesh (int selector=0, double scale=1.0) |
Generates a simple 2D hybrid test mesh. | |
Variables | |
static const lf::base::size_type | GenerateHybrid2DTestMesh_maxsel = 8 |
Utilities for testing sanity of mesh data structures and tests involving meshes.
void lf::mesh::test_utils::checkEntityIndexing | ( | const Mesh & | mesh | ) |
Function for testing mesh indexing (should be called from google test)
mesh | A reference to the mesh to be checked |
This function tests whether all entities of a mesh are indexed consecutively
Definition at line 8 of file check_entity_indexing.cc.
References lf::mesh::Mesh::DimMesh(), lf::mesh::Mesh::Entities(), lf::mesh::Mesh::EntityByIndex(), lf::mesh::Mesh::Index(), and lf::mesh::Mesh::NumEntities().
void lf::mesh::test_utils::checkGeometryOrientation | ( | const Entity & | e | ) |
Makes sure that the coordinates of the nodes obtained through e.SubEntities()[i].Geometry()
match the ones obtained through e.Geometry()
e | The entity to check. |
Definition at line 6 of file check_geometry_orientation.cc.
References lf::base::RefEl::Dimension(), lf::mesh::Entity::Geometry(), lf::geometry::Geometry::Global(), lf::base::RefEl::NodeCoords(), lf::mesh::Entity::RefEl(), and lf::mesh::Entity::SubEntities().
void lf::mesh::test_utils::checkLocalTopology | ( | const Entity & | e | ) |
Function for testing consistency of subentities.
e | a (reference) to a mesh entity |
This function verifies the consistency of the local topology, that is whether subentities of sub-entities are also subentities of the entity.
Definition at line 6 of file check_local_topology.cc.
References lf::base::RefEl::Dimension(), lf::mesh::Entity::RefEl(), and lf::mesh::Entity::SubEntities().
bool lf::mesh::test_utils::checkMeshCompleteness | ( | const Mesh & | mesh | ) |
Function testing topological completeness of a mesh.
mesh | A reference to the mesh to be checked |
All entities of dimension dim of a mesh must be subentities of at least one entity of dimension dim+1, if dim is smaller than the topological dimension of the mesh
Definition at line 13 of file check_mesh_completeness.cc.
References lf::mesh::Mesh::DimMesh(), lf::mesh::Mesh::Entities(), lf::mesh::Mesh::Index(), and lf::mesh::Mesh::NumEntities().
void lf::mesh::test_utils::checkRelCodim | ( | const Entity & | e | ) |
consistence check for local (relative) co-dimensions
e | a (reference) to a mesh entity of any type |
Implements a test whether dimensions of sub-entities match the relative dimension with which they are accessed through the Entity::SubEntities() method of lf::mesh::Entity.
Definition at line 58 of file check_local_topology.cc.
References lf::base::RefEl::Dimension(), lf::mesh::Entity::RefEl(), and lf::mesh::Entity::SubEntities().
std::shared_ptr< lf::mesh::Mesh > lf::mesh::test_utils::GenerateHybrid2DTestMesh | ( | int | selector = 0, |
double | scale = 1.0 ) |
Generates a simple 2D hybrid test mesh.
selector | integer parameter for the selection of test meshes |
scale | factor for scaling all the coordinates in the meshes |
The following line of code provides a pointer to the default test mesh:
Definition at line 14 of file test_meshes.cc.
References lf::mesh::utils::TPTriagMeshBuilder::Build(), lf::base::RefEl::kQuad(), lf::base::RefEl::kTria(), lf::mesh::utils::StructuredMeshBuilder::setBottomLeftCorner(), and lf::mesh::utils::StructuredMeshBuilder::setNumYCells().
std::vector< std::pair< lf::base::RefEl, base::glb_idx_t > > lf::mesh::test_utils::isWatertightMesh | ( | const Mesh & | mesh, |
bool | vertices_only = true ) |
check for match of entity geometries
mesh | A reference to the mesh to be checked |
vertices_only | if true, then only the correct vertex positions are checked, otherwise edges are included |
This function logs additional information to WatertightLogger(). See Loggers and Debug output for more information.
Definition at line 86 of file check_mesh_completeness.cc.
References lf::mesh::Mesh::DimMesh(), lf::mesh::Mesh::Entities(), lf::mesh::Mesh::Index(), lf::base::RefEl::NodeCoords(), lf::base::RefEl::NumNodes(), lf::base::RefEl::RefEl(), and WatertightLogger().
std::shared_ptr< spdlog::logger > & lf::mesh::test_utils::WatertightLogger | ( | ) |
Logger that is used by isWatertightMesh() to output additional information.
Definition at line 80 of file check_mesh_completeness.cc.
References lf::base::InitLogger().
Referenced by isWatertightMesh().
|
static |
Definition at line 57 of file test_meshes.h.