diff --git a/src/language/modules/MeshModule.cpp b/src/language/modules/MeshModule.cpp index 80865761c125795bdc136e6e8b0c25fdd2091bc5..e696c074ddaea2575f78fa57e092c4d82bd81e67 100644 --- a/src/language/modules/MeshModule.cpp +++ b/src/language/modules/MeshModule.cpp @@ -393,5 +393,31 @@ MeshModule::registerCheckpointResume() const return readItemValueVariant(symbol_name, symbol_table_group); })); + CheckpointResumeRepository::instance() + .addCheckpointResume(ast_node_data_type_from<std::shared_ptr<const SubItemArrayPerItemVariant>>, + std::function([](const std::string& symbol_name, const EmbeddedData& embedded_data, + HighFive::File& file, HighFive::Group& checkpoint_group, + HighFive::Group& symbol_table_group) { + writeSubItemArrayPerItemVariant(symbol_name, embedded_data, file, checkpoint_group, + symbol_table_group); + }), + std::function([](const std::string& symbol_name, + const HighFive::Group& symbol_table_group) -> EmbeddedData { + return readSubItemArrayPerItemVariant(symbol_name, symbol_table_group); + })); + + CheckpointResumeRepository::instance() + .addCheckpointResume(ast_node_data_type_from<std::shared_ptr<const SubItemValuePerItemVariant>>, + std::function([](const std::string& symbol_name, const EmbeddedData& embedded_data, + HighFive::File& file, HighFive::Group& checkpoint_group, + HighFive::Group& symbol_table_group) { + writeSubItemValuePerItemVariant(symbol_name, embedded_data, file, checkpoint_group, + symbol_table_group); + }), + std::function([](const std::string& symbol_name, + const HighFive::Group& symbol_table_group) -> EmbeddedData { + return readSubItemValuePerItemVariant(symbol_name, symbol_table_group); + })); + #endif // PUGS_HAS_HDF5 } diff --git a/src/utils/checkpointing/CheckpointUtils.cpp b/src/utils/checkpointing/CheckpointUtils.cpp index 59b9f1db5508610c3c3dd74d53161d1e4d74e0f0..fc2fda7b4fa2c7a8ad47876cbc4ab6beed506010 100644 --- a/src/utils/checkpointing/CheckpointUtils.cpp +++ b/src/utils/checkpointing/CheckpointUtils.cpp @@ -19,6 +19,8 @@ #include <mesh/NumberedBoundaryDescriptor.hpp> #include <mesh/NumberedInterfaceDescriptor.hpp> #include <mesh/NumberedZoneDescriptor.hpp> +#include <mesh/SubItemArrayPerItemVariant.hpp> +#include <mesh/SubItemValuePerItemVariant.hpp> #include <output/INamedDiscreteData.hpp> #include <output/NamedDiscreteFunction.hpp> #include <output/NamedItemArrayVariant.hpp> @@ -656,6 +658,90 @@ writeIWriter(const std::string& symbol_name, } } +void +writeSubItemArrayPerItemVariant(HighFive::Group& variable_group, + std::shared_ptr<const SubItemArrayPerItemVariant> sub_item_array_per_item_variant_v, + HighFive::File& file, + HighFive::Group& checkpoint_group) +{ + variable_group.createAttribute("type", + dataTypeName(ast_node_data_type_from<decltype(sub_item_array_per_item_variant_v)>)); + + std::visit( + [&](auto&& sub_item_array_per_item) { + using SubItemArrayPerItemT = std::decay_t<decltype(sub_item_array_per_item)>; + + variable_group.createAttribute("item_type", SubItemArrayPerItemT::item_type); + variable_group.createAttribute("sub_item_type", SubItemArrayPerItemT::sub_item_type); + using data_type = std::decay_t<typename SubItemArrayPerItemT::data_type>; + variable_group.createAttribute("data_type", dataTypeName(ast_node_data_type_from<data_type>)); + + const IConnectivity& connectivity = *sub_item_array_per_item.connectivity_ptr(); + variable_group.createAttribute("connectivity_id", connectivity.id()); + writeConnectivity(connectivity, file, checkpoint_group); + + write(variable_group, "arrays", sub_item_array_per_item.tableView()); + }, + sub_item_array_per_item_variant_v->subItemArrayPerItem()); +} + +void +writeSubItemArrayPerItemVariant(const std::string& symbol_name, + const EmbeddedData& embedded_data, + HighFive::File& file, + HighFive::Group& checkpoint_group, + HighFive::Group& symbol_table_group) +{ + HighFive::Group variable_group = symbol_table_group.createGroup("embedded/" + symbol_name); + + std::shared_ptr<const SubItemArrayPerItemVariant> sub_item_array_per_item_variant_p = + dynamic_cast<const DataHandler<const SubItemArrayPerItemVariant>&>(embedded_data.get()).data_ptr(); + + writeSubItemArrayPerItemVariant(variable_group, sub_item_array_per_item_variant_p, file, checkpoint_group); +} + +void +writeSubItemValuePerItemVariant(HighFive::Group& variable_group, + std::shared_ptr<const SubItemValuePerItemVariant> sub_item_value_per_item_variant_v, + HighFive::File& file, + HighFive::Group& checkpoint_group) +{ + variable_group.createAttribute("type", + dataTypeName(ast_node_data_type_from<decltype(sub_item_value_per_item_variant_v)>)); + + std::visit( + [&](auto&& sub_item_value_per_item) { + using SubItemValuePerItemT = std::decay_t<decltype(sub_item_value_per_item)>; + + variable_group.createAttribute("item_type", SubItemValuePerItemT::item_type); + variable_group.createAttribute("sub_item_type", SubItemValuePerItemT::sub_item_type); + using data_type = std::decay_t<typename SubItemValuePerItemT::data_type>; + variable_group.createAttribute("data_type", dataTypeName(ast_node_data_type_from<data_type>)); + + const IConnectivity& connectivity = *sub_item_value_per_item.connectivity_ptr(); + variable_group.createAttribute("connectivity_id", connectivity.id()); + writeConnectivity(connectivity, file, checkpoint_group); + + write(variable_group, "values", sub_item_value_per_item.arrayView()); + }, + sub_item_value_per_item_variant_v->subItemValuePerItem()); +} + +void +writeSubItemValuePerItemVariant(const std::string& symbol_name, + const EmbeddedData& embedded_data, + HighFive::File& file, + HighFive::Group& checkpoint_group, + HighFive::Group& symbol_table_group) +{ + HighFive::Group variable_group = symbol_table_group.createGroup("embedded/" + symbol_name); + + std::shared_ptr<const SubItemValuePerItemVariant> sub_item_value_per_item_variant_p = + dynamic_cast<const DataHandler<const SubItemValuePerItemVariant>&>(embedded_data.get()).data_ptr(); + + writeSubItemValuePerItemVariant(variable_group, sub_item_value_per_item_variant_p, file, checkpoint_group); +} + void writeIZoneDescriptor(const std::string& symbol_name, const EmbeddedData& embedded_data, diff --git a/src/utils/checkpointing/CheckpointUtils.hpp b/src/utils/checkpointing/CheckpointUtils.hpp index fb01fe674d9f4e450a6b782ae5b85340c94c9414..2449455b87d21f516ca10e9fd9a72aa880947688 100644 --- a/src/utils/checkpointing/CheckpointUtils.hpp +++ b/src/utils/checkpointing/CheckpointUtils.hpp @@ -201,6 +201,18 @@ void writeOStream(const std::string& symbol_name, HighFive::Group& checkpoint_group, HighFive::Group& symbol_table_group); +void writeSubItemArrayPerItemVariant(const std::string& symbol_name, + const EmbeddedData& embedded_data, + HighFive::File& file, + HighFive::Group& checkpoint_group, + HighFive::Group& symbol_table_group); + +void writeSubItemValuePerItemVariant(const std::string& symbol_name, + const EmbeddedData& embedded_data, + HighFive::File& file, + HighFive::Group& checkpoint_group, + HighFive::Group& symbol_table_group); + void writeVariableBCDescriptor(const std::string& symbol_name, const EmbeddedData& embedded_data, HighFive::File& file, diff --git a/src/utils/checkpointing/ResumeUtils.cpp b/src/utils/checkpointing/ResumeUtils.cpp index fe77e200b6ce6bb9730cb6913eeb24a7eafbdad1..7d1e3eea29e5ee650a4041d7a15aea0def82385c 100644 --- a/src/utils/checkpointing/ResumeUtils.cpp +++ b/src/utils/checkpointing/ResumeUtils.cpp @@ -14,6 +14,8 @@ #include <mesh/NumberedBoundaryDescriptor.hpp> #include <mesh/NumberedInterfaceDescriptor.hpp> #include <mesh/NumberedZoneDescriptor.hpp> +#include <mesh/SubItemArrayPerItemVariant.hpp> +#include <mesh/SubItemValuePerItemVariant.hpp> #include <output/GnuplotWriter.hpp> #include <output/GnuplotWriter1D.hpp> #include <output/NamedDiscreteFunction.hpp> @@ -48,9 +50,16 @@ #include <utils/checkpointing/QuadratureTypeHFType.hpp> #include <utils/checkpointing/ResumingData.hpp> +std::shared_ptr<DiscreteFunctionVariant> readDiscreteFunctionVariant(const HighFive::Group& discrete_function_group); std::shared_ptr<ItemArrayVariant> readItemArrayVariant(const HighFive::Group& item_array_variant_group); std::shared_ptr<ItemValueVariant> readItemValueVariant(const HighFive::Group& item_value_variant_group); -std::shared_ptr<DiscreteFunctionVariant> readDiscreteFunctionVariant(const HighFive::Group& discrete_function_group); + +template <typename T, ItemType item_type> +ItemArray<T, item_type> +readItemArray(const HighFive::Group& group, const std::string& name, const IConnectivity& connectivity) +{ + return {connectivity, readTable<T>(group, name)}; +} template <typename T, ItemType item_type> ItemValue<T, item_type> @@ -59,13 +68,20 @@ readItemValue(const HighFive::Group& group, const std::string& name, const IConn return {connectivity, readArray<T>(group, name)}; } -template <typename T, ItemType item_type> -ItemArray<T, item_type> -readItemArray(const HighFive::Group& group, const std::string& name, const IConnectivity& connectivity) +template <typename T, ItemType item_type, ItemType sub_item_type> +SubItemArrayPerItem<T, ItemOfItemType<sub_item_type, item_type>> +readSubItemArrayPerItem(const HighFive::Group& group, const std::string& name, const IConnectivity& connectivity) { return {connectivity, readTable<T>(group, name)}; } +template <typename T, ItemType item_type, ItemType sub_item_type> +SubItemValuePerItem<T, ItemOfItemType<sub_item_type, item_type>> +readSubItemValuePerItem(const HighFive::Group& group, const std::string& name, const IConnectivity& connectivity) +{ + return {connectivity, readArray<T>(group, name)}; +} + std::shared_ptr<const IBoundaryDescriptor> readIBoundaryDescriptor(const HighFive::Group& iboundarydescriptor_group) { @@ -471,6 +487,278 @@ readItemValueVariant(const std::string& symbol_name, const HighFive::Group& symb return {std::make_shared<DataHandler<const ItemValueVariant>>(readItemValueVariant(item_value_variant_group))}; } +template <ItemType item_type, ItemType sub_item_type> +std::shared_ptr<SubItemArrayPerItemVariant> +readSubItemArrayPerItemVariant(const HighFive::Group& sub_item_array_per_item_variant_group) +{ + if constexpr (item_type != sub_item_type) { + const std::string data_type = sub_item_array_per_item_variant_group.getAttribute("data_type").read<std::string>(); + const size_t connectivity_id = sub_item_array_per_item_variant_group.getAttribute("connectivity_id").read<size_t>(); + + const IConnectivity& connectivity = *ResumingData::instance().iConnectivity(connectivity_id); + + std::shared_ptr<SubItemArrayPerItemVariant> p_sub_item_array_per_item_variant; + + if (data_type == dataTypeName(ast_node_data_type_from<bool>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<bool, item_type, sub_item_type>(sub_item_array_per_item_variant_group, "arrays", + connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<long int>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<long int, item_type, sub_item_type>(sub_item_array_per_item_variant_group, "arrays", + connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<unsigned long int>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<unsigned long int, item_type, sub_item_type>(sub_item_array_per_item_variant_group, + "arrays", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<double>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<double, item_type, sub_item_type>(sub_item_array_per_item_variant_group, "arrays", + connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyVector<1>>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<TinyVector<1>, item_type, sub_item_type>(sub_item_array_per_item_variant_group, + "arrays", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyVector<2>>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<TinyVector<2>, item_type, sub_item_type>(sub_item_array_per_item_variant_group, + "arrays", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyVector<3>>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<TinyVector<3>, item_type, sub_item_type>(sub_item_array_per_item_variant_group, + "arrays", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyMatrix<1>>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<TinyMatrix<1>, item_type, sub_item_type>(sub_item_array_per_item_variant_group, + "arrays", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyMatrix<2>>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<TinyMatrix<2>, item_type, sub_item_type>(sub_item_array_per_item_variant_group, + "arrays", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyMatrix<3>>)) { + p_sub_item_array_per_item_variant = std::make_shared<SubItemArrayPerItemVariant>( + readSubItemArrayPerItem<TinyMatrix<3>, item_type, sub_item_type>(sub_item_array_per_item_variant_group, + "arrays", connectivity)); + } else { + throw UnexpectedError("unexpected discrete function data type: " + data_type); + } + return p_sub_item_array_per_item_variant; + } else { + throw UnexpectedError("item_type and sub_item_type must be different"); + } +} + +template <ItemType item_type> +std::shared_ptr<SubItemArrayPerItemVariant> +readSubItemArrayPerItemVariant(const HighFive::Group& sub_item_array_per_item_variant_group) +{ + const ItemType sub_item_type = sub_item_array_per_item_variant_group.getAttribute("sub_item_type").read<ItemType>(); + + std::shared_ptr<SubItemArrayPerItemVariant> p_sub_item_array_per_item_variant; + + switch (sub_item_type) { + case ItemType::cell: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<item_type, ItemType::cell>(sub_item_array_per_item_variant_group); + break; + } + case ItemType::face: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<item_type, ItemType::face>(sub_item_array_per_item_variant_group); + break; + } + case ItemType::edge: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<item_type, ItemType::edge>(sub_item_array_per_item_variant_group); + break; + } + case ItemType::node: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<item_type, ItemType::node>(sub_item_array_per_item_variant_group); + break; + } + } + + return p_sub_item_array_per_item_variant; +} + +std::shared_ptr<SubItemArrayPerItemVariant> +readSubItemArrayPerItemVariant(const HighFive::Group& sub_item_array_per_item_variant_group) +{ + const ItemType item_type = sub_item_array_per_item_variant_group.getAttribute("item_type").read<ItemType>(); + + std::shared_ptr<SubItemArrayPerItemVariant> p_sub_item_array_per_item_variant; + + switch (item_type) { + case ItemType::cell: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<ItemType::cell>(sub_item_array_per_item_variant_group); + break; + } + case ItemType::face: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<ItemType::face>(sub_item_array_per_item_variant_group); + break; + } + case ItemType::edge: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<ItemType::edge>(sub_item_array_per_item_variant_group); + break; + } + case ItemType::node: { + p_sub_item_array_per_item_variant = + readSubItemArrayPerItemVariant<ItemType::node>(sub_item_array_per_item_variant_group); + break; + } + } + + return p_sub_item_array_per_item_variant; +} + +EmbeddedData +readSubItemArrayPerItemVariant(const std::string& symbol_name, const HighFive::Group& symbol_table_group) +{ + const HighFive::Group sub_item_array_per_item_variant_group = symbol_table_group.getGroup("embedded/" + symbol_name); + return {std::make_shared<DataHandler<const SubItemArrayPerItemVariant>>( + readSubItemArrayPerItemVariant(sub_item_array_per_item_variant_group))}; +} + +template <ItemType item_type, ItemType sub_item_type> +std::shared_ptr<SubItemValuePerItemVariant> +readSubItemValuePerItemVariant(const HighFive::Group& sub_item_value_per_item_variant_group) +{ + if constexpr (item_type != sub_item_type) { + const std::string data_type = sub_item_value_per_item_variant_group.getAttribute("data_type").read<std::string>(); + const size_t connectivity_id = sub_item_value_per_item_variant_group.getAttribute("connectivity_id").read<size_t>(); + + const IConnectivity& connectivity = *ResumingData::instance().iConnectivity(connectivity_id); + + std::shared_ptr<SubItemValuePerItemVariant> p_sub_item_value_per_item_variant; + + if (data_type == dataTypeName(ast_node_data_type_from<bool>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<bool, item_type, sub_item_type>(sub_item_value_per_item_variant_group, "values", + connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<long int>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<long int, item_type, sub_item_type>(sub_item_value_per_item_variant_group, "values", + connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<unsigned long int>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<unsigned long int, item_type, sub_item_type>(sub_item_value_per_item_variant_group, + "values", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<double>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<double, item_type, sub_item_type>(sub_item_value_per_item_variant_group, "values", + connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyVector<1>>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<TinyVector<1>, item_type, sub_item_type>(sub_item_value_per_item_variant_group, + "values", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyVector<2>>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<TinyVector<2>, item_type, sub_item_type>(sub_item_value_per_item_variant_group, + "values", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyVector<3>>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<TinyVector<3>, item_type, sub_item_type>(sub_item_value_per_item_variant_group, + "values", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyMatrix<1>>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<TinyMatrix<1>, item_type, sub_item_type>(sub_item_value_per_item_variant_group, + "values", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyMatrix<2>>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<TinyMatrix<2>, item_type, sub_item_type>(sub_item_value_per_item_variant_group, + "values", connectivity)); + } else if (data_type == dataTypeName(ast_node_data_type_from<TinyMatrix<3>>)) { + p_sub_item_value_per_item_variant = std::make_shared<SubItemValuePerItemVariant>( + readSubItemValuePerItem<TinyMatrix<3>, item_type, sub_item_type>(sub_item_value_per_item_variant_group, + "values", connectivity)); + } else { + throw UnexpectedError("unexpected discrete function data type: " + data_type); + } + return p_sub_item_value_per_item_variant; + } else { + throw UnexpectedError("item_type and sub_item_type must be different"); + } +} + +template <ItemType item_type> +std::shared_ptr<SubItemValuePerItemVariant> +readSubItemValuePerItemVariant(const HighFive::Group& sub_item_value_per_item_variant_group) +{ + const ItemType sub_item_type = sub_item_value_per_item_variant_group.getAttribute("sub_item_type").read<ItemType>(); + + std::shared_ptr<SubItemValuePerItemVariant> p_sub_item_value_per_item_variant; + + switch (sub_item_type) { + case ItemType::cell: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<item_type, ItemType::cell>(sub_item_value_per_item_variant_group); + break; + } + case ItemType::face: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<item_type, ItemType::face>(sub_item_value_per_item_variant_group); + break; + } + case ItemType::edge: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<item_type, ItemType::edge>(sub_item_value_per_item_variant_group); + break; + } + case ItemType::node: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<item_type, ItemType::node>(sub_item_value_per_item_variant_group); + break; + } + } + + return p_sub_item_value_per_item_variant; +} + +std::shared_ptr<SubItemValuePerItemVariant> +readSubItemValuePerItemVariant(const HighFive::Group& sub_item_value_per_item_variant_group) +{ + const ItemType item_type = sub_item_value_per_item_variant_group.getAttribute("item_type").read<ItemType>(); + + std::shared_ptr<SubItemValuePerItemVariant> p_sub_item_value_per_item_variant; + + switch (item_type) { + case ItemType::cell: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<ItemType::cell>(sub_item_value_per_item_variant_group); + break; + } + case ItemType::face: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<ItemType::face>(sub_item_value_per_item_variant_group); + break; + } + case ItemType::edge: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<ItemType::edge>(sub_item_value_per_item_variant_group); + break; + } + case ItemType::node: { + p_sub_item_value_per_item_variant = + readSubItemValuePerItemVariant<ItemType::node>(sub_item_value_per_item_variant_group); + break; + } + } + + return p_sub_item_value_per_item_variant; +} + +EmbeddedData +readSubItemValuePerItemVariant(const std::string& symbol_name, const HighFive::Group& symbol_table_group) +{ + const HighFive::Group sub_item_value_per_item_variant_group = symbol_table_group.getGroup("embedded/" + symbol_name); + return {std::make_shared<DataHandler<const SubItemValuePerItemVariant>>( + readSubItemValuePerItemVariant(sub_item_value_per_item_variant_group))}; +} + EmbeddedData readIWriter(const std::string& symbol_name, const HighFive::Group& symbol_table_group) { diff --git a/src/utils/checkpointing/ResumeUtils.hpp b/src/utils/checkpointing/ResumeUtils.hpp index 99992cbb2e75b4fe28455751326b13a0556d3c2f..06bc7e97e6b6ca5a616a067f9a681fdfeda43882 100644 --- a/src/utils/checkpointing/ResumeUtils.hpp +++ b/src/utils/checkpointing/ResumeUtils.hpp @@ -100,6 +100,8 @@ EmbeddedData readIWriter(const std::string& symbol_name, const HighFive::Group& EmbeddedData readIZoneDescriptor(const std::string& symbol_name, const HighFive::Group& symbol_table_group); EmbeddedData readMesh(const std::string& symbol_name, const HighFive::Group& symbol_table_group); EmbeddedData readOStream(const std::string& symbol_name, const HighFive::Group& symbol_table_group); +EmbeddedData readSubItemArrayPerItemVariant(const std::string& symbol_name, const HighFive::Group& symbol_table_group); +EmbeddedData readSubItemValuePerItemVariant(const std::string& symbol_name, const HighFive::Group& symbol_table_group); EmbeddedData readVariableBCDescriptor(const std::string& symbol_name, const HighFive::Group& symbol_table_group); #endif // RESUME_UTILS_HPP