OGS
|
Namespaces | |
namespace | Legacy |
Classes | |
struct | FileCommunicator |
struct | HdfData |
class | HdfWriter |
struct | MeshHdfData |
struct | NodeData |
struct NodeData used for parallel reading and also partitioning More... | |
class | NodePartitionedMeshReader |
struct | PartitionInfo |
struct | PropertyVectorMetaData |
struct | PropertyVectorPartitionMetaData |
class | PVDFile |
struct | TransformedMeshData |
class | VtuInterface |
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. More... | |
struct | XdmfData |
struct | XdmfHdfData |
struct | XdmfHdfMesh |
class | XdmfHdfWriter |
struct | XdmfTopology |
class | XdmfWriter |
Typedefs | |
using | Hdf5DimType = hsize_t |
using | HDFAttributes = std::vector<HdfData> |
using | XdmfDimType = unsigned int |
Functions | |
void | writePropertyVectorMetaData (std::ostream &os, PropertyVectorMetaData const &pvmd) |
void | writePropertyVectorMetaData (PropertyVectorMetaData const &pvmd) |
std::optional< PropertyVectorMetaData > | readPropertyVectorMetaData (std::istream &is) |
void | writePropertyVectorPartitionMetaData (std::ostream &os, PropertyVectorPartitionMetaData const &pvpmd) |
std::optional< PropertyVectorPartitionMetaData > | readPropertyVectorPartitionMetaData (std::istream &is) |
MeshLib::Mesh * | readMeshFromFile (const std::string &file_name, bool const compute_element_neighbors) |
std::string | getVtuFileNameForPetscOutputWithoutExtension (std::string const &file_name) |
int | writeVtu (MeshLib::Mesh const &mesh, std::string const &file_name, int const data_mode) |
int | writeMeshToFile (const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names) |
int64_t | createFile (std::filesystem::path const &filepath, unsigned int n_files) |
int64_t | openHDF5File (std::filesystem::path const &filepath, unsigned int n_files) |
int64_t | createHDF5TransferPolicy () |
static hid_t | meshPropertyType2HdfType (MeshPropertyDataType const ogs_data_type) |
std::filesystem::path | partitionFilename (std::filesystem::path const &basic_filepath, int const file_group) |
int | getGroupIndex (int const input_index, int const input_size, int const new_group_size) |
FileCommunicator | getCommunicator (unsigned int const n_files) |
bool | isFileManager () |
PartitionInfo | getPartitionInfo (std::size_t const size, unsigned int const n_files) |
int64_t | openHDF5File (std::filesystem::path const &filepath) |
static constexpr auto | elemOGSTypeToXDMFType () |
constexpr auto | cellTypeOGS2XDMF (MeshLib::CellType const &cell_type) |
std::optional< XdmfHdfData > | transformAttribute (std::pair< std::string, PropertyVectorBase * > const &property_pair, unsigned int const n_files, unsigned int const chunk_size_bytes) |
std::vector< XdmfHdfData > | transformAttributes (MeshLib::Mesh const &mesh, unsigned int n_files, unsigned int chunk_size_bytes) |
Create meta data for attributes used for hdf5 and xdmf. | |
std::vector< double > | transformToXDMFGeometry (MeshLib::Mesh const &mesh) |
Copies all node points into a new vector. Contiguous data used for writing. Conform with XDMF standard in https://xdmf.org/index.php/XDMF_Model_and_Format. | |
XdmfHdfData | transformGeometry (MeshLib::Mesh const &mesh, double const *data_ptr, unsigned int n_files, unsigned int chunk_size_bytes) |
Create meta data for geometry used for hdf5 and xdmf. | |
ParentDataType | getTopologyType (MeshLib::Mesh const &mesh) |
std::pair< std::vector< std::size_t >, ParentDataType > | transformToXDMFTopology (MeshLib::Mesh const &mesh, std::size_t const offset) |
Copies all cells into a new vector. Contiguous data used for writing. The topology is specific to xdmf because it contains the xdmf cell types!! See section topology in https://xdmf.org/index.php/XDMF_Model_and_Format. | |
XdmfHdfData | transformTopology (std::vector< std::size_t > const &values, ParentDataType const parent_data_type, unsigned int n_files, unsigned int chunk_size_bytes) |
Create meta data for topology used for HDF5 and XDMF. | |
static std::string | meshItemTypeString (std::optional< MeshItemType > const &item_type) |
static auto | meshPropertyDatatypeString () |
static std::string | getPropertyDataTypeString (MeshPropertyDataType const &ogs_data_type) |
static constexpr auto | meshPropertyDatatypeSize () |
static std::string | getPropertyDataTypeSize (MeshPropertyDataType const &ogs_data_type) |
std::function< std::string(std::vector< double >)> | write_xdmf (XdmfData const &geometry, XdmfData const &topology, std::vector< XdmfData > const &constant_attributes, std::vector< XdmfData > const &variable_attributes, std::string const &h5filename, std::string const &ogs_version, std::string const &mesh_name) |
Generator function that creates a function capturing the spatial data of a mesh Temporal data can later be passed as argument. | |
template<typename Data > | |
std::function< bool(Data)> | isVariableAttribute (std::set< std::string > const &variable_output_names) |
Variables | |
constexpr auto | elem_type_ogs2xdmf = elemOGSTypeToXDMFType() |
constexpr char const * | mesh_item_type_strings [] |
auto | ogs_to_xdmf_type_fn = meshPropertyDatatypeSize() |
using MeshLib::IO::Hdf5DimType = hsize_t |
using MeshLib::IO::HDFAttributes = std::vector<HdfData> |
Definition at line 25 of file HdfWriter.h.
using MeshLib::IO::XdmfDimType = unsigned int |
Definition at line 27 of file XdmfData.h.
|
constexpr |
Definition at line 84 of file transformData.cpp.
References elem_type_ogs2xdmf, and BaseLib::to_underlying().
Referenced by getTopologyType(), and transformToXDMFTopology().
int64_t MeshLib::IO::createFile | ( | std::filesystem::path const & | filepath, |
unsigned int | n_files ) |
Definition at line 38 of file fileIO.cpp.
References getCommunicator(), and partitionFilename().
int64_t MeshLib::IO::createHDF5TransferPolicy | ( | ) |
Definition at line 70 of file fileIO.cpp.
Referenced by writeDataSet().
|
staticconstexpr |
Definition at line 39 of file transformData.cpp.
References EDGE_3, MeshLib::enum_length, MeshLib::HEX20, MeshLib::HEX27, MeshLib::HEX8, HEXAHEDRON, HEXAHEDRON_20, HEXAHEDRON_27, MeshLib::LINE2, MeshLib::LINE3, MeshLib::POINT1, POLYLINE, POLYVERTEX, MeshLib::PRISM15, MeshLib::PRISM18, MeshLib::PRISM6, PYRAMID, MeshLib::PYRAMID13, MeshLib::PYRAMID5, PYRAMID_13, MeshLib::QUAD4, MeshLib::QUAD8, MeshLib::QUAD9, QUADRILATERAL, QUADRILATERAL_8, QUADRILATERAL_9, MeshLib::TET10, MeshLib::TET4, TETRAHEDRON, TETRAHEDRON_10, BaseLib::to_underlying(), MeshLib::TRI3, MeshLib::TRI6, TRIANGLE, TRIANGLE_6, WEDGE, WEDGE_15, and WEDGE_18.
FileCommunicator MeshLib::IO::getCommunicator | ( | unsigned int const | n_files | ) |
Definition at line 41 of file getCommunicator.cpp.
References getGroupIndex().
Referenced by createFile(), getPartitionInfo(), and openHDF5File().
int MeshLib::IO::getGroupIndex | ( | int const | input_index, |
int const | input_size, | ||
int const | new_group_size ) |
Definition at line 27 of file getCommunicator.cpp.
Referenced by getCommunicator().
PartitionInfo MeshLib::IO::getPartitionInfo | ( | std::size_t const | size, |
unsigned int const | n_files ) |
Definition at line 35 of file partition.cpp.
References BaseLib::MPI::allgather(), getCommunicator(), MeshLib::IO::FileCommunicator::mpi_communicator, and BaseLib::sizesToOffsets().
Referenced by MeshLib::IO::HdfData::HdfData().
|
static |
Definition at line 98 of file writeXdmf.cpp.
References ogs_to_xdmf_type_fn, and BaseLib::to_underlying().
Referenced by write_xdmf().
|
static |
Definition at line 73 of file writeXdmf.cpp.
References meshPropertyDatatypeString(), and BaseLib::to_underlying().
Referenced by write_xdmf().
ParentDataType MeshLib::IO::getTopologyType | ( | MeshLib::Mesh const & | mesh | ) |
Definition at line 322 of file transformData.cpp.
References cellTypeOGS2XDMF(), MeshLib::Mesh::getElements(), and MIXED.
Referenced by transformToXDMFTopology().
std::string MeshLib::IO::getVtuFileNameForPetscOutputWithoutExtension | ( | std::string const & | file_name | ) |
Definition at line 122 of file VtuInterface.cpp.
References BaseLib::extractBaseName(), BaseLib::extractPath(), BaseLib::getFileExtension(), BaseLib::joinPaths(), and OGS_FATAL.
Referenced by ApplicationsLib::TestDefinition::TestDefinition(), MeshLib::IO::PVDFile::addVTUFile(), and MeshLib::IO::VtuInterface::writeToFile().
bool MeshLib::IO::isFileManager | ( | ) |
Definition at line 28 of file partition.cpp.
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter(), and MeshLib::IO::XdmfHdfWriter::writeStep().
std::function< bool(Data)> MeshLib::IO::isVariableAttribute | ( | std::set< std::string > const & | variable_output_names | ) |
Definition at line 43 of file XdmfHdfWriter.cpp.
References MeshLib::Cell, MeshLib::Edge, MeshLib::Face, MeshLib::getBulkIDString(), and MeshLib::Node.
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter().
|
static |
Definition at line 43 of file writeXdmf.cpp.
References mesh_item_type_strings, and OGS_FATAL.
Referenced by write_xdmf().
|
staticconstexpr |
Definition at line 80 of file writeXdmf.cpp.
References enum_length, float32, float64, int32, int64, int8, BaseLib::to_underlying(), uint32, uint64, and uint8.
|
static |
Definition at line 55 of file writeXdmf.cpp.
References char_native, enum_length, float32, float64, int32, int64, int8, BaseLib::to_underlying(), uchar, uint32, uint64, and uint8.
Referenced by getPropertyDataTypeString().
|
static |
Definition at line 22 of file HdfData.cpp.
References char_native, float32, float64, int32, int64, int8, OGS_FATAL, uchar, uint32, uint64, and uint8.
Referenced by MeshLib::IO::HdfData::HdfData().
int64_t MeshLib::IO::openHDF5File | ( | std::filesystem::path const & | filepath | ) |
Definition at line 25 of file fileIO.cpp.
hid_t MeshLib::IO::openHDF5File | ( | std::filesystem::path const & | filepath, |
unsigned int | n_files ) |
Definition at line 58 of file fileIO.cpp.
References getCommunicator(), and MeshLib::IO::FileCommunicator::mpi_communicator.
std::filesystem::path MeshLib::IO::partitionFilename | ( | std::filesystem::path const & | basic_filepath, |
int const | file_group ) |
Definition at line 24 of file fileIO.cpp.
References DBUG().
Referenced by createFile().
MeshLib::Mesh * MeshLib::IO::readMeshFromFile | ( | const std::string & | file_name, |
bool const | compute_element_neighbors ) |
Definition at line 68 of file readMeshFromFile.cpp.
References BaseLib::MPI::Mpi::communicator, BaseLib::dropFileExtension(), MeshLib::IO::NodePartitionedMeshReader::read(), and BaseLib::MPI::Mpi::size.
Referenced by createGeometries(), FileIO::createSurface(), MainWindow::loadFile(), main(), main(), MainWindow::mapGeometry(), anonymous_namespace{postLIE.cpp}::postVTU(), FileIO::XmlPrjInterface::readFile(), readMeshes(), and anonymous_namespace{ProjectData.cpp}::readSingleMesh().
|
inline |
Definition at line 85 of file PropertyVectorMetaData.h.
References MeshLib::IO::PropertyVectorMetaData::data_type_size_in_bytes, MeshLib::IO::PropertyVectorMetaData::is_data_type_signed, MeshLib::IO::PropertyVectorMetaData::is_int_type, MeshLib::IO::PropertyVectorMetaData::number_of_components, MeshLib::IO::PropertyVectorMetaData::number_of_tuples, and MeshLib::IO::PropertyVectorMetaData::property_name.
Referenced by MeshLib::IO::NodePartitionedMeshReader::readProperties().
|
inline |
Definition at line 140 of file PropertyVectorMetaData.h.
References MeshLib::IO::PropertyVectorPartitionMetaData::number_of_tuples, and MeshLib::IO::PropertyVectorPartitionMetaData::offset.
Referenced by MeshLib::IO::NodePartitionedMeshReader::readProperties().
std::optional< XdmfHdfData > MeshLib::IO::transformAttribute | ( | std::pair< std::string, PropertyVectorBase * > const & | property_pair, |
unsigned int const | n_files, | ||
unsigned int const | chunk_size_bytes ) |
Definition at line 89 of file transformData.cpp.
References char_native, float32, float64, MeshLib::PropertyVector< PROP_VAL_TYPE >::getNumberOfTuples(), int32, int64, int8, uchar, uint32, uint64, uint8, and unknown.
Referenced by transformAttributes().
std::vector< XdmfHdfData > MeshLib::IO::transformAttributes | ( | MeshLib::Mesh const & | mesh, |
unsigned int | n_files, | ||
unsigned int | chunk_size_bytes ) |
Create meta data for attributes used for hdf5 and xdmf.
mesh | OGS mesh can be mesh or partitionedMesh |
n_files | specifies the number of files. If greater than 1 it groups the data of each process to n_files |
chunk_size_bytes | Data will be split into chunks. The parameter specifies the size (in bytes) of the largest chunk. |
Definition at line 244 of file transformData.cpp.
References MeshLib::Mesh::getProperties(), GitInfoLib::GitInfo::OGS_VERSION, transformAttribute(), and WARN().
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter().
XdmfHdfData MeshLib::IO::transformGeometry | ( | MeshLib::Mesh const & | mesh, |
double const * | data_ptr, | ||
unsigned int | n_files, | ||
unsigned int | chunk_size_bytes ) |
Create meta data for geometry used for hdf5 and xdmf.
mesh | OGS mesh can be mesh or partitionedMesh |
data_ptr | Memory location of geometry values. |
n_files | specifies the number of files. If greater than 1 it groups the data of each process to n_files |
chunk_size_bytes | Data will be split into chunks. The parameter specifies the size (in bytes) of the largest chunk. |
Definition at line 297 of file transformData.cpp.
References float64, and MeshLib::Mesh::getNodes().
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter().
XdmfHdfData MeshLib::IO::transformTopology | ( | std::vector< std::size_t > const & | values, |
ParentDataType const | parent_data_type, | ||
unsigned int | n_files, | ||
unsigned int | chunk_size_bytes ) |
Create meta data for topology used for HDF5 and XDMF.
values | actual topology values to get size and memory location |
parent_data_type | XDMF topological element data types as listed in the enum ParentDataTypei |
n_files | specifies the number of files. If greater than 1 it groups the data of each process to n_files |
chunk_size_bytes | Data will be split into chunks. The parameter specifies the size (in bytes) of the largest chunk. |
Definition at line 391 of file transformData.cpp.
References ParentDataType2String(), and uint64.
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter().
std::vector< double > MeshLib::IO::transformToXDMFGeometry | ( | MeshLib::Mesh const & | mesh | ) |
Copies all node points into a new vector. Contiguous data used for writing. Conform with XDMF standard in https://xdmf.org/index.php/XDMF_Model_and_Format.
mesh | OGS mesh can be mesh or partitionedMesh |
Definition at line 281 of file transformData.cpp.
References MeshLib::Mesh::getNodes().
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter().
std::pair< std::vector< std::size_t >, ParentDataType > MeshLib::IO::transformToXDMFTopology | ( | MeshLib::Mesh const & | mesh, |
std::size_t const | offset ) |
Copies all cells into a new vector. Contiguous data used for writing. The topology is specific to xdmf because it contains the xdmf cell types!! See section topology in https://xdmf.org/index.php/XDMF_Model_and_Format.
mesh | OGS mesh can be mesh or partitionedMesh |
offset | Local offset to transform local to global cell ID. Offset must be zero in serial and must be defined for each process in parallel execution. |
Definition at line 342 of file transformData.cpp.
References cellTypeOGS2XDMF(), MeshLib::Mesh::getElements(), getTopologyType(), MeshLib::views::ids, MIXED, POLYLINE, and BaseLib::to_underlying().
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter().
std::function< std::string(std::vector< double >)> MeshLib::IO::write_xdmf | ( | XdmfData const & | geometry, |
XdmfData const & | topology, | ||
std::vector< XdmfData > const & | constant_attributes, | ||
std::vector< XdmfData > const & | variable_attributes, | ||
std::string const & | h5filename, | ||
std::string const & | ogs_version, | ||
std::string const & | mesh_name ) |
Generator function that creates a function capturing the spatial data of a mesh Temporal data can later be passed as argument.
geometry | Metadata for the geometry (points) of the mesh |
topology | Metadata for the topology of the mesh |
variable_attributes | Meta data for attributes changing over time |
constant_attributes | Meta data for attributes NOT changing over time |
h5filename | Name of the file where the actual data was written |
ogs_version | OGS Version to be added to XdmfInformation tag |
mesh_name | Name of the output mesh |
Definition at line 106 of file writeXdmf.cpp.
References MeshLib::IO::XdmfData::attribute_center, EDGE_3, getPropertyDataTypeSize(), getPropertyDataTypeString(), HEXAHEDRON, HEXAHEDRON_20, HEXAHEDRON_27, meshItemTypeString(), MIXED, MeshLib::IO::XdmfData::name, OGS_FATAL, MeshLib::IO::XdmfData::parent_data_type, ParentDataType2String(), POLYLINE, POLYVERTEX, PYRAMID, PYRAMID_13, QUADRILATERAL, QUADRILATERAL_8, QUADRILATERAL_9, MeshLib::IO::XdmfData::size_partitioned_dim, TETRAHEDRON, TETRAHEDRON_10, TRIANGLE, TRIANGLE_6, WEDGE, WEDGE_15, and WEDGE_18.
Referenced by MeshLib::IO::XdmfHdfWriter::XdmfHdfWriter().
int MeshLib::IO::writeMeshToFile | ( | const MeshLib::Mesh & | mesh, |
std::filesystem::path const & | file_path, | ||
std::set< std::string > | variable_output_names ) |
Definition at line 24 of file writeMeshToFile.cpp.
References ERR(), MeshLib::IO::Legacy::MeshIO::setMesh(), BaseLib::IO::writeStringToFile(), MeshLib::IO::VtuInterface::writeToFile(), and BaseLib::IO::Writer::writeToString().
Referenced by FileIO::Gocad::generateFaceSets(), identifyAndWriteBoundaryMeshes(), main(), main(), anonymous_namespace{postLIE.cpp}::postVTU(), and FileIO::XmlPrjInterface::write().
|
inline |
Definition at line 74 of file PropertyVectorMetaData.h.
References MeshLib::IO::PropertyVectorMetaData::data_type_size_in_bytes, DBUG(), MeshLib::IO::PropertyVectorMetaData::is_data_type_signed, MeshLib::IO::PropertyVectorMetaData::is_int_type, MeshLib::IO::PropertyVectorMetaData::number_of_components, MeshLib::IO::PropertyVectorMetaData::number_of_tuples, and MeshLib::IO::PropertyVectorMetaData::property_name.
|
inline |
Definition at line 47 of file PropertyVectorMetaData.h.
References MeshLib::IO::PropertyVectorMetaData::property_name.
Referenced by MeshLib::IO::NodePartitionedMeshReader::readProperties(), and ApplicationUtils::writePropertyVector().
|
inline |
Definition at line 126 of file PropertyVectorMetaData.h.
Referenced by ApplicationUtils::writeProperties().
int MeshLib::IO::writeVtu | ( | MeshLib::Mesh const & | mesh, |
std::string const & | file_name, | ||
int const | data_mode ) |
Definition at line 160 of file VtuInterface.cpp.
References ERR(), and MeshLib::IO::VtuInterface::writeToFile().
Referenced by main().
|
constexpr |
Definition at line 82 of file transformData.cpp.
Referenced by cellTypeOGS2XDMF().
|
constexpr |
Definition at line 39 of file writeXdmf.cpp.
Referenced by meshItemTypeString().
|
inline |
Definition at line 95 of file writeXdmf.cpp.
Referenced by getPropertyDataTypeSize().