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 127 of file testMeshGen.cpp.

127 {
128 util::io::log("Starting mesh generator tests (loop over geom::getAcceptableGeometries)...\n");
129
130 bool allTestsPassed = true;
131
133 util::io::log("Circle mesh file output test failed.\n");
134 allTestsPassed = false;
135 }
136
137 const double s = 0.001;
138 util::io::log("Builtin Gmsh mesh checks (exampleGeomParams + bounding box)...\n");
139 for (const std::string &name : geom::getAcceptableGeometries()) {
140 // "complex" needs subtype/flag vectors; not covered by exampleGeomParams.
141 if (name == "complex")
142 continue;
143 if (!builtinMeshCheckForGeometry(name, s)) {
144 util::io::log(std::format("Mesh check failed for geometry: {}\n", name));
145 allTestsPassed = false;
146 }
147 }
148
149 if (allTestsPassed) {
150 util::io::log("All mesh generator tests passed.\n");
151 return 0;
152 }
153 util::io::log("Some mesh generator tests failed.\n");
154 return 1;
155}
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: