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 "BaseLib/MPI.h"
16#include "InfoLib/GitInfo.h"
19#include "MeshLib/Mesh.h"
21
22int main(int argc, char* argv[])
23{
24 TCLAP::CmdLine cmd(
25 "Create quadratic order mesh.\n\n"
26 "OpenGeoSys-6 software, version " +
28 ".\n"
29 "Copyright (c) 2012-2024, OpenGeoSys Community "
30 "(http://www.opengeosys.org)",
32
33 TCLAP::ValueArg<std::string> input_arg(
34 "i", "input-mesh-file", "input mesh file", true, "", "string");
35 cmd.add(input_arg);
36 TCLAP::ValueArg<std::string> output_arg(
37 "o", "output-mesh-file", "output mesh file", true, "", "string");
38 cmd.add(output_arg);
39 TCLAP::SwitchArg add_centre_node_arg("c", "add-centre-node",
40 "add centre node", false);
41 cmd.add(add_centre_node_arg);
42 cmd.parse(argc, argv);
43
44 BaseLib::MPI::Setup mpi_setup(argc, argv);
45
46 std::unique_ptr<MeshLib::Mesh> mesh(
47 MeshLib::IO::readMeshFromFile(input_arg.getValue()));
48 if (!mesh)
49 {
50 return EXIT_FAILURE;
51 }
52
53 INFO("Create a quadratic order mesh");
55 *mesh, add_centre_node_arg.getValue()));
56
57 INFO("Save the new mesh into a file");
58 MeshLib::IO::writeMeshToFile(*new_mesh, output_arg.getValue());
59
60 return EXIT_SUCCESS;
61}
Git information.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
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, bool const compute_element_neighbors)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names)
std::unique_ptr< MeshLib::Mesh > createQuadraticOrderMesh(MeshLib::Mesh const &linear_mesh, bool const add_centre_node)
Definition of readMeshFromFile function.