12#include <spdlog/spdlog.h>
13#include <tclap/CmdLine.h>
31int main(
int argc,
char* argv[])
34 "Reads a Gocad stratigraphic grid file (file ending sg) and writes the "
35 "data in the vtk unstructured grid file format. The documentation is "
37 "https://www.opengeosys.org/docs/tools/meshing/gocadsgridreader/."
40 "software, version " +
43 "Copyright (c) 2012-2025, OpenGeoSys Community "
44 "(http://www.opengeosys.org)",
47 TCLAP::SwitchArg face_set_arg(
"f",
"generate-face-sets",
48 "Generate face sets.");
49 cmd.add(face_set_arg);
51 TCLAP::ValueArg<std::string> mesh_output_arg(
52 "o",
"output-mesh",
"Output (.vtu). Unstructured grid filename",
true,
54 cmd.add(mesh_output_arg);
56 TCLAP::ValueArg<std::string> sg_file_arg(
57 "s",
"sg",
"Input (.sg). Gocad stratigraphic grid filename",
true,
"",
61 cmd.add(log_level_arg);
63 cmd.parse(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
TCLAP::ValueArg< std::string > makeLogLevelArg()
void initOGSLogger(std::string const &log_level)
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)