Skip to content
Snippets Groups Projects
Commit ab809570 authored by Tobias Meisel's avatar Tobias Meisel Committed by Tom Fischer
Browse files

[MeL] XDMFWriter: Introduce parent data type with Polyvertex(new) and Mixed

parent cd45e317
No related branches found
No related tags found
No related merge requests found
......@@ -27,4 +27,14 @@ enum class MeshPropertyDataType
char_native,
uchar,
enum_length
};
// See https://www.xdmf.org/index.php/XDMF_Model_and_Format - only relevant of
// TopologyType(s) added, structure is open to be extended with GridType(s)
// and ItemType(s).
enum class ParentDataType
{
Polyvertex=0,
Mixed,
};
\ No newline at end of file
......@@ -24,7 +24,8 @@ XdmfData::XdmfData(std::size_t const size_partitioned_dim,
std::string const& name,
std::optional<MeshLib::MeshItemType> const attribute_center,
unsigned int const index,
unsigned int const n_files)
unsigned int const n_files,
std::optional<ParentDataType> const parent_data_type)
: starts(
[&size_tuple]()
{
......@@ -52,7 +53,8 @@ XdmfData::XdmfData(std::size_t const size_partitioned_dim,
data_type(mesh_property_data_type),
name(name),
attribute_center(attribute_center),
index(index)
index(index),
parent_data_type(parent_data_type)
{
auto partition_info = getPartitionInfo(size_partitioned_dim, n_files);
// TODO (tm) XdmfLib does not support 64 bit data types so far
......
......@@ -48,13 +48,15 @@ struct XdmfData final
* Geometry, 3=Topology, 4>=Attribute
* @param n_files specifies the number of files. If greater than 1 it groups
* the data of each process to n_files
*
* @param parent_data_type specifies the type of the parent structure
* (e.g. Topology, DataItem, Grid)
*/
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);
unsigned int const index, unsigned int n_files,
std::optional<ParentDataType> parent_data_type);
// a hyperslab is defined by starts and strides see
// https://xdmf.org/index.php/XDMF_Model_and_Format#HyperSlab
std::vector<XdmfDimType> starts;
......@@ -64,6 +66,7 @@ struct XdmfData final
std::string name;
std::optional<MeshLib::MeshItemType> attribute_center;
unsigned int index;
std::optional<ParentDataType> parent_data_type;
};
} // namespace MeshLib::IO
......@@ -205,7 +205,8 @@ std::function<std::string(std::vector<double>)> write_xdmf(
{
return fmt::format(
fmt::runtime("\n\t<Topology Dimensions=\"{dimensions}\" "
"Type=\"Mixed\">{dataitem}\n\t</Topology>"),
"Type={topology_type}>{dataitem}\n\t</Topology>"),
"topology_type"_a = "Mixed",
"dataitem"_a = dataitem_transform(topology),
"dimensions"_a = fmt::join(topology.global_block_dims, " "));
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment