30int main(
int argc,
char* argv[])
33 "Revises meshes by collapsing duplicate nodes, (optionally) removing "
34 "elements of lower dimension than the mesh itself, and subdividing "
35 "geometrically broken mesh elements.\n\n"
36 "OpenGeoSys-6 software, version " +
39 "Copyright (c) 2012-2024, OpenGeoSys Community "
40 "(http://www.opengeosys.org)",
42 TCLAP::ValueArg<unsigned> minDim_arg(
44 "Minimum dimension of elements to be inserted into new mesh",
false, 1,
48 TCLAP::ValueArg<double> eps_arg(
49 "e",
"eps",
"Minimum distance for nodes not to be collapsed",
false,
50 std::numeric_limits<double>::epsilon(),
"float");
53 TCLAP::ValueArg<std::string> output_arg(
54 "o",
"output-mesh-file",
"output mesh file",
true,
"",
"string");
57 TCLAP::ValueArg<std::string> input_arg(
58 "i",
"input-mesh-file",
"input mesh file",
true,
"",
"string");
60 cmd.parse(argc, argv);
63 MPI_Init(&argc, &argv);
67 std::unique_ptr<MeshLib::Mesh> org_mesh(
76 INFO(
"Mesh read: {:d} nodes, {:d} elements.", org_mesh->getNumberOfNodes(),
77 org_mesh->getNumberOfElements());
80 INFO(
"Simplifying the mesh...");
83 (minDim_arg.isSet() ? minDim_arg.getValue() : org_mesh->getDimension());
84 std::unique_ptr<MeshLib::Mesh> new_mesh(
85 rev.
simplifyMesh(
"revised_mesh", eps_arg.getValue(), minDim));
90 INFO(
"Revised mesh: {:d} nodes, {:d} elements.",
91 new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements());