33int main(
int argc,
char* argv[])
36 "Converts a geometry defined on a given mesh to distinct meshes. The "
37 "documentation is available at "
38 "https://www.opengeosys.org/docs/tools/meshing-submeshes/"
39 "constructmeshesfromgeometry/.\n\n"
40 "OpenGeoSys-6 software, version " +
43 "Copyright (c) 2012-2024, OpenGeoSys Community "
44 "(http://www.opengeosys.org)",
47 TCLAP::ValueArg<double> search_length_arg(
50 "search length determining radius for the node search algorithm. "
51 "Non-negative floating point number (default 1e-16) ",
55 cmd.add(search_length_arg);
57 TCLAP::ValueArg<std::string> geometry_arg(
"g",
59 "the file name the geometry",
62 "geometry file name");
63 cmd.add(geometry_arg);
65 TCLAP::ValueArg<std::string> mesh_arg(
68 "the file name of the mesh where the geometry is defined",
74 TCLAP::SwitchArg multiple_nodes_allowed_arg(
75 "",
"multiple-nodes-allowed",
76 "Allows multiple mesh nodes in eps environment.");
77 cmd.add(multiple_nodes_allowed_arg);
79 cmd.parse(argc, argv);
82 std::unique_ptr<MeshLib::Mesh> mesh{
85 auto const geo_objects =
readGeometry(geometry_arg.getValue());
87 double const search_length = search_length_arg.getValue();
89 auto const extracted_meshes = constructAdditionalMeshesFromGeoObjects(
92 std::make_unique<MeshGeoToolsLib::SearchLength>(search_length),
93 multiple_nodes_allowed_arg.getValue());
95 for (
auto const& m_ptr : extracted_meshes)
99 ERR(
"Could not create a mesh for each given geometry.");
102 if (m_ptr->getNodes().empty())
105 "The created mesh '{:s}' hasn't any nodes or elements and thus "
106 "it isn't written to file.",