OGS
|
Reads and writes VtkXMLUnstructuredGrid-files (vtu) to and from OGS data structures. This class is currently not inherited from Writer because VTK will implement writing to a string from 6.2 onwards.
Definition at line 37 of file VtuInterface.h.
#include <VtuInterface.h>
Public Member Functions | |
VtuInterface (const MeshLib::Mesh *mesh, int dataMode=vtkXMLWriter::Appended, bool compress=false) | |
Provide the mesh to write and set if compression should be used. | |
bool | writeToFile (std::filesystem::path const &file_path) |
template<typename UnstructuredGridWriter > | |
bool | writeVTU (std::string const &file_name, const int num_partitions=1, const int rank=1) |
Static Public Member Functions | |
static MeshLib::Mesh * | readVTUFile (std::string const &file_name, bool const compute_element_neighbors=false) |
static MeshLib::Mesh * | readVTKFile (std::string const &file_name, bool const compute_element_neighbors=false) |
Private Attributes | |
const MeshLib::Mesh * | _mesh |
int | _data_mode |
bool | _use_compressor |
|
explicit |
Provide the mesh to write and set if compression should be used.
Definition at line 40 of file VtuInterface.cpp.
References _data_mode, and WARN().
|
static |
Read an unstructured grid from a legacy VTK file. Other data structures such as PolyData are ignored.
Definition at line 84 of file VtuInterface.cpp.
References MeshLib::VtkMeshConverter::convertUnstructuredGrid(), ERR(), BaseLib::extractBaseNameWithoutExtension(), and BaseLib::IsFileExisting().
Referenced by anonymous_namespace{readMeshFromFile.cpp}::readMeshFromFileSerial().
|
static |
Read an unstructured grid from a VTU file.
Definition at line 50 of file VtuInterface.cpp.
References MeshLib::VtkMeshConverter::convertUnstructuredGrid(), ERR(), BaseLib::extractBaseNameWithoutExtension(), and BaseLib::IsFileExisting().
Referenced by OGSFileConverter::convertVTU2MSH(), main(), and anonymous_namespace{readMeshFromFile.cpp}::readMeshFromFileSerial().
bool MeshLib::IO::VtuInterface::writeToFile | ( | std::filesystem::path const & | file_path | ) |
Writes the given mesh to file.
Definition at line 144 of file VtuInterface.cpp.
References MeshLib::IO::getVtuFileNameForPetscOutputWithoutExtension(), BaseLib::MPI::Mpi::rank, BaseLib::MPI::Mpi::size, and writeVTU().
Referenced by SaveMeshDialog::accept(), convert(), OGSFileConverter::convertMSH2VTU(), main(), ProcessLib::outputMeshVtk(), writeBoundary(), writeDataToMesh(), writeMeshOutput(), MeshLib::IO::writeMeshToFile(), and MeshLib::IO::writeVtu().
bool MeshLib::IO::VtuInterface::writeVTU | ( | std::string const & | file_name, |
const int | num_partitions = 1, | ||
const int | rank = 1 ) |
Writes the given mesh to vtu file.
file_name | File name. |
num_partitions | Number of partitions to be merged. |
rank | the rank of the mpi process. |
Definition at line 38 of file VtuInterface-impl.h.
References _data_mode, _mesh, _use_compressor, MeshLib::Cell, DBUG(), ERR(), MeshLib::Properties::existsPropertyVector(), MeshLib::Mesh::getName(), MeshLib::Mesh::getProperties(), and MeshLib::Properties::getPropertyVector().
Referenced by writeToFile().
|
private |
Definition at line 73 of file VtuInterface.h.
Referenced by VtuInterface(), and writeVTU().
|
private |
Definition at line 72 of file VtuInterface.h.
Referenced by writeVTU().
|
private |
Definition at line 74 of file VtuInterface.h.
Referenced by writeVTU().