12#include <tclap/CmdLine.h>
24int main(
int argc,
char* argv[])
27 "Append line elements into a mesh.\n\n"
28 "OpenGeoSys-6 software, version " +
31 "Copyright (c) 2012-2025, 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");
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");
44 TCLAP::ValueArg<std::string> geoFileArg(
46 "the name of the geometry file which contains polylines",
true,
"",
47 "the name of the geometry file");
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);
56 cmd.parse(argc, argv);
63 gmsh_path_arg.getValue());
66 if (geo_names.empty())
68 ERR(
"No geometries found.");
75 ERR(
"Could not find polylines in geometry '{:s}'.", geo_names.front());
81 mesh_in.getValue(),
true ));
84 ERR(
"Mesh file '{:s}' not found", mesh_in.getValue());
91 std::unique_ptr<MeshLib::Mesh> new_mesh =
93 INFO(
"Mesh created: {:d} nodes, {:d} elements.",
94 new_mesh->getNumberOfNodes(), new_mesh->getNumberOfElements());
Definition of the GEOObjects class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Mesh class.
Definition of the PolylineVec class.
int main(int argc, char *argv[])
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...
std::size_t getNumberOfNodes() const
Get the number of nodes.
std::size_t getNumberOfElements() const
Get the number of elements.
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)
Definition of readMeshFromFile function.