12#include <tclap/CmdLine.h>
27int main(
int argc,
char* argv[])
30 "Append line elements into a mesh.\n\n"
31 "OpenGeoSys-6 software, version " +
34 "Copyright (c) 2012-2024, OpenGeoSys Community "
35 "(http://www.opengeosys.org)",
37 TCLAP::ValueArg<std::string> mesh_in(
38 "i",
"mesh-input-file",
39 "the name of the file containing the input mesh",
true,
"",
40 "file name of input mesh");
42 TCLAP::ValueArg<std::string> mesh_out(
43 "o",
"mesh-output-file",
44 "the name of the file the mesh will be written to",
true,
"",
45 "file name of output mesh");
47 TCLAP::ValueArg<std::string> geoFileArg(
49 "the name of the geometry file which contains polylines",
true,
"",
50 "the name of the geometry file");
53 TCLAP::ValueArg<std::string> gmsh_path_arg(
"",
"gmsh-path",
54 "the path to the gmsh binary",
55 false,
"",
"path as string");
56 cmd.add(gmsh_path_arg);
59 cmd.parse(argc, argv);
62 MPI_Init(&argc, &argv);
68 gmsh_path_arg.getValue());
71 if (geo_names.empty())
73 ERR(
"No geometries found.");
83 ERR(
"Could not find polylines in geometry '{:s}'.", geo_names.front());
92 mesh_in.getValue(),
true ));
95 ERR(
"Mesh file '{:s}' not found", mesh_in.getValue());
105 std::unique_ptr<MeshLib::Mesh> new_mesh =
107 INFO(
"Mesh created: {:d} nodes, {:d} elements.",
108 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.