IOSS 2.0
Loading...
Searching...
No Matches
Ioss_Region.h
Go to the documentation of this file.
1// Copyright(C) 1999-2024 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 "Ioss_CoordinateFrame.h" // for CoordinateFrame
10#include "Ioss_DBUsage.h"
11#include "Ioss_DatabaseIO.h" // for DatabaseIO
14#include "Ioss_EntityType.h" // for EntityType, etc
15#include "Ioss_Field.h"
16#include "Ioss_GroupingEntity.h" // for GroupingEntity
17#include "Ioss_MeshType.h"
18#include "Ioss_Property.h" // for Property
19#include "Ioss_State.h" // for State
20#include <assert.h>
21#include <cstddef> // for size_t, nullptr
22#include <cstdint> // for int64_t
23
24#include "Ioss_CodeTypes.h"
25#include "Ioss_Utils.h"
26#include "Ioss_VariableType.h"
27#include "ioss_export.h"
28#include <functional> // for less
29#include <iosfwd> // for ostream
30#include <map> // for map, map<>::value_compare
31#include <memory>
32#include <sstream>
33#include <string> // for string, operator<
34#include <tuple>
35#include <utility> // for pair
36#include <vector> // for vector
37
38namespace Ioss {
39 class Assembly;
40 class Blob;
41 class CommSet;
42 class EdgeBlock;
43 class EdgeSet;
44 class ElementBlock;
45 class ElementSet;
46 class FaceBlock;
47 class FaceSet;
48 class Field;
49 class NodeBlock;
50 class NodeSet;
51 class SideBlock;
52 class SideSet;
53 class StructuredBlock;
54} // namespace Ioss
55// Needed for node_global_to_local inline function.
56
57namespace Ioss {
58
59 class CoordinateFrame;
60
61 enum class MeshType;
62
63 using AssemblyContainer = std::vector<Ioss::Assembly *>;
64 using BlobContainer = std::vector<Ioss::Blob *>;
65
66 using NodeBlockContainer = std::vector<NodeBlock *>;
67 using EdgeBlockContainer = std::vector<EdgeBlock *>;
68 using FaceBlockContainer = std::vector<FaceBlock *>;
69 using ElementBlockContainer = std::vector<ElementBlock *>;
70
71 using NodeSetContainer = std::vector<NodeSet *>;
72 using EdgeSetContainer = std::vector<EdgeSet *>;
73 using FaceSetContainer = std::vector<FaceSet *>;
74 using ElementSetContainer = std::vector<ElementSet *>;
75
76 using SideSetContainer = std::vector<SideSet *>;
77 using StructuredBlockContainer = std::vector<StructuredBlock *>;
78 using CommSetContainer = std::vector<CommSet *>;
79 using StateTimeContainer = std::vector<double>;
80
81 using CoordinateFrameContainer = std::vector<CoordinateFrame>;
82
83 using AliasMap = std::map<std::string, std::string, std::less<>>;
84
85 /** \brief A grouping entity that contains other grouping entities.
86 *
87 * Maintains a list of NodeBlocks, ElementBlocks, NodeLists, CommLists and Surfaces.
88 * [Similar to the "Composite Pattern" in Design Patterns] All interface to
89 * GroupingEntities is through the Region class; clients of the IO subsystem have no direct
90 * access to the underlying GroupingEntities (other than the Region).
91 */
92 class IOSS_EXPORT Region : public GroupingEntity
93 {
94 public:
95 explicit Region(DatabaseIO *iodatabase = nullptr, const std::string &my_name = "");
96
97 ~Region() override;
98
99 IOSS_NODISCARD std::string type_string() const override { return "Region"; }
100 IOSS_NODISCARD std::string short_type_string() const override { return "region"; }
101 IOSS_NODISCARD std::string contains_string() const override { return "Entities"; }
102 IOSS_NODISCARD EntityType type() const override { return REGION; }
103
104 IOSS_NODISCARD MeshType mesh_type() const;
105 IOSS_NODISCARD std::string mesh_type_string() const;
106 IOSS_NODISCARD bool node_major() const;
107
108 void output_summary(std::ostream &strm, bool do_transient = true) const;
109
110 IOSS_NODISCARD bool supports_field_type(Ioss::EntityType fld_type) const;
111
112 // Helper function...
113 IOSS_NODISCARD int64_t node_global_to_local(int64_t global, bool must_exist = true) const;
114
115 bool begin_mode(State new_state);
116 bool end_mode(State current_state);
117
118 // Add a new state at this time, return state number
119 virtual int add_state(double time)
120 {
121 IOSS_FUNC_ENTER(m_);
122 return add_state_nl(time);
123 }
124 virtual int add_state_nl(double time);
125
126 // Get time corresponding to specified state
127
128 IOSS_NODISCARD virtual double get_state_time(int state = -1) const;
129 IOSS_NODISCARD int get_current_state() const;
130 double begin_state(int state);
131 double end_state(int state);
132
133 /** \brief Determine whether the metadata defining the model (nontransient,
134 * geometry, and toploloty) has been set.
135 *
136 * \returns True if the metadata defining the model has been set.
137 */
138 IOSS_NODISCARD bool model_defined() const { return modelDefined; }
139
140 /** \brief Determine whether the metadata related to the transient
141 * data has been set.
142 *
143 * \returns True if the metadata related to the transient data has been set.
144 */
145 IOSS_NODISCARD bool transient_defined() const { return transientDefined; }
146
147 /** \brief Remove all fields of the specified `role` from all entities in the region
148 */
149 void erase_fields(Field::RoleType role);
150
151 // Return a pair consisting of the step (1-based) corresponding to
152 // the maximum time on the database and the corresponding maximum
153 // time value. Note that this may not necessarily be the last step
154 // on the database if cycle and overlay are being used.
155 IOSS_NODISCARD std::pair<int, double> get_max_time() const;
156
157 // Return a tuple consisting of the step (1-based) corresponding to
158 // the maximum time across all change sets on the database, the corresponding
159 // maximum time value and the corresponding set.
160 IOSS_NODISCARD std::tuple<std::string, int, double> get_db_max_time() const;
161
162 // Return a pair consisting of the step (1-based) corresponding to
163 // the minimum time on the database and the corresponding minimum
164 // time value. Note that this may not necessarily be the first step
165 // on the database if cycle and overlay are being used.
166 IOSS_NODISCARD std::pair<int, double> get_min_time() const;
167
168 // Return a tuple consisting of the step (1-based) corresponding to
169 // the minimum time across all change sets on the database, the corresponding
170 // minimum time value and the corresponding set.
171 IOSS_NODISCARD std::tuple<std::string, int, double> get_db_min_time() const;
172
173 // Functions for an output region...
174 bool add(NodeBlock *node_block);
175 bool add(EdgeBlock *edge_block);
176 bool add(FaceBlock *face_block);
177 bool add(ElementBlock *element_block);
178 bool add(SideSet *sideset);
179 bool add(NodeSet *nodeset);
180 bool add(EdgeSet *edgeset);
181 bool add(FaceSet *faceset);
182 bool add(ElementSet *elementset);
183 bool add(CommSet *commset);
184 bool add(StructuredBlock *structured_block);
185 bool add(Assembly *assembly);
186 bool add(Blob *blob);
187 bool add(const CoordinateFrame &frame);
188
189 // Special purpose...
190 bool remove(Assembly *removal);
191
192 IOSS_NODISCARD const NodeBlockContainer &get_node_blocks() const;
193 IOSS_NODISCARD const EdgeBlockContainer &get_edge_blocks() const;
194 IOSS_NODISCARD const FaceBlockContainer &get_face_blocks() const;
195 IOSS_NODISCARD const ElementBlockContainer &get_element_blocks() const;
196 IOSS_NODISCARD const SideSetContainer &get_sidesets() const;
197 IOSS_NODISCARD const NodeSetContainer &get_nodesets() const;
198 IOSS_NODISCARD const EdgeSetContainer &get_edgesets() const;
199 IOSS_NODISCARD const FaceSetContainer &get_facesets() const;
200 IOSS_NODISCARD const ElementSetContainer &get_elementsets() const;
201 IOSS_NODISCARD const CommSetContainer &get_commsets() const;
202 IOSS_NODISCARD const StructuredBlockContainer &get_structured_blocks() const;
203 IOSS_NODISCARD const AssemblyContainer &get_assemblies() const;
204 IOSS_NODISCARD const BlobContainer &get_blobs() const;
205 IOSS_NODISCARD const CoordinateFrameContainer &get_coordinate_frames() const;
206
207 // Retrieve the Grouping Entity with the specified name.
208 // Returns nullptr if the entity does not exist
209 IOSS_NODISCARD GroupingEntity *get_entity(const std::string &my_name, EntityType io_type) const;
210 IOSS_NODISCARD GroupingEntity *get_entity(const std::string &my_name) const;
211 IOSS_NODISCARD NodeBlock *get_node_block(const std::string &my_name) const;
212 IOSS_NODISCARD EdgeBlock *get_edge_block(const std::string &my_name) const;
213 IOSS_NODISCARD FaceBlock *get_face_block(const std::string &my_name) const;
214 IOSS_NODISCARD ElementBlock *get_element_block(const std::string &my_name) const;
215 IOSS_NODISCARD SideSet *get_sideset(const std::string &my_name) const;
216 IOSS_NODISCARD SideBlock *get_sideblock(const std::string &my_name) const;
217 IOSS_NODISCARD NodeSet *get_nodeset(const std::string &my_name) const;
218 IOSS_NODISCARD EdgeSet *get_edgeset(const std::string &my_name) const;
219 IOSS_NODISCARD FaceSet *get_faceset(const std::string &my_name) const;
220 IOSS_NODISCARD ElementSet *get_elementset(const std::string &my_name) const;
221 IOSS_NODISCARD CommSet *get_commset(const std::string &my_name) const;
222 IOSS_NODISCARD StructuredBlock *get_structured_block(const std::string &my_name) const;
223 IOSS_NODISCARD Assembly *get_assembly(const std::string &my_name) const;
224 IOSS_NODISCARD Blob *get_blob(const std::string &my_name) const;
225
226 // Not guaranteed to be efficient...
227 // Note that not all GroupingEntity's are guaranteed to have an 'id'...
228 IOSS_NODISCARD GroupingEntity *get_entity(int64_t id, EntityType io_type) const;
229
230 IOSS_NODISCARD const CoordinateFrame &get_coordinate_frame(int64_t id) const;
231
232 // Add the name 'alias' as an alias for the database entity of
233 // type 'type' with the name 'db_name'. Returns true if alias
234 // added; false if problems adding alias.
235 bool add_alias(const std::string &db_name, const std::string &alias, EntityType type);
236 bool add_alias(const std::string &db_name, const std::string &alias);
237 bool add_alias(const GroupingEntity *ge);
238 IOSS_NODISCARD std::string get_alias(const std::string &alias, EntityType type) const;
239 IOSS_NODISCARD std::string get_alias_nl(const std::string &alias,
240 EntityType type) const; // Not locked by mutex
241
242 IOSS_NODISCARD const AliasMap &get_alias_map(EntityType entity_type) const;
243
244 /// Get a map containing all aliases defined for the entity with basename 'my_name'
245 int get_aliases(const std::string &my_name, EntityType type, Ioss::NameList &aliases) const;
246
247 // This routine transfers all relevant aliases from the 'this'
248 // region and applies them to the 'to' file.
249 void transfer_mesh_aliases(Region *to) const;
250
251 // Ensure that the 'this' region has the same ids and names as the 'from' region.
252 void synchronize_id_and_name(const Region *from, bool sync_attribute_field_names = false);
253
254 // Returns true if the passed in name refers to a known Entity
255 // defined on this region. If true, then 'type' (if non-nullptr) is
256 // filled in with the type of the entity; if false, then type (if
257 // non-nullptr) is set to 'INVALID' This function is defined to
258 // consolidate several distinct implementations of this code in
259 // client code. Because of this, the 'type' used in the client
260 // code is repeated here instead of something more generic.
261 IOSS_NODISCARD bool is_valid_io_entity(const std::string &my_name, unsigned int io_type,
262 std::string *my_type = nullptr) const;
263
264 void check_for_duplicate_names(const Ioss::GroupingEntity *entity) const;
265
266 // Retrieve the element block that contains the specified element
267 // The 'local_id' is the local database id (1-based), not the global id.
268 // returns nullptr if no element block contains this element (local_id <= 0
269 // or greater than number of elements in database)
270 IOSS_NODISCARD ElementBlock *get_element_block(size_t local_id) const;
271
272 // Retrieve the structured block that contains the specified node
273 // The 'global_offset' is the global offset (0-based)
274 // returns nullptr if no structured block contains this node (local_id <= 0
275 // or greater than number of cell-nodes in database)
276 IOSS_NODISCARD StructuredBlock *get_structured_block(size_t global_offset) const;
277
278 // Handle implicit properties -- These are calculated from data stored
279 // in the grouping entity instead of having an explicit value assigned.
280 // An example would be 'element_block_count' for a region.
281 IOSS_NODISCARD Property get_implicit_property(const std::string &my_name) const override;
282
283 IOSS_NODISCARD const Ioss::NameList &get_information_records() const;
284 void add_information_records(const Ioss::NameList &info);
285 void add_information_record(const std::string &info);
286
287 IOSS_NODISCARD const Ioss::NameList &get_qa_records() const;
288 void add_qa_record(const std::string &code, const std::string &code_qa,
289 const std::string &date = "", const std::string &time = "");
290
291 template <typename T, typename U>
292 std::vector<size_t> get_entity_field_data(const std::string &field_name,
293 const std::vector<T *> &entity_container,
294 std::vector<U> &field_data) const;
295
296 void register_mesh_modification_observer(std::shared_ptr<DynamicTopologyObserver> observer);
297 IOSS_NODISCARD std::shared_ptr<DynamicTopologyObserver> get_mesh_modification_observer() const
298 {
299 return topologyObserver;
300 }
301
302 void reset_topology_modification();
303 void set_topology_modification(unsigned int type);
304 IOSS_NODISCARD unsigned int get_topology_modification() const;
305
306 void start_new_output_database_entry(int steps = 0);
307
308 void set_topology_change_count(unsigned int new_count) { dbChangeCount = new_count; }
309 IOSS_NODISCARD unsigned int get_topology_change_count() const { return dbChangeCount; }
310
311 void set_file_cyclic_count(unsigned int new_count) { fileCyclicCount = new_count; }
312 IOSS_NODISCARD unsigned int get_file_cyclic_count() const { return fileCyclicCount; }
313
315 {
316 ifDatabaseExists = if_exists;
317 }
319 {
320 return ifDatabaseExists;
321 }
322
323 IOSS_NODISCARD bool model_is_written() const { return modelWritten; }
324 IOSS_NODISCARD bool transient_is_written() const { return transientWritten; }
325
326 IOSS_NODISCARD bool load_internal_change_set_mesh(const std::string &set_name);
327 IOSS_NODISCARD bool load_internal_change_set_mesh(const int set_index);
328
329 IOSS_NODISCARD std::tuple<std::string, int, double> locate_db_state(double targetTime) const;
330
331 protected:
332 std::string get_internal_change_set_name() const;
333 void update_dynamic_topology();
334 void clone_and_replace_output_database(int steps = 0);
335 void add_output_database_change_set(int steps = 0, bool force_addition = false);
336
337 int64_t internal_get_field_data(const Field &field, void *data,
338 size_t data_size = 0) const override;
339
340 int64_t internal_put_field_data(const Field &field, void *data,
341 size_t data_size = 0) const override;
342
343 int64_t internal_get_zc_field_data(const Field &field, void **data,
344 size_t *data_size) const override;
345
346 private:
347 template <typename T>
348 std::vector<size_t> internal_get_entity_field_data(const std::string &field_name,
349 const std::vector<T *> &entity_container,
350 void *data, size_t data_size = 0) const;
351
352 // Add the name 'alias' as an alias for the database entity with the
353 // name 'db_name'. Returns true if alias added; false if problems
354 // adding alias. Not protected by mutex -- call internally only.
355 bool add_alias_nl(const std::string &db_name, const std::string &alias, EntityType type);
356 bool add_alias_nl(const GroupingEntity *ge);
357
358 bool begin_mode_nl(State new_state);
359 bool end_mode_nl(State current_state);
360
361 void delete_database() override;
362 void reset_region();
363
364 mutable std::map<EntityType, AliasMap> aliases_; ///< Stores alias mappings
365
366 // Containers for all grouping entities
371
376
384
385 int currentState{-1};
386 mutable int stateCount{0};
387 bool modelDefined{false};
388 bool transientDefined{false};
389
390 std::shared_ptr<DynamicTopologyObserver> topologyObserver;
391
392 unsigned int dbChangeCount{1}; //!< Used to track number of topology changes.
393 unsigned int fileCyclicCount{
394 0}; //!< For cycling file-A, file-B, file-C, ..., File-A, typically restart only.
396
397 bool modelWritten{false};
398 bool transientWritten{false};
399 bool fileGroupsStarted{false};
400 };
401} // namespace Ioss
402
403/** \brief Get the index (1-based) of the currently-active state.
404 *
405 * \returns The index.
406 */
407inline int Ioss::Region::get_current_state() const { return currentState; }
408
410{
411 return static_cast<unsigned int>((get_database()->entity_field_support() & fld_type) != 0U) != 0U;
412}
413
414inline int64_t Ioss::Region::node_global_to_local(int64_t global, bool must_exist) const
415{
416 return get_database()->node_global_to_local(global, must_exist);
417}
418
419/** \brief Get all information records (informative strings) for the region's database.
420 *
421 * \returns The informative strings.
422 */
424{
425 IOSS_FUNC_ENTER(m_);
426 return get_database()->get_information_records();
427}
428
429/** \brief Add multiple information records (informative strings) to the region's database.
430 *
431 * \param[in] info The strings to add.
432 */
434{
435 IOSS_FUNC_ENTER(m_);
436 return get_database()->add_information_records(info);
437}
438
439/** \brief Add an information record (an informative string) to the region's database.
440 *
441 * \param[in] info The string to add.
442 */
443inline void Ioss::Region::add_information_record(const std::string &info)
444{
445 IOSS_FUNC_ENTER(m_);
446 return get_database()->add_information_record(info);
447}
448
449/** \brief Add a QA record, which consists of 4 strings, to the region's database
450 *
451 * The 4 function parameters correspond to the 4 QA record strings.
452 *
453 * \param[in] code A descriptive code name, such as the application that modified the database.
454 * \param[in] code_qa A descriptive string, such as the version of the application that modified
455 * the database.
456 * \param[in] date A relevant date, such as the date the database was modified.
457 * \param[in] time A relevant time, such as the time the database was modified.
458 */
459inline void Ioss::Region::add_qa_record(const std::string &code, const std::string &code_qa,
460 const std::string &date, const std::string &time)
461{
462 IOSS_FUNC_ENTER(m_);
463 return get_database()->add_qa_record(code, code_qa, date, time);
464}
465
466/** \brief Get all QA records, each of which consists of 4 strings, from the region's database.
467 *
468 * The 4 strings that make up a database QA record are:
469 *
470 * 1. A descriptive code name, such as the application that modified the database.
471 *
472 * 2. A descriptive string, such as the version of the application that modified the database.
473 *
474 * 3. A relevant date, such as the date the database was modified.
475 *
476 * 4. A relevant time, such as the time the database was modified.
477 *
478 * \returns All QA records in a single vector. Every 4 consecutive elements of the
479 * vector make up a single QA record.
480 */
482{
483 IOSS_FUNC_ENTER(m_);
484 return get_database()->get_qa_records();
485}
486
487namespace Ioss {
488
489 template <typename T>
490 bool verify_field_exists_in_entity_group(const std::string &field_name,
491 const std::vector<T *> &entity_container)
492 {
493 bool found = false;
495
496 for (const T *entity : entity_container) {
497 if (entity->field_exists(field_name)) {
498 Ioss::Field field = entity->get_field(field_name);
499
500 if (found && field.get_role() != role) {
501 std::ostringstream errmsg;
502 // Would be nice to use fmt:: here, but we need to avoid using fmt includes in public
503 // headers...
504 errmsg << "ERROR: Field " << field.get_name() << " with role " << field.role_string()
505 << " on entity " << entity->name() << " does not match previously found role "
506 << Ioss::Field::role_string(role) << ".\n";
507 IOSS_ERROR(errmsg);
508 }
509
510 found = true;
511 role = field.get_role();
512 }
513 }
514
515 return found;
516 }
517
518 namespace impl {
519 template <typename T>
520 size_t get_field_data_count_for_entities(const std::string &field_name,
521 const std::vector<T *> &entity_container)
522 {
523 size_t count = 0;
524
525 for (const T *entity : entity_container) {
526 if (entity->field_exists(field_name)) {
527 Ioss::Field field = entity->get_field(field_name);
528
529 count += entity->entity_count() * field.raw_storage()->component_count();
530 }
531 }
532
533 return count;
534 }
535 } // namespace impl
536} // namespace Ioss
537
538template <typename T, typename U>
539std::vector<size_t> Ioss::Region::get_entity_field_data(const std::string &field_name,
540 const std::vector<T *> &entity_container,
541 std::vector<U> &field_data) const
542{
543 bool field_exists = verify_field_exists_in_entity_group(field_name, entity_container);
544
545 if (!field_exists) {
546 return std::vector<size_t>(entity_container.size() + 1, 0);
547 }
548
549 size_t field_count = impl::get_field_data_count_for_entities(field_name, entity_container);
550
551 field_data.resize(field_count);
552 size_t data_size = field_count * sizeof(U);
553
554 std::vector<size_t> offsets =
555 internal_get_entity_field_data(field_name, entity_container, Data(field_data), data_size);
556
557 assert(offsets.size() == (entity_container.size() + 1));
558 assert(offsets[entity_container.size()] == field_count);
559
560 return offsets;
561}
562
563template <typename T>
564std::vector<size_t>
566 const std::vector<T *> &entity_container, void *data,
567 size_t data_size) const
568{
569 return get_database()->get_entity_field_data(field_name, entity_container, data, data_size);
570}
#define IOSS_FUNC_ENTER(m)
Definition Ioss_CodeTypes.h:105
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:55
IOSS_NODISCARD constexpr T * Data(std::vector< T > &vec)
Definition Ioss_Utils.h:56
void IOSS_ERROR(const std::ostringstream &errmsg)
Definition Ioss_Utils.h:38
A homogeneous collection of other GroupingEntities.
Definition Ioss_Assembly.h:31
A homogeneous collection of other GroupingEntities.
Definition Ioss_Blob.h:31
Definition Ioss_CommSet.h:27
Definition Ioss_CoordinateFrame.h:19
An input or output Database.
Definition Ioss_DatabaseIO.h:63
A collection of element edges with the same topology.
Definition Ioss_EdgeBlock.h:29
A collection of element edges.
Definition Ioss_EdgeSet.h:30
A collection of elements having the same topology.
Definition Ioss_ElementBlock.h:29
A collection of elements.
Definition Ioss_ElementSet.h:30
A collection of element faces with the same topology.
Definition Ioss_FaceBlock.h:29
A collection of element faces.
Definition Ioss_FaceSet.h:30
Holds metadata for bulk data associated with a GroupingEntity.
Definition Ioss_Field.h:25
IOSS_NODISCARD const VariableType * raw_storage() const
Definition Ioss_Field.h:168
RoleType
Definition Ioss_Field.h:69
@ INTERNAL
Definition Ioss_Field.h:70
IOSS_NODISCARD const std::string & get_name() const
Definition Ioss_Field.h:127
IOSS_NODISCARD std::string role_string() const
Definition Ioss_Field.C:414
IOSS_NODISCARD RoleType get_role() const
Get the role (MESH, ATTRIBUTE, TRANSIENT, REDUCTION, etc.) of the data in the field.
Definition Ioss_Field.h:184
Base class for all 'grouping' entities. The following derived classes are typical:
Definition Ioss_GroupingEntity.h:67
A collection of all nodes in the region.
Definition Ioss_NodeBlock.h:33
A collection of nodes.
Definition Ioss_NodeSet.h:29
A named value that has a known type.
Definition Ioss_Property.h:27
A grouping entity that contains other grouping entities.
Definition Ioss_Region.h:93
BlobContainer blobs
Definition Ioss_Region.h:382
void add_qa_record(const std::string &code, const std::string &code_qa, const std::string &date="", const std::string &time="")
Add a QA record, which consists of 4 strings, to the region's database.
Definition Ioss_Region.h:459
IOSS_NODISCARD bool model_defined() const
Determine whether the metadata defining the model (nontransient, geometry, and toploloty) has been se...
Definition Ioss_Region.h:138
IOSS_NODISCARD std::string type_string() const override
Get the name of the particular type of entity.
Definition Ioss_Region.h:99
void add_information_records(const Ioss::NameList &info)
Add multiple information records (informative strings) to the region's database.
Definition Ioss_Region.h:433
IOSS_NODISCARD EntityType type() const override
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Definition Ioss_Region.h:102
StructuredBlockContainer structuredBlocks
Definition Ioss_Region.h:380
IOSS_NODISCARD bool transient_defined() const
Determine whether the metadata related to the transient data has been set.
Definition Ioss_Region.h:145
AssemblyContainer assemblies
Definition Ioss_Region.h:381
IOSS_NODISCARD std::string contains_string() const override
What does this entity contain.
Definition Ioss_Region.h:101
IOSS_NODISCARD const Ioss::NameList & get_information_records() const
Get all information records (informative strings) for the region's database.
Definition Ioss_Region.h:423
void set_topology_change_count(unsigned int new_count)
Definition Ioss_Region.h:308
IOSS_NODISCARD int get_current_state() const
Get the index (1-based) of the currently-active state.
Definition Ioss_Region.h:407
int currentState
Definition Ioss_Region.h:385
std::shared_ptr< DynamicTopologyObserver > topologyObserver
Definition Ioss_Region.h:390
IOSS_NODISCARD int64_t node_global_to_local(int64_t global, bool must_exist=true) const
Definition Ioss_Region.h:414
IOSS_NODISCARD IfDatabaseExistsBehavior get_if_database_exists_behavior() const
Definition Ioss_Region.h:318
IOSS_NODISCARD bool model_is_written() const
Definition Ioss_Region.h:323
ElementBlockContainer elementBlocks
Definition Ioss_Region.h:370
EdgeBlockContainer edgeBlocks
Definition Ioss_Region.h:368
std::vector< size_t > get_entity_field_data(const std::string &field_name, const std::vector< T * > &entity_container, std::vector< U > &field_data) const
Definition Ioss_Region.h:539
EdgeSetContainer edgeSets
Definition Ioss_Region.h:373
IOSS_NODISCARD std::shared_ptr< DynamicTopologyObserver > get_mesh_modification_observer() const
Definition Ioss_Region.h:297
FaceBlockContainer faceBlocks
Definition Ioss_Region.h:369
NodeBlockContainer nodeBlocks
Definition Ioss_Region.h:367
void set_if_database_exists_behavior(IfDatabaseExistsBehavior if_exists)
Definition Ioss_Region.h:314
CommSetContainer commSets
Definition Ioss_Region.h:378
ElementSetContainer elementSets
Definition Ioss_Region.h:375
StateTimeContainer stateTimes
Definition Ioss_Region.h:383
std::vector< size_t > internal_get_entity_field_data(const std::string &field_name, const std::vector< T * > &entity_container, void *data, size_t data_size=0) const
Definition Ioss_Region.h:565
IOSS_NODISCARD const Ioss::NameList & get_qa_records() const
Get all QA records, each of which consists of 4 strings, from the region's database.
Definition Ioss_Region.h:481
IOSS_NODISCARD bool supports_field_type(Ioss::EntityType fld_type) const
Definition Ioss_Region.h:409
std::map< EntityType, AliasMap > aliases_
Stores alias mappings.
Definition Ioss_Region.h:364
virtual int add_state(double time)
Definition Ioss_Region.h:119
void add_information_record(const std::string &info)
Add an information record (an informative string) to the region's database.
Definition Ioss_Region.h:443
IOSS_NODISCARD unsigned int get_file_cyclic_count() const
Definition Ioss_Region.h:312
NodeSetContainer nodeSets
Definition Ioss_Region.h:372
CoordinateFrameContainer coordinateFrames
Definition Ioss_Region.h:379
IOSS_NODISCARD std::string short_type_string() const override
Get a short name of the particular type of entity.
Definition Ioss_Region.h:100
FaceSetContainer faceSets
Definition Ioss_Region.h:374
void set_file_cyclic_count(unsigned int new_count)
Definition Ioss_Region.h:311
SideSetContainer sideSets
Definition Ioss_Region.h:377
IOSS_NODISCARD bool transient_is_written() const
Definition Ioss_Region.h:324
IOSS_NODISCARD unsigned int get_topology_change_count() const
Definition Ioss_Region.h:309
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
IOSS_NODISCARD int component_count() const
Definition Ioss_VariableType.h:154
size_t get_field_data_count_for_entities(const std::string &field_name, const std::vector< T * > &entity_container)
Definition Ioss_Region.h:520
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
std::vector< CommSet * > CommSetContainer
Definition Ioss_Region.h:78
State
Access states for a database.
Definition Ioss_State.h:15
std::vector< FaceSet * > FaceSetContainer
Definition Ioss_Region.h:73
std::vector< ElementBlock * > ElementBlockContainer
Definition Ioss_Region.h:69
Ioss::NameList NameList
Definition Ioss_ChangeSetFactory.h:25
std::vector< FaceBlock * > FaceBlockContainer
Definition Ioss_Region.h:68
std::map< std::string, std::string, std::less<> > AliasMap
Definition Ioss_Region.h:83
std::vector< EdgeBlock * > EdgeBlockContainer
Definition Ioss_Region.h:67
bool verify_field_exists_in_entity_group(const std::string &field_name, const std::vector< T * > &entity_container)
Definition Ioss_Region.h:490
std::vector< ElementSet * > ElementSetContainer
Definition Ioss_Region.h:74
std::vector< Ioss::Blob * > BlobContainer
Definition Ioss_Region.h:64
std::vector< NodeSet * > NodeSetContainer
Definition Ioss_Region.h:71
std::vector< double > StateTimeContainer
Definition Ioss_Region.h:79
std::vector< SideSet * > SideSetContainer
Definition Ioss_Region.h:76
std::vector< EdgeSet * > EdgeSetContainer
Definition Ioss_Region.h:72
MeshType
The mesh type – structured, unstructured, hybrid (future), or unknown.
Definition Ioss_MeshType.h:12
std::vector< CoordinateFrame > CoordinateFrameContainer
Definition Ioex_Utils.h:46
std::vector< Ioss::Assembly * > AssemblyContainer
Definition Ioss_Region.h:63
std::vector< NodeBlock * > NodeBlockContainer
Definition Ioss_Region.h:66
std::vector< StructuredBlock * > StructuredBlockContainer
Definition Ioss_Region.h:77
IfDatabaseExistsBehavior
Definition Ioss_DBUsage.h:32
@ DB_OVERWRITE
Definition Ioss_DBUsage.h:33
EntityType
The particular type of GroupingEntity.
Definition Ioss_EntityType.h:12
@ REGION
Definition Ioss_EntityType.h:25