10#include <tclap/CmdLine.h>
36int main(
int argc,
char* argv[])
39 "Converts TIN file into VTU file.\n\n"
40 "OpenGeoSys-6 software, version " +
43 "Copyright (c) 2012-2024, OpenGeoSys Community "
44 "(http://www.opengeosys.org)",
46 TCLAP::ValueArg<std::string> inArg(
47 "i",
"input-tin-file",
"the name of the file containing the input TIN",
50 TCLAP::ValueArg<std::string> outArg(
51 "o",
"output-vtu-file",
52 "the name of the file the mesh will be written to",
true,
"",
"string");
54 cmd.parse(argc, argv);
57 MPI_Init(&argc, &argv);
60 INFO(
"reading the TIN file...");
61 const std::string tinFileName(inArg.getValue());
62 std::string point_vec_name{
"SurfacePoints"};
65 std::unique_ptr<GeoLib::Surface> sfc(
74 INFO(
"TIN read: {:d} points, {:d} triangles", point_vec.size(),
75 sfc->getNumberOfTriangles());
77 INFO(
"converting to mesh data");
80 std::numeric_limits<double>::epsilon()));
81 INFO(
"Mesh created: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
82 mesh->getNumberOfElements());
84 INFO(
"Write it into VTU");
Definition of the Point class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Mesh class.
Definition of the PointVec class.
int main(int argc, char *argv[])
Implementation of the VtuInterface class.
static GeoLib::Surface * readTIN(std::string const &fname, GeoLib::PointVec &pnt_vec, std::vector< std::string > *errors=nullptr)
This class manages pointers to Points in a std::vector along with a name. It also handles the deletio...
std::map< std::string, std::size_t > NameIdMap
Reads and writes VtkXMLUnstructuredGrid-files (vtu) to and from OGS data structures....
bool writeToFile(std::filesystem::path const &file_path)
Definition of mesh to geometry conversion.
std::string extractBaseNameWithoutExtension(std::string const &pathname)
GITINFOLIB_EXPORT const std::string ogs_version