27int main(
int argc,
char* argv[])
30 "Revises meshes by collapsing duplicate nodes, (optionally) removing "
31 "elements of lower dimension than the mesh itself, and subdividing "
32 "geometrically broken mesh elements.\n\n"
33 "OpenGeoSys-6 software, version " +
36 "Copyright (c) 2012-2024, OpenGeoSys Community "
37 "(http://www.opengeosys.org)",
39 TCLAP::ValueArg<unsigned> minDim_arg(
41 "Minimum dimension of elements to be inserted into new mesh",
false, 1,
45 TCLAP::ValueArg<double> eps_arg(
46 "e",
"eps",
"Minimum distance for nodes not to be collapsed",
false,
47 std::numeric_limits<double>::epsilon(),
"float");
50 TCLAP::ValueArg<std::string> output_arg(
51 "o",
"output-mesh-file",
"output mesh file",
true,
"",
"string");
54 TCLAP::ValueArg<std::string> input_arg(
55 "i",
"input-mesh-file",
"input mesh file",
true,
"",
"string");
57 cmd.parse(argc, argv);
62 std::unique_ptr<MeshLib::Mesh> org_mesh(
68 INFO(
"Mesh read: {:d} nodes, {:d} elements.", org_mesh->getNumberOfNodes(),
69 org_mesh->getNumberOfElements());
72 INFO(
"Simplifying the mesh...");
75 (minDim_arg.isSet() ? minDim_arg.getValue() : org_mesh->getDimension());
76 std::unique_ptr<MeshLib::Mesh> new_mesh(
77 rev.
simplifyMesh(
"revised_mesh", eps_arg.getValue(), minDim));
82 INFO(
"Revised mesh: {:d} nodes, {:d} elements.",
83 new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements());