Converts OGS mesh into VTK mesh.
- Author
- Thomas Fischer
- Date
- Jan 24, 2013
- Copyright
- Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org) Distributed under a Modified BSD License. See accompanying file LICENSE.txt or http://www.opengeosys.org/project/license
Definition in file OGS2VTK.cpp.
#include <tclap/CmdLine.h>
#include <memory>
#include <string>
#include "InfoLib/GitInfo.h"
#include "MeshLib/IO/VtkIO/VtuInterface.h"
#include "MeshLib/IO/readMeshFromFile.h"
#include "MeshLib/Mesh.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 24 of file OGS2VTK.cpp.
27 "Converts OGS mesh into VTK mesh.\n\n"
28 "OpenGeoSys-6 software, version " +
31 "Copyright (c) 2012-2021, OpenGeoSys Community "
32 "(http://www.opengeosys.org)",
34 TCLAP::ValueArg<std::string> mesh_in(
35 "i",
"mesh-input-file",
36 "the name of the file containing the input mesh",
true,
"",
37 "file name of input mesh");
39 TCLAP::ValueArg<std::string> mesh_out(
40 "o",
"mesh-output-file",
41 "the name of the file the mesh will be written to",
true,
"",
42 "file name of output mesh");
44 TCLAP::SwitchArg use_ascii_arg(
46 "Write VTU output in ASCII format. Due to possible rounding the ascii "
47 "output could result in lower accuracy.");
48 cmd.add(use_ascii_arg);
49 cmd.parse(argc, argv);
51 std::unique_ptr<MeshLib::Mesh const> mesh(
57 INFO(
"Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
58 mesh->getNumberOfElements());
60 auto const data_mode =
61 use_ascii_arg.getValue() ? vtkXMLWriter::Ascii : vtkXMLWriter::Binary;
void INFO(char const *fmt, Args const &... args)
GITINFOLIB_EXPORT const std::string ogs_version
int writeVtu(MeshLib::Mesh const &mesh, std::string const &file_name, int const data_mode)
MeshLib::Mesh * readMeshFromFile(const std::string &file_name)
References INFO(), GitInfoLib::GitInfo::ogs_version, MeshLib::IO::readMeshFromFile(), and MeshLib::IO::writeVtu().