28int main(
int argc,
char* argv[])
31 "Converts a geometry defined on a given mesh to distinct meshes. The "
32 "documentation is available at "
33 "https://www.opengeosys.org/docs/tools/meshing-submeshes/"
34 "constructmeshesfromgeometry/.\n\n"
35 "OpenGeoSys-6 software, version " +
38 "Copyright (c) 2012-2026, OpenGeoSys Community "
39 "(http://www.opengeosys.org)",
42 TCLAP::ValueArg<double> search_length_arg(
45 "search length determining radius for the node search algorithm. "
46 "Non-negative floating point number, (min = 0)",
50 cmd.add(search_length_arg);
52 TCLAP::ValueArg<std::string> geometry_arg(
55 "Input (.gml | .gli). The file name of the input geometry",
59 cmd.add(geometry_arg);
61 TCLAP::ValueArg<std::string> mesh_arg(
65 "The file name of the input mesh where the geometry is defined",
71 TCLAP::SwitchArg multiple_nodes_allowed_arg(
72 "",
"multiple-nodes-allowed",
73 "Allows multiple mesh nodes in eps environment.");
74 cmd.add(multiple_nodes_allowed_arg);
77 cmd.add(log_level_arg);
78 cmd.parse(argc, argv);
83 std::unique_ptr<MeshLib::Mesh> mesh{
86 auto const geo_objects =
readGeometry(geometry_arg.getValue());
88 double const search_length = search_length_arg.getValue();
90 auto const extracted_meshes = constructAdditionalMeshesFromGeoObjects(
93 std::make_unique<MeshGeoToolsLib::SearchLength>(search_length),
94 multiple_nodes_allowed_arg.getValue());
96 for (
auto const& m_ptr : extracted_meshes)
100 ERR(
"Could not create a mesh for each given geometry.");
103 if (m_ptr->getNodes().empty())
106 "The created mesh '{:s}' hasn't any nodes or elements and thus "
107 "it isn't written to file.",