OGS
createQuadraticMesh.cpp
Go to the documentation of this file.
1 
10 #include <tclap/CmdLine.h>
11 
12 #include <memory>
13 #include <string>
14 
15 #include "InfoLib/GitInfo.h"
18 #include "MeshLib/Mesh.h"
20 
21 int main(int argc, char* argv[])
22 {
23  TCLAP::CmdLine cmd(
24  "Create quadratic order mesh.\n\n"
25  "OpenGeoSys-6 software, version " +
27  ".\n"
28  "Copyright (c) 2012-2021, OpenGeoSys Community "
29  "(http://www.opengeosys.org)",
31 
32  TCLAP::ValueArg<std::string> input_arg(
33  "i", "input-mesh-file", "input mesh file", true, "", "string");
34  cmd.add(input_arg);
35  TCLAP::ValueArg<std::string> output_arg(
36  "o", "output-mesh-file", "output mesh file", true, "", "string");
37  cmd.add(output_arg);
38  TCLAP::SwitchArg add_centre_node_arg("c", "add-centre-node",
39  "add centre node", false);
40  cmd.add(add_centre_node_arg);
41  cmd.parse(argc, argv);
42 
43  std::unique_ptr<MeshLib::Mesh> mesh(
44  MeshLib::IO::readMeshFromFile(input_arg.getValue()));
45  if (!mesh)
46  {
47  return EXIT_FAILURE;
48  }
49 
50  INFO("Create a quadratic order mesh");
52  *mesh, add_centre_node_arg.getValue()));
53 
54  INFO("Save the new mesh into a file");
55  MeshLib::IO::writeMeshToFile(*new_mesh, output_arg.getValue());
56 
57  return EXIT_SUCCESS;
58 }
Git information.
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
Definition of the Mesh class.
int main(int argc, char *argv[])
GITINFOLIB_EXPORT const std::string ogs_version
MeshLib::Mesh * readMeshFromFile(const std::string &file_name)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, [[maybe_unused]] std::set< std::string > variable_output_names)
std::unique_ptr< Mesh > createQuadraticOrderMesh(Mesh const &linear_mesh, bool const add_centre_node)
Definition of readMeshFromFile function.