IOSS 2.0
Loading...
Searching...
No Matches
Iofaodel_Utils.h
Go to the documentation of this file.
1// Copyright(C) 1999-2022 National Technology & Engineering Solutions
2// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3// NTESS, the U.S. Government retains certain rights in this software.
4//
5// See packages/seacas/LICENSE for details
6
7#pragma once
8
9#include "iofaodel_export.h"
10
11#include "Ioss_GroupingEntity.h"
12#include "Ioss_Property.h"
13#include "Ioss_Region.h"
14
15#include <kelpie/Key.hh>
16#include <lunasa/DataObject.hh>
17
18#include <set>
19
20namespace Iofaodel {
21
22 // Keys and LDOs go together, the pair below makes publishing easy
23 using DataPair = std::pair<kelpie::Key, lunasa::DataObject>;
24
25 struct IOFAODEL_EXPORT value_entry_t
26 {
27 size_t offset, size;
28 };
29
30 struct IOFAODEL_EXPORT meta_entry_t
31 {
32 enum class IossType {
33 IossProperty,
34 IossField,
35 IofaodelStates,
36 IofaodelSideBlock,
37 IofaodelStructuredBlock
38 };
40 value_entry_t value; // offset from LDO::GetDataPtr and size
41 // NOTE an added char data[0] would point to the next meta_entry_T
42 };
43
44 struct IOFAODEL_EXPORT state_entry_t
45 {
46 using basic_type = double;
47 size_t count;
49 char data[0];
50
51 explicit state_entry_t(const Ioss::Region &r);
52 };
53
54 struct IOFAODEL_EXPORT sideblock_entry_t
55 {
57
58 explicit sideblock_entry_t(const Ioss::SideBlock &sb);
59 };
60
61 IOFAODEL_EXPORT lunasa::DataObject pack_states(const Ioss::Region &r);
62
63 IOFAODEL_EXPORT lunasa::DataObject pack_sideblock(const Ioss::SideBlock &sb);
64 IOFAODEL_EXPORT int64_t unpack_sideblocks(lunasa::DataObject ldo);
65
66 IOFAODEL_EXPORT lunasa::DataObject pack_structuredblock(const Ioss::StructuredBlock &sb);
67 IOFAODEL_EXPORT void unpack_structuredblock(lunasa::DataObject &ldo, Ioss::StructuredBlock &sb);
68
69 IOFAODEL_EXPORT kelpie::Key make_states_search_key(int parallel_rank, const Ioss::Region &region);
70
71 IOFAODEL_EXPORT kelpie::Key make_states_key(int parallel_rank, const Ioss::Region &region);
72
73 IOFAODEL_EXPORT kelpie::Key sideblocks_search_key(int rank, const Ioss::Region &region,
74 const Ioss::SideSet &sideset);
75
76 IOFAODEL_EXPORT kelpie::Key make_sideblock_key(int rank, const Ioss::Region &region,
77 const Ioss::SideSet &sideset,
78 const Ioss::SideBlock &sideblock);
79
80 IOFAODEL_EXPORT kelpie::Key
81 structuredblock_search_key(int parallel_rank, const Ioss::Region &region,
82 const Ioss::StructuredBlock &structuredblock);
83
84 IOFAODEL_EXPORT kelpie::Key
85 make_structuredblock_key(int parallel_rank, const Ioss::Region &region,
86 const Ioss::StructuredBlock &structuredblock);
87
88 IOFAODEL_EXPORT kelpie::Key make_key(int parallel_rank, const Ioss::Region &region,
89 const Ioss::GroupingEntity &grouping_entity,
90 const Ioss::Field &field);
91
92 IOFAODEL_EXPORT kelpie::Key make_key(int parallel_rank, const Ioss::Region &region,
93 const Ioss::GroupingEntity &grouping_entity,
94 const Ioss::Property &property);
95
96 IOFAODEL_EXPORT kelpie::Key make_key(int parallel_rank, const Ioss::Region &region,
97 const Ioss::GroupingEntity &grouping_entity);
98
99 IOFAODEL_EXPORT kelpie::Key entity_search_key(int rank, const Ioss::Region &region,
100 const std::string &entity_name);
101
102 IOFAODEL_EXPORT kelpie::Key entity_search_key(int rank, const Ioss::Region &region,
103 const Ioss::GroupingEntity &entity);
104
105 IOFAODEL_EXPORT kelpie::Key property_search_key(int parallel_rank, const Ioss::Region &region,
106 const Ioss::GroupingEntity &grouping_entity);
107
108 IOFAODEL_EXPORT kelpie::Key make_property_key(int rank, const Ioss::Region &region,
109 const std::string &entity_type,
110 const std::string &entity_name,
111 const std::string &property_type,
112 const std::string &property_name);
113
114 IOFAODEL_EXPORT kelpie::Key field_search_key(int parallel_rank, const Ioss::Region &region,
115 const Ioss::GroupingEntity &grouping_entity);
116
117 IOFAODEL_EXPORT kelpie::Key field_search_key(int parallel_rank, int state,
118 const Ioss::Region &region,
119 const Ioss::GroupingEntity &grouping_entity);
120
121 IOFAODEL_EXPORT std::string to_string(const Ioss::Property::BasicType &t);
122 IOFAODEL_EXPORT std::string to_string(const Ioss::Field::BasicType &t);
123 IOFAODEL_EXPORT std::string to_string(const Ioss::Field::RoleType &t);
124 IOFAODEL_EXPORT std::string to_string(const Ioss::EntityType &t);
125
126 IOFAODEL_EXPORT std::string get_entity_name(const kelpie::Key &k, const std::string &target);
127 IOFAODEL_EXPORT std::set<std::string> get_entity_names(const std::vector<kelpie::Key> &keys,
128 const std::string &target);
129
130} // namespace Iofaodel
Holds metadata for bulk data associated with a GroupingEntity.
Definition Ioss_Field.h:25
BasicType
The basic data type held in the field.
Definition Ioss_Field.h:29
RoleType
Definition Ioss_Field.h:69
Base class for all 'grouping' entities. The following derived classes are typical:
Definition Ioss_GroupingEntity.h:67
A named value that has a known type.
Definition Ioss_Property.h:27
BasicType
Definition Ioss_Property.h:29
A grouping entity that contains other grouping entities.
Definition Ioss_Region.h:93
A collection of element sides having the same topology.
Definition Ioss_SideBlock.h:37
A collection of element sides.
Definition Ioss_SideSet.h:29
A structured zone – i,j,k.
Definition Ioss_StructuredBlock.h:91
A namespace for the pamgen database format.
Definition Iofaodel_DatabaseIO.C:46
kelpie::Key make_sideblock_key(int rank, const Ioss::Region &region, const Ioss::SideSet &sideset, const Ioss::SideBlock &sideblock)
Definition Iofaodel_Utils.C:176
kelpie::Key make_structuredblock_key(int rank, const Ioss::Region &region, const Ioss::StructuredBlock &structuredblock)
Definition Iofaodel_Utils.C:199
kelpie::Key make_property_key(int rank, const Ioss::Region &region, const std::string &entity_type, const std::string &entity_name, const std::string &property_type, const std::string &property_name)
Definition Iofaodel_Utils.C:305
std::pair< kelpie::Key, lunasa::DataObject > DataPair
Definition Iofaodel_Utils.h:23
int64_t unpack_sideblocks(lunasa::DataObject ldo)
Definition Iofaodel_Utils.C:72
kelpie::Key field_search_key(int rank, const Ioss::Region &region, const Ioss::GroupingEntity &grouping_entity)
Definition Iofaodel_Utils.C:323
kelpie::Key property_search_key(int rank, const Ioss::Region &region, const Ioss::GroupingEntity &grouping_entity)
Definition Iofaodel_Utils.C:289
std::string to_string(const Ioss::Property::BasicType &t)
Definition Iofaodel_Utils.C:360
kelpie::Key make_states_key(int rank, const Ioss::Region &region)
Definition Iofaodel_Utils.C:156
lunasa::DataObject pack_states(const Ioss::Region &r)
Definition Iofaodel_Utils.C:116
kelpie::Key entity_search_key(int rank, const Ioss::Region &region, const std::string &entity)
Definition Iofaodel_Utils.C:262
kelpie::Key make_key(int rank, const Ioss::Region &region, const Ioss::GroupingEntity &grouping_entity, const Ioss::Field &field)
Definition Iofaodel_Utils.C:210
std::string get_entity_name(const kelpie::Key &k, const std::string &target)
Definition Iofaodel_Utils.C:406
lunasa::DataObject pack_structuredblock(const Ioss::StructuredBlock &sb)
Definition Iofaodel_Utils.C:86
kelpie::Key sideblocks_search_key(int rank, const Ioss::Region &region, const Ioss::SideSet &sideset)
Definition Iofaodel_Utils.C:165
std::set< std::string > get_entity_names(const std::vector< kelpie::Key > &keys, const std::string &target)
Definition Iofaodel_Utils.C:419
lunasa::DataObject pack_sideblock(const Ioss::SideBlock &sb)
Definition Iofaodel_Utils.C:53
kelpie::Key structuredblock_search_key(int rank, const Ioss::Region &region, const Ioss::StructuredBlock &structuredblock)
Definition Iofaodel_Utils.C:188
kelpie::Key make_states_search_key(int rank, const Ioss::Region &region)
Definition Iofaodel_Utils.C:147
void unpack_structuredblock(lunasa::DataObject &ldo, Ioss::StructuredBlock &sb)
Definition Iofaodel_Utils.C:102
EntityType
The particular type of GroupingEntity.
Definition Ioss_EntityType.h:12
Definition Iofaodel_Utils.h:31
IossType ioss_type
Definition Iofaodel_Utils.h:39
IossType
Definition Iofaodel_Utils.h:32
value_entry_t value
Definition Iofaodel_Utils.h:40
Definition Iofaodel_Utils.h:55
size_t entity_count
Definition Iofaodel_Utils.h:56
Definition Iofaodel_Utils.h:45
size_t count
Definition Iofaodel_Utils.h:47
value_entry_t value
Definition Iofaodel_Utils.h:48
double basic_type
Definition Iofaodel_Utils.h:46
Definition Iofaodel_Utils.h:26
size_t offset
Definition Iofaodel_Utils.h:27