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, std::optional< ParentDataType > parent_data_type)
 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::size_t size_partitioned_dim
 
std::string name
 
std::optional< MeshLib::MeshItemTypeattribute_center
 
unsigned int index
 
std::optional< ParentDataTypeparent_data_type
 

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,
std::optional< ParentDataType > parent_data_type )

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
parent_data_typespecifies the type of the parent structure (e.g. Topology, DataItem, Grid)

Definition at line 21 of file XdmfData.cpp.

29 : starts(
30 [&size_tuple]()
31 {
32 if (size_tuple > 1)
33 {
34 return std::vector<XdmfDimType>{0, 0};
35 }
36 else
37 {
38 return std::vector<XdmfDimType>{0};
39 }
40 }()),
41 strides(
42 [&size_tuple]()
43 {
44 if (size_tuple > 1)
45 {
46 return std::vector<XdmfDimType>{1, 1};
47 }
48 else
49 {
50 return std::vector<XdmfDimType>{1};
51 }
52 }()),
53 data_type(mesh_property_data_type),
55 name(name),
57 index(index),
59{
60 auto partition_info = getPartitionInfo(size_partitioned_dim, n_files);
61 assert(partition_info.local_length <
62 std::numeric_limits<unsigned int>::max());
63 auto const ui_global_components =
64 static_cast<unsigned int>(partition_info.global_length);
65 auto const ui_tuple_size = static_cast<unsigned int>(size_tuple);
66
67 if (ui_tuple_size == 1)
68 {
69 global_block_dims = {ui_global_components};
70 }
71 else
72 {
73 global_block_dims = {ui_global_components, ui_tuple_size};
74 }
75
76 DBUG(
77 "XDMF: dataset name: {:s}, offset: {:d} "
78 "global_blocks: {:d}, tuples: {:d}",
79 name, partition_info.local_offset, global_block_dims[0], ui_tuple_size);
80}
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:35
unsigned int index
Definition XdmfData.h:69
MeshPropertyDataType data_type
Definition XdmfData.h:65
std::optional< MeshLib::MeshItemType > attribute_center
Definition XdmfData.h:68
std::vector< XdmfDimType > strides
Definition XdmfData.h:63
std::vector< XdmfDimType > starts
Definition XdmfData.h:62
std::vector< XdmfDimType > global_block_dims
Definition XdmfData.h:64
std::size_t size_partitioned_dim
Definition XdmfData.h:66
std::string name
Definition XdmfData.h:67
std::optional< ParentDataType > parent_data_type
Definition XdmfData.h:70

Member Data Documentation

◆ attribute_center

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

Definition at line 68 of file XdmfData.h.

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

◆ data_type

MeshPropertyDataType MeshLib::IO::XdmfData::data_type

Definition at line 65 of file XdmfData.h.

◆ global_block_dims

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

Definition at line 64 of file XdmfData.h.

◆ index

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

Definition at line 69 of file XdmfData.h.

◆ name

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

Definition at line 67 of file XdmfData.h.

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

◆ parent_data_type

std::optional<ParentDataType> MeshLib::IO::XdmfData::parent_data_type

Definition at line 70 of file XdmfData.h.

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

◆ size_partitioned_dim

std::size_t MeshLib::IO::XdmfData::size_partitioned_dim

Definition at line 66 of file XdmfData.h.

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

◆ starts

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

Definition at line 62 of file XdmfData.h.

◆ strides

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

Definition at line 63 of file XdmfData.h.


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