10 #include <tclap/CmdLine.h>
26 int main(
int argc,
char* argv[])
29 "Revises meshes by collapsing duplicate nodes, (optionally) removing "
30 "elements of lower dimension than the mesh itself, and subdividing "
31 "geometrically broken mesh elements.\n\n"
32 "OpenGeoSys-6 software, version " +
35 "Copyright (c) 2012-2021, OpenGeoSys Community "
36 "(http://www.opengeosys.org)",
38 TCLAP::ValueArg<unsigned> minDim_arg(
40 "Minimum dimension of elements to be inserted into new mesh",
false, 1,
44 TCLAP::ValueArg<double> eps_arg(
45 "e",
"eps",
"Minimum distance for nodes not to be collapsed",
false,
46 std::numeric_limits<double>::epsilon(),
"float");
49 TCLAP::ValueArg<std::string> output_arg(
50 "o",
"output-mesh-file",
"output mesh file",
true,
"",
"string");
53 TCLAP::ValueArg<std::string> input_arg(
54 "i",
"input-mesh-file",
"input mesh file",
true,
"",
"string");
56 cmd.parse(argc, argv);
59 std::unique_ptr<MeshLib::Mesh> org_mesh(
65 INFO(
"Mesh read: {:d} nodes, {:d} elements.", org_mesh->getNumberOfNodes(),
66 org_mesh->getNumberOfElements());
69 INFO(
"Simplifying the mesh...");
72 (minDim_arg.isSet() ? minDim_arg.getValue() : org_mesh->getDimension());
73 std::unique_ptr<MeshLib::Mesh> new_mesh(
74 rev.
simplifyMesh(
"revised_mesh", eps_arg.getValue(), minDim));
79 INFO(
"Revised mesh: {:d} nodes, {:d} elements.",
80 new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements());
Definition of the Element class.
void INFO(char const *fmt, Args const &... args)
Definition of the MeshRevision class.
Definition of the Mesh class.
Definition of the Node class.
MeshLib::Mesh * simplifyMesh(const std::string &new_mesh_name, double eps, unsigned min_elem_dim=1) const
GITINFOLIB_EXPORT const std::string ogs_version
MeshLib::Mesh * readMeshFromFile(const std::string &file_name)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, [[maybe_unused]] std::set< std::string > variable_output_names)
Definition of readMeshFromFile function.
int main(int argc, char *argv[])