PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
anonymous_namespace{particleMesh.cpp} Namespace Reference

Functions

void maybeWriteMeshFile (const inp::MeshDeck &zmeshDeck, const mesh::Mesh &mesh)
 

Function Documentation

◆ maybeWriteMeshFile()

void anonymous_namespace{particleMesh.cpp}::maybeWriteMeshFile ( const inp::MeshDeck zmeshDeck,
const mesh::Mesh mesh 
)

Definition at line 26 of file particleMesh.cpp.

26 {
27 if (!zmeshDeck.d_writeMeshFile || zmeshDeck.d_filename.empty())
28 return;
29 // Deck File is typically *.msh; MshWriter appends/checks that extension.
30 const std::string stem = util::io::removeExtensionFromFile(zmeshDeck.d_filename);
31 rw::writer::Writer writer(stem, "msh", "");
32 writer.appendMesh(mesh.getNodesP(), mesh.getElementType(),
33 mesh.getElementConnectivitiesP());
34 writer.close();
35}
A interface class writing data.
Definition writer.h:44
Collection of methods and data related to finite element and mesh.
Definition mesh.cpp:28
std::string removeExtensionFromFile(std::string const &filename)
Remove extension from the filename Source - https://stackoverflow.com/a/24386991.
Definition io.h:296
bool d_writeMeshFile
If true (default), Gmsh-based create-mesh paths write a .msh file; set false for in-memory only.
Definition meshDeck.h:53
std::string d_filename
Filename to read mesh data.
Definition meshDeck.h:29

References rw::writer::Writer::appendMesh(), rw::writer::Writer::close(), inp::MeshDeck::d_filename, inp::MeshDeck::d_writeMeshFile, and util::io::removeExtensionFromFile().

Referenced by mesh_gen::createParticleMesh().

Here is the call graph for this function:
Here is the caller graph for this function: