OGS
postLIE.cpp File Reference

Detailed Description

Definition in file postLIE.cpp.

#include <tclap/CmdLine.h>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <map>
#include <memory>
#include <vector>
#include "BaseLib/FileTools.h"
#include "BaseLib/Logging.h"
#include "BaseLib/MPI.h"
#include "BaseLib/TCLAPArguments.h"
#include "InfoLib/GitInfo.h"
#include "MeshLib/IO/readMeshFromFile.h"
#include "MeshLib/IO/writeMeshToFile.h"
#include "MeshLib/Mesh.h"
#include "MeshToolsLib/MeshEditing/ConvertToLinearMesh.h"
#include "ProcessLib/LIE/Common/MeshUtils.h"
#include "ProcessLib/LIE/Common/PostUtils.h"
Include dependency graph for postLIE.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{postLIE.cpp}
 

Functions

void anonymous_namespace{postLIE.cpp}::postVTU (std::string const &int_vtu_filename, std::string const &out_vtu_filename)
 
void anonymous_namespace{postLIE.cpp}::postPVD (std::string const &in_pvd_filename, std::string const &out_pvd_filename, bool const allow_overwrite)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 127 of file postLIE.cpp.

128{
129 TCLAP::CmdLine cmd(
130 "Post-process results of the LIE approach.\n\n"
131 "OpenGeoSys-6 software, version " +
133 ".\n"
134 "Copyright (c) 2012-2025, OpenGeoSys Community "
135 "(http://www.opengeosys.org)",
137 TCLAP::ValueArg<std::string> arg_out_file(
138 "o", "output-file",
139 "Output (.vtu | .pvd). The name of the new PVD or VTU file", true, "",
140 "OUTPUT_PATH");
141 cmd.add(arg_out_file);
142 TCLAP::ValueArg<std::string> arg_in_file(
143 "i", "input-file",
144 "Input (.vtu | .pvd). The original PVD or VTU file name", true, "",
145 "INPUT_FILE");
146 cmd.add(arg_in_file);
147 TCLAP::SwitchArg nooverwrite_arg(
148 "",
149 "no-overwrite",
150 "don't overwrite existing post processed VTU files");
151 cmd.add(nooverwrite_arg);
152 auto log_level_arg = BaseLib::makeLogLevelArg();
153 cmd.add(log_level_arg);
154
155 cmd.parse(argc, argv);
156
157 BaseLib::MPI::Setup mpi_setup(argc, argv);
158 BaseLib::initOGSLogger(log_level_arg.getValue());
159
160 auto const in_file_ext = BaseLib::getFileExtension(arg_in_file.getValue());
161 if (in_file_ext == ".pvd")
162 {
163 postPVD(arg_in_file.getValue(), arg_out_file.getValue(),
164 !nooverwrite_arg.getValue());
165 }
166 else if (in_file_ext == ".vtu")
167 {
168 postVTU(arg_in_file.getValue(), arg_out_file.getValue());
169 }
170 else
171 {
172 OGS_FATAL("The given file type ({:s}) is not supported.", in_file_ext);
173 }
174
175 return EXIT_SUCCESS;
176}
#define OGS_FATAL(...)
Definition Error.h:26
TCLAP::ValueArg< std::string > makeLogLevelArg()
void initOGSLogger(std::string const &log_level)
Definition Logging.cpp:64
std::string getFileExtension(const std::string &path)
GITINFOLIB_EXPORT const std::string ogs_version
void postVTU(std::string const &int_vtu_filename, std::string const &out_vtu_filename)
Definition postLIE.cpp:32
void postPVD(std::string const &in_pvd_filename, std::string const &out_pvd_filename, bool const allow_overwrite)
Definition postLIE.cpp:70

References BaseLib::getFileExtension(), BaseLib::initOGSLogger(), BaseLib::makeLogLevelArg(), OGS_FATAL, GitInfoLib::GitInfo::ogs_version, anonymous_namespace{postLIE.cpp}::postPVD(), and anonymous_namespace{postLIE.cpp}::postVTU().