OGS
MeshLib::IO::XdmfData Struct Referencefinal

Detailed Description

Definition at line 29 of file XdmfData.h.

#include <XdmfData.h>

Public Member Functions

 XdmfData (std::size_t size_partitioned_dim, std::size_t size_tuple, MeshPropertyDataType mesh_property_data_type, std::string const &name, std::optional< MeshLib::MeshItemType > attribute_center, unsigned int const index, unsigned int n_files)
 XdmfData contains meta data to be passed to the XdmfWriter - it does not contain the actual values!!
 

Public Attributes

std::vector< XdmfDimTypestarts
 
std::vector< XdmfDimTypestrides
 
std::vector< XdmfDimTypeglobal_block_dims
 
MeshPropertyDataType data_type
 
std::string name
 
std::optional< MeshLib::MeshItemTypeattribute_center
 
unsigned int index
 

Constructor & Destructor Documentation

◆ XdmfData()

MeshLib::IO::XdmfData::XdmfData ( std::size_t size_partitioned_dim,
std::size_t size_tuple,
MeshPropertyDataType mesh_property_data_type,
std::string const & name,
std::optional< MeshLib::MeshItemType > attribute_center,
unsigned int const index,
unsigned int n_files )

XdmfData contains meta data to be passed to the XdmfWriter - it does not contain the actual values!!

Parameters
size_partitioned_dimThe first dimension (index 0) is assumed to be the dimension that is partitioned. This first dimension expresses the length, usually the number of nodes or the number of cells. These values give the length of the local partition.
size_tupleWe assume there is at most a rank of 2 of data (properties). The size of tuple gives the length of the second dimension (index 1).
mesh_property_data_typeproperty vector data type.
nameThe name of the attribute. It assumed to be unique.
attribute_centerXdmfData is used for topology, geometry and attributes. Geometry and topology have never a attribute_center. Attributes have always an attribute_center
indexThe position of the DataItem parents in a grid (representing a single step). Convention is: 1=Time, 2= Geometry, 3=Topology, 4>=Attribute
n_filesspecifies the number of files. If greater than 1 it groups the data of each process to n_files

Definition at line 21 of file XdmfData.cpp.

28 : starts(
29 [&size_tuple]()
30 {
31 if (size_tuple > 1)
32 {
33 return std::vector<XdmfDimType>{0, 0};
34 }
35 else
36 {
37 return std::vector<XdmfDimType>{0};
38 }
39 }()),
40 strides(
41 [&size_tuple]()
42 {
43 if (size_tuple > 1)
44 {
45 return std::vector<XdmfDimType>{1, 1};
46 }
47 else
48 {
49 return std::vector<XdmfDimType>{1};
50 }
51 }()),
52 data_type(mesh_property_data_type),
53 name(name),
56{
57 auto partition_info = getPartitionInfo(size_partitioned_dim, n_files);
58 // TODO (tm) XdmfLib does not support 64 bit data types so far
59 assert(partition_info.local_length <
60 std::numeric_limits<unsigned int>::max());
61 auto const ui_global_components =
62 static_cast<unsigned int>(partition_info.global_length);
63 auto const ui_tuple_size = static_cast<unsigned int>(size_tuple);
64
65 if (ui_tuple_size == 1)
66 {
67 global_block_dims = {ui_global_components};
68 }
69 else
70 {
71 global_block_dims = {ui_global_components, ui_tuple_size};
72 }
73
74 DBUG(
75 "XDMF: dataset name: {:s}, offset: {:d} "
76 "global_blocks: {:d}, tuples: {:d}",
77 name, partition_info.local_offset, global_block_dims[0], ui_tuple_size);
78}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
PartitionInfo getPartitionInfo(std::size_t const size, unsigned int const n_files)
Definition partition.cpp:33
unsigned int index
Definition XdmfData.h:66
MeshPropertyDataType data_type
Definition XdmfData.h:63
std::optional< MeshLib::MeshItemType > attribute_center
Definition XdmfData.h:65
std::vector< XdmfDimType > strides
Definition XdmfData.h:61
std::vector< XdmfDimType > starts
Definition XdmfData.h:60
std::vector< XdmfDimType > global_block_dims
Definition XdmfData.h:62
std::string name
Definition XdmfData.h:64

Member Data Documentation

◆ attribute_center

std::optional<MeshLib::MeshItemType> MeshLib::IO::XdmfData::attribute_center

Definition at line 65 of file XdmfData.h.

Referenced by MeshLib::IO::write_xdmf().

◆ data_type

MeshPropertyDataType MeshLib::IO::XdmfData::data_type

Definition at line 63 of file XdmfData.h.

◆ global_block_dims

std::vector<XdmfDimType> MeshLib::IO::XdmfData::global_block_dims

Definition at line 62 of file XdmfData.h.

Referenced by MeshLib::IO::write_xdmf().

◆ index

unsigned int MeshLib::IO::XdmfData::index

Definition at line 66 of file XdmfData.h.

◆ name

std::string MeshLib::IO::XdmfData::name

Definition at line 64 of file XdmfData.h.

Referenced by MeshLib::IO::write_xdmf().

◆ starts

std::vector<XdmfDimType> MeshLib::IO::XdmfData::starts

Definition at line 60 of file XdmfData.h.

◆ strides

std::vector<XdmfDimType> MeshLib::IO::XdmfData::strides

Definition at line 61 of file XdmfData.h.


The documentation for this struct was generated from the following files: