12#include <spdlog/spdlog.h>
13#include <tclap/CmdLine.h>
32int main(
int argc,
char* argv[])
35 "Reads a Gocad stratigraphic grid file (file ending sg) and writes the "
36 "data in the vtk unstructured grid file format. The documentation is "
38 "https://www.opengeosys.org/docs/tools/meshing/gocadsgridreader/."
41 "software, version " +
44 "Copyright (c) 2012-2024, OpenGeoSys Community "
45 "(http://www.opengeosys.org)",
48 TCLAP::SwitchArg face_set_arg(
"f",
"generate-face-sets",
49 "Generate face sets.");
50 cmd.add(face_set_arg);
52 TCLAP::ValueArg<std::string> mesh_output_arg(
53 "o",
"output-mesh",
"vtk unstructured grid file name",
true,
"",
55 cmd.add(mesh_output_arg);
57 TCLAP::ValueArg<std::string> sg_file_arg(
58 "s",
"sg",
"Gocad stratigraphic grid file name",
true,
"",
62 cmd.parse(argc, argv);
65 MPI_Init(&argc, &argv);
69 INFO(
"Start reading Gocad SGrid.");
71 INFO(
"End reading Gocad SGrid.");
73 if (face_set_arg.getValue())
75 INFO(
"Generating a mesh for every face set.");
80 std::unique_ptr<MeshLib::Mesh> mesh(reader.
getMesh());
83 INFO(
"Writing mesh to '{:s}'.", mesh_output_arg.getValue());
Definition of the Element class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the Mesh class.
Definition of the Node class.
int main(int argc, char *argv[])
std::unique_ptr< MeshLib::Mesh > getMesh() const
std::string extractPath(std::string const &pathname)
void generateFaceSets(GocadSGridReader const &reader, std::string const &path)
GITINFOLIB_EXPORT const std::string ogs_version
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names)