1#include <gtest/gtest.h>
2#include <lf/mesh/mesh.h>
10 const auto dim_mesh =
mesh.DimMesh();
12 for (size_type co_dim = 0; co_dim <= dim_mesh; ++co_dim) {
14 const auto no_of_entities =
mesh.NumEntities(co_dim);
16 std::vector<int> idx_use(no_of_entities, 0);
18 for (
const Entity* e :
mesh.Entities(co_dim)) {
22 EXPECT_LT(current_idx, no_of_entities)
23 <<
"Index " << current_idx <<
" out of range";
24 idx_use[current_idx]++;
28 EXPECT_TRUE(e_ptr) <<
"Invalid pointer to entity "
29 <<
static_cast<int>(current_idx);
30 if (e_ptr !=
nullptr) {
31 EXPECT_EQ(current_idx,
mesh.Index(*e_ptr))
32 <<
"Index mismatch for codim " << co_dim <<
", index "
39 for (size_type idx_cnt = 0; idx_cnt < no_of_entities; ++idx_cnt) {
41 EXPECT_EQ(idx_use[idx_cnt], 1)
42 <<
"Index " << idx_cnt <<
" occurs " << idx_use[idx_cnt] <<
" times!";
Interface class representing a topological entity in a cellular complex
Abstract interface for objects representing a single mesh.
unsigned int size_type
general type for variables related to size of arrays
unsigned int glb_idx_t
type for global index of mesh entities (nodes, edges, cells)
Utilities for testing sanity of mesh data structures and tests involving meshes.
void checkEntityIndexing(const Mesh &mesh)
Function for testing mesh indexing (should be called from google test)
Defines a set of interface classes that define a mesh manager and provides mesh-related tools that bu...