PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
testMeshGen.cpp File Reference
#include "mesh_gen/meshGenerator.h"
#include "geom/complexGeomObjects.h"
#include "geom/geomObjects.h"
#include "geom/geomObjectsUtil.h"
#include "inp/meshDeck.h"
#include "inp/modelDeck.h"
#include "mesh/mesh.h"
#include "util/io.h"
#include "util/point.h"
#include <cmath>
#include <filesystem>
#include <format>
#include <memory>
#include <vector>
Include dependency graph for testMeshGen.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{testMeshGen.cpp}
 

Functions

size_t anonymous_namespace{testMeshGen.cpp}::meshDimForBuiltin (const std::string &deckName, const std::shared_ptr< geom::GeomObject > &obj)
 Model dimension for mesh deck (annulus deck names map to annulus_object with d_dim set).
 
bool anonymous_namespace{testMeshGen.cpp}::testCircleMeshWritesFiles ()
 Circle: write .msh and .vtk via the built-in Gmsh path (file I/O check).
 
bool anonymous_namespace{testMeshGen.cpp}::builtinMeshCheckForGeometry (const std::string &geomName, double s)
 For one acceptable geometry name: exampleGeomParams → mesh in memory → non-empty nodes, every node inside geom::box() (loose tolerance).
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 134 of file testMeshGen.cpp.

134 {
135 util::io::log("Starting mesh generator tests (loop over geom::getAcceptableGeometries)...\n");
136
137 bool allTestsPassed = true;
138
140 util::io::log("Circle mesh file output test failed.\n");
141 allTestsPassed = false;
142 }
143
144 const double s = 0.001;
145 util::io::log("Builtin Gmsh mesh checks (exampleGeomParams + bounding box)...\n");
146 for (const std::string &name : geom::getAcceptableGeometries()) {
147 // "complex" needs subtype/flag vectors; not covered by exampleGeomParams.
148 if (name == "complex")
149 continue;
150 if (!builtinMeshCheckForGeometry(name, s)) {
151 util::io::log(std::format("Mesh check failed for geometry: {}\n", name));
152 allTestsPassed = false;
153 }
154 }
155
156 if (allTestsPassed) {
157 util::io::log("All mesh generator tests passed.\n");
158 return 0;
159 }
160 util::io::log("Some mesh generator tests failed.\n");
161 return 1;
162}
bool testCircleMeshWritesFiles()
Circle: write .msh and .vtk via the built-in Gmsh path (file I/O check).
bool builtinMeshCheckForGeometry(const std::string &geomName, double s)
For one acceptable geometry name: exampleGeomParams → mesh in memory → non-empty nodes,...
const std::vector< std::string > & getAcceptableGeometries()
Returns list of acceptable geometries for PeriDEM simulation.
void log(std::ostringstream &oss, bool screen_out=false, int printMpiRank=print_default_mpi_rank)
Global method to log the message.
Definition io.cpp:41

References anonymous_namespace{testMeshGen.cpp}::builtinMeshCheckForGeometry(), geom::getAcceptableGeometries(), util::io::log(), and anonymous_namespace{testMeshGen.cpp}::testCircleMeshWritesFiles().

Here is the call graph for this function: