25{
26 TCLAP::CmdLine cmd(
27 "Append line elements into a mesh.\n\n"
28 "OpenGeoSys-6 software, version " +
30 ".\n"
31 "Copyright (c) 2012-2024, OpenGeoSys Community "
32 "(http://www.opengeosys.org)",
34 TCLAP::ValueArg<std::string> mesh_in(
35 "i", "mesh-input-file",
36 "the name of the file containing the input mesh", true, "",
37 "file name of input mesh");
38 cmd.add(mesh_in);
39 TCLAP::ValueArg<std::string> mesh_out(
40 "o", "mesh-output-file",
41 "the name of the file the mesh will be written to", true, "",
42 "file name of output mesh");
43 cmd.add(mesh_out);
44 TCLAP::ValueArg<std::string> geoFileArg(
45 "g", "geo-file",
46 "the name of the geometry file which contains polylines", true, "",
47 "the name of the geometry file");
48 cmd.add(geoFileArg);
49
50 TCLAP::ValueArg<std::string> gmsh_path_arg("", "gmsh-path",
51 "the path to the gmsh binary",
52 false, "", "path as string");
53 cmd.add(gmsh_path_arg);
54
55
56 cmd.parse(argc, argv);
57
59
60
63 gmsh_path_arg.getValue());
64
66 if (geo_names.empty())
67 {
68 ERR(
"No geometries found.");
69 return EXIT_FAILURE;
70 }
73 if (!ply_vec)
74 {
75 ERR(
"Could not find polylines in geometry '{:s}'.", geo_names.front());
76 return EXIT_FAILURE;
77 }
78
79
81 mesh_in.getValue(), true ));
82 if (!mesh)
83 {
84 ERR(
"Mesh file '{:s}' not found", mesh_in.getValue());
85 return EXIT_FAILURE;
86 }
87 INFO(
"Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
88 mesh->getNumberOfElements());
89
90
91 std::unique_ptr<MeshLib::Mesh> new_mesh =
93 INFO(
"Mesh created: {:d} nodes, {:d} elements.",
94 new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements());
95
97
98 return EXIT_SUCCESS;
99}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Container class for geometric objects.
std::vector< std::string > getGeometryNames() const
Returns the names of all geometry vectors.
const PolylineVec * getPolylineVecObj(const std::string &name) const
The class TemplateVec takes a unique name and manages a std::vector of pointers to data elements of t...
void readGeometryFromFile(std::string const &fname, GeoLib::GEOObjects &geo_objs, std::string const &gmsh_path)
GITINFOLIB_EXPORT const std::string ogs_version
MeshLib::Mesh * readMeshFromFile(const std::string &file_name, bool const compute_element_neighbors)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names)