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 "InfoLib/GitInfo.h"
#include "MeshLib/IO/readMeshFromFile.h"
#include "MeshLib/IO/writeMeshToFile.h"
#include "MeshLib/Mesh.h"
#include "MeshLib/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

 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 124 of file postLIE.cpp.

125 {
126  TCLAP::CmdLine cmd(
127  "Post-process results of the LIE approach.\n\n"
128  "OpenGeoSys-6 software, version " +
130  ".\n"
131  "Copyright (c) 2012-2021, OpenGeoSys Community "
132  "(http://www.opengeosys.org)",
134  TCLAP::ValueArg<std::string> arg_out_file(
135  "o", "output-file", "the name of the new PVD or VTU file", true, "",
136  "path");
137  cmd.add(arg_out_file);
138  TCLAP::ValueArg<std::string> arg_in_file(
139  "i", "input-file", "the original PVD or VTU file name", true, "",
140  "path");
141  cmd.add(arg_in_file);
142  TCLAP::SwitchArg nooverwrite_arg(
143  "",
144  "no-overwrite",
145  "don't overwrite existing post processed VTU files");
146  cmd.add(nooverwrite_arg);
147 
148  cmd.parse(argc, argv);
149 
150  auto const in_file_ext = BaseLib::getFileExtension(arg_in_file.getValue());
151  if (in_file_ext == ".pvd")
152  {
153  postPVD(arg_in_file.getValue(), arg_out_file.getValue(),
154  !nooverwrite_arg.getValue());
155  }
156  else if (in_file_ext == ".vtu")
157  {
158  postVTU(arg_in_file.getValue(), arg_out_file.getValue());
159  }
160  else
161  {
162  OGS_FATAL("The given file type ({:s}) is not supported.", in_file_ext);
163  }
164 
165  return EXIT_SUCCESS;
166 }
#define OGS_FATAL(...)
Definition: Error.h:26
std::string getFileExtension(const std::string &path)
Definition: FileTools.cpp:186
GITINFOLIB_EXPORT const std::string ogs_version
void postVTU(std::string const &int_vtu_filename, std::string const &out_vtu_filename)
Definition: postLIE.cpp:29
void postPVD(std::string const &in_pvd_filename, std::string const &out_pvd_filename, bool const allow_overwrite)
Definition: postLIE.cpp:67

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