21{
22 TCLAP::CmdLine cmd(
23 "Append line elements into a mesh.\n\n"
24 "OpenGeoSys-6 software, version " +
26 ".\n"
27 "Copyright (c) 2012-2026, OpenGeoSys Community "
28 "(http://www.opengeosys.org)",
30 TCLAP::ValueArg<std::string> mesh_in(
31 "i", "mesh-input-file",
32 "Input (.vtu). The name of the file containing the input mesh", true,
33 "", "INPUT_FILE");
34 cmd.add(mesh_in);
35 TCLAP::ValueArg<std::string> mesh_out(
36 "o", "mesh-output-file",
37 "Output (.vtu | .msh). The name of the file the mesh will be written "
38 "to",
39 true, "", "OUTPUT_FILE");
40 cmd.add(mesh_out);
41 TCLAP::ValueArg<std::string> geoFileArg(
42 "g", "geo-file",
43 "Input (.gml). The name of the input geometry file which contains "
44 "polylines",
45 true, "", "INPUT_FILE");
46 cmd.add(geoFileArg);
48 cmd.add(log_level_arg);
49
50 TCLAP::ValueArg<std::string> gmsh_path_arg(
51 "", "gmsh-path", "Input (.msh). The path to the input gmsh binary file",
52 false, "", "INPUT_FILE");
53 cmd.add(gmsh_path_arg);
54
55
56 cmd.parse(argc, argv);
57
60
61
64 gmsh_path_arg.getValue());
65
67 if (geo_names.empty())
68 {
69 ERR(
"No geometries found.");
70 return EXIT_FAILURE;
71 }
74 if (!ply_vec)
75 {
76 ERR(
"Could not find polylines in geometry '{:s}'.", geo_names.front());
77 return EXIT_FAILURE;
78 }
79
80
82 mesh_in.getValue(), true ));
83 if (!mesh)
84 {
85 ERR(
"Mesh file '{:s}' not found", mesh_in.getValue());
86 return EXIT_FAILURE;
87 }
88 INFO(
"Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
89 mesh->getNumberOfElements());
90
91
92 std::unique_ptr<MeshLib::Mesh> new_mesh =
94 INFO(
"Mesh created: {:d} nodes, {:d} elements.",
95 new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements());
96
98
99 return EXIT_SUCCESS;
100}
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
TCLAP::ValueArg< std::string > makeLogLevelArg()
void initOGSLogger(std::string const &log_level)
void readGeometryFromFile(std::string const &fname, GeoLib::GEOObjects &geo_objs, std::string const &gmsh_path)
TemplateVec< GeoLib::Polyline > PolylineVec
class PolylineVec encapsulate a std::vector of Polylines additional one can give the vector of polyli...
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)