35int main(
int argc,
char* argv[])
38 "Converts a geometry defined on a given mesh to distinct meshes. The "
39 "documentation is available at "
40 "https://www.opengeosys.org/docs/tools/meshing-submeshes/"
41 "constructmeshesfromgeometry/.\n\n"
42 "OpenGeoSys-6 software, version " +
45 "Copyright (c) 2012-2024, OpenGeoSys Community "
46 "(http://www.opengeosys.org)",
49 TCLAP::ValueArg<double> search_length_arg(
52 "search length determining radius for the node search algorithm. "
53 "Non-negative floating point number (default 1e-16) ",
57 cmd.add(search_length_arg);
59 TCLAP::ValueArg<std::string> geometry_arg(
"g",
61 "the file name the geometry",
64 "geometry file name");
65 cmd.add(geometry_arg);
67 TCLAP::ValueArg<std::string> mesh_arg(
70 "the file name of the mesh where the geometry is defined",
76 TCLAP::SwitchArg multiple_nodes_allowed_arg(
77 "",
"multiple-nodes-allowed",
78 "Allows multiple mesh nodes in eps environment.");
79 cmd.add(multiple_nodes_allowed_arg);
81 cmd.parse(argc, argv);
84 MPI_Init(&argc, &argv);
86 std::unique_ptr<MeshLib::Mesh> mesh{
89 auto const geo_objects =
readGeometry(geometry_arg.getValue());
91 double const search_length = search_length_arg.getValue();
93 auto const extracted_meshes = constructAdditionalMeshesFromGeoObjects(
96 std::make_unique<MeshGeoToolsLib::SearchLength>(search_length),
97 multiple_nodes_allowed_arg.getValue());
99 for (
auto const& m_ptr : extracted_meshes)
103 ERR(
"Could not create a mesh for each given geometry.");
109 if (m_ptr->getNodes().empty())
112 "The created mesh '{:s}' hasn't any nodes or elements and thus "
113 "it isn't written to file.",