IOSS  2.0
Ioss_GroupingEntity.h
Go to the documentation of this file.
1 // Copyright(C) 1999-2020 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 #ifndef IOSS_Ioss_GroupingEntity_h
8 #define IOSS_Ioss_GroupingEntity_h
9 
10 #include <Ioss_CodeTypes.h> // for Complex
11 #include <Ioss_DatabaseIO.h> // for DatabaseIO
12 #include <Ioss_EntityType.h> // for EntityType
13 #include <Ioss_Field.h> // for Field, Field::RoleType, etc
14 #include <Ioss_FieldManager.h> // for FieldManager, NameList
15 #include <Ioss_Property.h> // for Property
16 #include <Ioss_PropertyManager.h> // for PropertyManager
17 #include <Ioss_State.h> // for State
18 #include <Ioss_VariableType.h> // for component_count()
19 #include <cstddef> // for size_t, nullptr
20 #include <cstdint> // for int64_t
21 #include <string> // for string
22 #include <vector> // for vector
23 
24 #ifdef SEACAS_HAVE_KOKKOS
25 #include <Kokkos_Core.hpp> // for Kokkos::View
26 #endif
27 
28 namespace Ioss {
29 
30  class EntityBlock;
31 
32  /** \brief Base class for all 'grouping' entities.
33  * The following derived classes are typical:
34  *
35  * -- NodeSet -- grouping of nodes (0d topology)
36  *
37  * -- EdgeSet -- grouping of edges (1d topology)
38  *
39  * -- FaceSet -- grouping of faces (2d topology) [Surface]
40  *
41  * Similarly, there is:
42  *
43  * -- NodeBlock -- grouping of 'similar' nodes (same degree of freedom, ...)
44  *
45  * -- ElementBlock -- grouping of 'similar' elements (same element topology,
46  * attributes, ...)
47  * 0d, 1d, 2d, 3d topology possible -- e.g., sphere, bar, quad, hex
48  *
49  * A Region is also a grouping entity, except that its list of subentites
50  * are other GroupingEntities. That is, it maintains a list of NodeBlocks,
51  * ElementBlocks, NodeLists, CommLists and Surfaces. [Similar to the
52  * "Composite Patter" in Design Patterns] All interface to GroupingEntities
53  * is through the Region class; clients of the IO subsystem have no direct
54  * access to the underlying GroupingEntities (other than the Region).
55  *
56  * Each GroupingEntity contains:
57  *
58  * -- name
59  *
60  * -- MeshEntities of the specified topological dimension
61  *
62  * -- Optional attributes, either global (applied to the groupingentity), or
63  * unique value(s) to be applied to each subentity.
64  *
65  * -- Data items
66  */
68  {
69  public:
70  friend class Property;
71 
72  GroupingEntity() = default;
73  GroupingEntity(DatabaseIO *io_database, const std::string &my_name, int64_t entity_count);
76 
77  virtual ~GroupingEntity();
78 
79  State get_state() const;
80 
81  DatabaseIO * get_database() const;
82  void set_database(DatabaseIO *io_database);
83  void reset_database(DatabaseIO *io_database);
84  virtual void delete_database();
85 
86  /** Return the GroupingEntity pointer of the "object" that this
87  * entity is contained in. For example, a SideBlock would
88  * return the SideSet that "owns" the SideBlock.
89  * Most GroupingEntities would return the containing Region
90  * A region would return itself(?)
91  * A NodeBlock containing the subset of nodes in a StructuredBlock
92  * would return that StructuredBlock.
93  */
94  virtual const GroupingEntity *contained_in() const;
95 
96  /** \brief Get name of entity.
97  *
98  * This short-circuits the process of getting the name via the property.
99  * \returns The same information as: entity->get_property("name").get_string()
100  */
101  const std::string &name() const { return entityName; }
102 
103  /** \brief Set the name of the entity.
104  *
105  * \param[in] new_name The new name of the entity.
106  */
107  void set_name(const std::string &new_name) { entityName = new_name; }
108 
109  /** \brief Get a generated name based on the type of the entity and the id.
110  *
111  * For example, element block 10 would return "block_10"
112  * This is the default name if no name is assigned in the mesh database.
113  * \returns The generic name.
114  */
115  std::string generic_name() const;
116 
117  /** Determine whether a name is an alias for this entity.
118  *
119  * \param[in] my_name Determine whether this name is an alias for this entity.
120  * \returns True if input name is an alias for this entity.
121  */
122  bool is_alias(const std::string &my_name) const;
123 
124  /** \brief Get list of blocks that the entities in this GroupingEntity "touch".
125  *
126  * For a SideSet, returns a list of the element blocks that the
127  * elements in the set belong to.
128  * For others, it returns an empty vector.
129  * Entries are pushed onto the "block_members" vector, so it will be
130  * appended to if it is not empty at entry to the function.
131  */
132  virtual void block_membership(std::vector<std::string> & /* block_members */) {}
133 
134  std::string get_filename() const;
135 
136  /** \brief Get the name of the particular type of entity.
137  *
138  * \returns The name of the particular type of entity.
139  */
140  virtual std::string type_string() const = 0;
141 
142  /** \brief Get a short name of the particular type of entity.
143  *
144  * \returns The short name of the particular type of entity.
145  */
146  virtual std::string short_type_string() const = 0;
147 
148  /** \brief What does this entity contain
149  *
150  * \returns The name of the thing this entity contains.
151  */
152  virtual std::string contains_string() const = 0;
153 
154  /** \brief Get the EntityType, which indicates the particular type of GroupingEntity this is.
155  *
156  * \returns The particular EntityType of this GroupingEntity.
157  */
158  virtual EntityType type() const = 0;
159 
160  // ========================================================================
161  // PROPERTIES
162  // ========================================================================
163  // Property-related information....
164  // Just forward it through to the property manager...
165  void property_add(const Property &new_prop);
166  void property_erase(const std::string &property_name);
167  bool property_exists(const std::string &property_name) const;
168  Property get_property(const std::string &property_name) const;
169  int property_describe(NameList *names) const;
170  int property_describe(Ioss::Property::Origin origin, NameList *names) const;
171  size_t property_count() const;
172  /** Add a property, or change its value if it already exists with
173  a different value */
174  void property_update(const std::string &property, int64_t value) const;
175  void property_update(const std::string &property, const std::string &value) const;
176 
177  // ========================================================================
178  // FIELDS
179  // ========================================================================
180  // Just forward these through to the field manager...
181  void field_add(Field new_field);
182  void field_erase(const std::string &field_name);
183  bool field_exists(const std::string &field_name) const;
184  Field get_field(const std::string &field_name) const;
185  const Field &get_fieldref(const std::string &field_name) const;
186  int field_describe(NameList *names) const;
187  int field_describe(Field::RoleType role, NameList *names) const;
188  size_t field_count() const;
189  size_t field_count(Field::RoleType role) const;
190 
191  // Put this fields data into 'data'.
192  // Returns number of entities for which the field was read.
193  // Assumes 'data' is large enough to hold all values.
194  int64_t get_field_data(const std::string &field_name, void *data, size_t data_size) const;
195 
196  int64_t put_field_data(const std::string &field_name, void *data, size_t data_size) const;
197 
198  // Put this fields data into the specified std::vector space.
199  // Returns number of entities for which the field was read.
200  // Resizes 'data' to size needed to hold all values.
201  template <typename T>
202  int64_t get_field_data(const std::string &field_name, std::vector<T> &data) const;
203 
204  template <typename T>
205  int64_t put_field_data(const std::string &field_name, const std::vector<T> &data) const;
206  template <typename T>
207  int64_t put_field_data(const std::string &field_name, std::vector<T> &data) const;
208 
209 #ifdef SEACAS_HAVE_KOKKOS
210  // Get and put this field's data into the specified Kokkos::View.
211  // Returns the number of entities for which the field was read.
212  // Resizes 'data' to size needed to hold all values;
213  // however, any Views that were previously created referencing the same
214  // underlying memory allocation as 'data' will remain the original size.
215  template <typename T, typename... Args>
216  int64_t get_field_data(const std::string &field_name, Kokkos::View<T *, Args...> &data) const;
217 
218  template <typename T, typename... Args>
219  int64_t get_field_data(const std::string &field_name, Kokkos::View<T **, Args...> &data) const;
220 
221  template <typename T, typename... Args>
222  int64_t put_field_data(const std::string &field_name, Kokkos::View<T *, Args...> &data) const;
223 
224  template <typename T, typename... Args>
225  int64_t put_field_data(const std::string &field_name, Kokkos::View<T **, Args...> &data) const;
226 #endif
227 
228  /** Get the number of bytes used to store the INT data type
229  *
230  * \returns The number of bytes.
231  */
233  {
234  if (database_ == nullptr || get_database()->int_byte_size_api() == 4) {
235  return Ioss::Field::INT32;
236  }
237 
238  return Ioss::Field::INT64;
239  }
240 
241  unsigned int hash() const { return hash_; }
242 
243  int64_t entity_count() const { return get_property("entity_count").get_int(); }
244 
245  protected:
246  void count_attributes() const;
247 
248  bool set_state(State new_state)
249  {
250  entityState = new_state;
251  return true;
252  }
253 
254  // Protected to give access to Region which is the only
255  // class that should delete the database. May have to make
256  // private and provide friend...
257  void really_delete_database();
258 
259  // Handle implicit properties -- These are calcuated from data stored
260  // in the grouping entity instead of having an explicit value assigned.
261  // An example would be 'element_block_count' for a region.
262  // Note that even though this is a pure virtual function, an implementation
263  // is provided to return properties that are common to all grouping entities.
264  // Derived classes should call 'GroupingEntity::get_implicit_property'
265  // if the requested property is not specific to their type.
266  virtual Property get_implicit_property(const std::string &my_name) const = 0;
267 
270 
271  virtual int64_t internal_get_field_data(const Field &field, void *data,
272  size_t data_size = 0) const = 0;
273  virtual int64_t internal_put_field_data(const Field &field, void *data,
274  size_t data_size = 0) const = 0;
275 
276  int64_t entityCount = 0;
277 
278 #if defined(IOSS_THREADSAFE)
279  mutable std::mutex m_;
280 #endif
281 
282  private:
283  void verify_field_exists(const std::string &field_name, const std::string &inout) const;
284 
285  std::string entityName{};
286 
287  DatabaseIO *database_ = nullptr;
288 
289  mutable int64_t attributeCount = 0;
291  unsigned int hash_ = 0;
292  };
293 } // namespace Ioss
294 
295 /** \brief Add a property to the entity's property manager.
296  *
297  * \param[in] new_prop The property to add.
298  */
300 {
301  properties.add(new_prop);
302 }
303 
304 /** \brief Remove a property from the entity's property manager.
305  *
306  * Assumes that the property with the given name already exists in the property manager.
307  *
308  * \param[in] property_name The name of the property to remove.
309  *
310  */
311 inline void Ioss::GroupingEntity::property_erase(const std::string &property_name)
312 {
313  properties.erase(property_name);
314 }
315 
316 /** \brief Checks if a property exists in the entity's property manager.
317  *
318  * \param[in] property_name The property to check
319  * \returns True if the property exists.
320  */
321 inline bool Ioss::GroupingEntity::property_exists(const std::string &property_name) const
322 {
323  return properties.exists(property_name);
324 }
325 
326 /** \brief Get the Property from the property manager associated with the entity.
327  *
328  * \param[in] property_name The name of the property to get
329  * \returns The property
330  *
331  */
332 inline Ioss::Property Ioss::GroupingEntity::get_property(const std::string &property_name) const
333 {
334  return properties.get(property_name);
335 }
336 
337 /** \brief Get the names of all properties in the property manager for this entity.
338  *
339  * \param[out] names All the property names in the property manager.
340  * \returns The number of properties extracted from the property manager.
341  */
343 {
344  return properties.describe(names);
345 }
346 
348  NameList * names) const
349 {
350  return properties.describe(origin, names);
351 }
352 
353 /** \brief Get the number of properties defined in the property manager for this entity.
354  *
355  * \returns The number of properties.
356  */
357 inline size_t Ioss::GroupingEntity::property_count() const { return properties.count(); }
358 
359 // ------------------------------------------------------------------------
360 
361 /** \brief Remove a field from the entity's field manager.
362  *
363  * Assumes that a field with the given name exists in the field manager.
364  *
365  * \param[in] field_name The name of the field to remove.
366  */
367 inline void Ioss::GroupingEntity::field_erase(const std::string &field_name)
368 {
369  fields.erase(field_name);
370 }
371 
372 /** \brief Checks if a field with a given name exists in the entity's field manager.
373  *
374  * \param[in] field_name The name of the field to check for.
375  * \returns True if the field exists in the entity's field manager.
376  *
377  */
378 inline bool Ioss::GroupingEntity::field_exists(const std::string &field_name) const
379 {
380  return fields.exists(field_name);
381 }
382 
383 /** \brief Get a field from the entity's field manager.
384  *
385  * \param[in] field_name The name of the field to get.
386  * \returns The field object.
387  *
388  */
389 inline Ioss::Field Ioss::GroupingEntity::get_field(const std::string &field_name) const
390 {
391  return fields.get(field_name);
392 }
393 
394 /** \brief Get a reference to a field from the entity's field manager.
395  *
396  * \param[in] field_name The name of the field to get.
397  * \returns A reference to the field object.
398  *
399  */
400 inline const Ioss::Field &Ioss::GroupingEntity::get_fieldref(const std::string &field_name) const
401 {
402  return fields.getref(field_name);
403 }
404 
405 /** \brief Get the names of all fields in the entity's field manager.
406  *
407  * \param[out] names All field names in the entity's field manager.
408  * \returns The number of fields extracted from the entity's field manager.
409  *
410  */
412 {
413  return fields.describe(names);
414 }
415 
416 /** \brief Get the names of all fields of a specified RoleType in the entity's field manager.
417  *
418  * \param[in] role The role type (MESH, ATTRIBUTE, TRANSIENT, REDUCTION, etc.)
419  * \param[out] names All field names of the specified RoleType in the entity's field manager.
420  * \returns The number of fields extracted from the entity's field manager.
421  *
422  */
424 {
425  return fields.describe(role, names);
426 }
427 
428 /** \brief Get the number of fields in the entity's field manager.
429  *
430  * \returns The number of fields in the entity's field manager.
431  */
432 inline size_t Ioss::GroupingEntity::field_count() const { return fields.count(); }
433 
434 /** \brief Read type 'T' field data from the database file into memory using a std::vector.
435  *
436  * \param[in] field_name The name of the field to read.
437  * \param[out] data The data.
438  * \returns The number of values read.
439  *
440  */
441 template <typename T>
442 int64_t Ioss::GroupingEntity::get_field_data(const std::string &field_name,
443  std::vector<T> & data) const
444 {
445  verify_field_exists(field_name, "input");
446 
447  Ioss::Field field = get_field(field_name);
449 
450  data.resize(field.raw_count() * field.raw_storage()->component_count());
451  size_t data_size = data.size() * sizeof(T);
452  auto retval = internal_get_field_data(field, data.data(), data_size);
453 
454  // At this point, transform the field if specified...
455  if (retval >= 0) {
456  field.transform(data.data());
457  }
458 
459  return retval;
460 }
461 
462 /** \brief Write type 'T' field data from memory into the database file using a std::vector.
463  *
464  * \param[in] field_name The name of the field to write.
465  * \param[in] data The data.
466  * \returns The number of values written.
467  *
468  */
469 template <typename T>
470 int64_t Ioss::GroupingEntity::put_field_data(const std::string & field_name,
471  const std::vector<T> &data) const
472 {
473  verify_field_exists(field_name, "output");
474 
475  Ioss::Field field = get_field(field_name);
477  size_t data_size = data.size() * sizeof(T);
478  if (field.has_transform()) {
479  // Need non-const data since the transform will change the users data.
480  std::vector<T> nc_data(data);
481  field.transform(nc_data.data());
482  return internal_put_field_data(field, nc_data.data(), data_size);
483  }
484 
485  T *my_data = const_cast<T *>(data.data());
486  return internal_put_field_data(field, my_data, data_size);
487 }
488 
489 template <typename T>
490 int64_t Ioss::GroupingEntity::put_field_data(const std::string &field_name,
491  std::vector<T> & data) const
492 {
493  verify_field_exists(field_name, "output");
494 
495  Ioss::Field field = get_field(field_name);
497  size_t data_size = data.size() * sizeof(T);
498  T * my_data = const_cast<T *>(data.data());
499  field.transform(my_data);
500  return internal_put_field_data(field, my_data, data_size);
501 }
502 
503 #ifdef SEACAS_HAVE_KOKKOS
504 
505 /** \brief Read field data from the database file into memory using a 1-D Kokkos:::View.
506  *
507  * \tparam T The data type.
508  * \tparam Args The other template arguments for data.
509  * \param[in] field_name The name of the field to read.
510  * \param[out] data The data.
511  * \returns The number of values read.
512  *
513  */
514 template <typename T, typename... Args>
515 int64_t Ioss::GroupingEntity::get_field_data(const std::string & field_name,
516  Kokkos::View<T *, Args...> &data) const
517 {
518  typedef Kokkos::View<T *, Args...> ViewType;
519 
520  verify_field_exists(field_name, "input");
521 
522  Ioss::Field field = get_field(field_name);
523 
524  // Resize the view
525  int new_view_size = field.raw_count() * field.raw_storage()->component_count();
526  Kokkos::resize(data, new_view_size);
527  size_t data_size = new_view_size * sizeof(T);
528 
529  // Create a host mirror view. (No memory allocation if data is in HostSpace.)
530  typename ViewType::HostMirror host_data = Kokkos::create_mirror_view(data);
531 
532  // Extract a pointer to the underlying allocated memory of the host view.
533  T *host_data_ptr = host_data.data();
534 
535  // Extract the data from disk to the underlying memory pointed to by host_data_ptr.
536  auto retval = internal_get_field_data(field, host_data_ptr, data_size);
537 
538  // At this point, transform the field if specified...
539  if (retval >= 0)
540  field.transform(host_data_ptr);
541 
542  // Copy the data to the device. (No op if data is in HostSpace.)
543  Kokkos::deep_copy(data, host_data);
544 
545  return retval;
546 }
547 
548 /** \brief Read field data from the database file into memory using a 2-D Kokkos:::View.
549  *
550  * \tparam T The data type
551  * \tparam Args The other template arguments for data.
552  * \param[in] field_name The name of the field to read.
553  * \param[out] data The data.
554  * \returns The number of values read.
555  *
556  */
557 template <typename T, typename... Args>
558 int64_t Ioss::GroupingEntity::get_field_data(const std::string & field_name,
559  Kokkos::View<T **, Args...> &data) const
560 {
561  typedef Kokkos::View<T **, Args...> ViewType;
562 
563  verify_field_exists(field_name, "input");
564 
565  Ioss::Field field = get_field(field_name);
566 
567  // Resize the view
568  int new_view_size_left = field.raw_count();
569  int new_view_size_right = field.raw_storage()->component_count();
570  Kokkos::resize(data, new_view_size_left, new_view_size_right);
571  size_t data_size = new_view_size_left * new_view_size_right * sizeof(T);
572 
573  // Create and allocate an array to hold the data temporarily.
574  // This is necessary to ensure the data is placed in the correct
575  // location in the 2-D array, avoiding incorrect placement due
576  // to Views with padded dimensions.
577  T *data_array = new T[data_size];
578 
579  // Create a host mirror view. (No memory allocation if data is in HostSpace.)
580  typename ViewType::HostMirror host_data = Kokkos::create_mirror_view(data);
581 
582  // Extract the data from disk to the underlying memory pointed to by host_data_ptr.
583  auto retval = internal_get_field_data(field, data_array, data_size);
584 
585  // At this point, transform the field if specified...
586  if (retval >= 0)
587  field.transform(data_array);
588 
589  // Copy the data to the host Mirror view.
590  // The host mirror view has the same layout as the device view.
591  // For CUDA, this will be LayoutLeft. In this case, the loop order
592  // chosen here will be slower than the reversed loop order.
593  // However, The time for this extra in-memory copy is small
594  // compared with the time to copy from disk into memory.
595  for (int i = 0; i < new_view_size_left; ++i) {
596  for (int j = 0; j < new_view_size_right; ++j) {
597  host_data(i, j) = data_array[new_view_size_right * i + j];
598  }
599  }
600 
601  // Delete the temporary array
602  delete[] data_array;
603 
604  // Copy the data to the device. (No op if data is in HostSpace.)
605  Kokkos::deep_copy(data, host_data);
606 
607  return retval;
608 }
609 
610 /** \brief Write field data from memory into the database file using a 1-D Kokkos::View.
611  *
612  * \tparam T The data type
613  * \tparam Args The other template arguments for data.
614  * \param[in] field_name The name of the field to write.
615  * \param[in] data The data.
616  * \returns The number of values written.
617  *
618  */
619 template <typename T, typename... Args>
620 int64_t Ioss::GroupingEntity::put_field_data(const std::string & field_name,
621  Kokkos::View<T *, Args...> &data) const
622 {
623  typedef Kokkos::View<T *, Args...> ViewType;
624 
625  verify_field_exists(field_name, "output");
626 
627  Ioss::Field field = get_field(field_name);
628  size_t data_size = field.raw_count() * field.raw_storage()->component_count() * sizeof(T);
629 
630  // Create a host mirror view. (No memory allocation if data is in HostSpace.)
631  typename ViewType::HostMirror host_data = Kokkos::create_mirror_view(data);
632 
633  // Copy the data to the host. (No op if data is in HostSpace.)
634  Kokkos::deep_copy(host_data, data);
635 
636  // Extract a pointer to the underlying allocated memory of the host view.
637  T *host_data_ptr = host_data.data();
638 
639  // Transform the field
640  field.transform(host_data_ptr);
641 
642  // Copy the data to disk from the underlying memory pointed to by host_data_ptr.
643  return internal_put_field_data(field, host_data_ptr, data_size);
644 }
645 
646 /** \brief Write field data from memory into the database file using a 2-D Kokkos::View.
647  *
648  * \tparam T The data type
649  * \tparam Args The other template arguments for data.
650  * \param[in] field_name The name of the field to write.
651  * \param[in] data The data.
652  * \returns The number of values written.
653  *
654  */
655 template <typename T, typename... Args>
656 int64_t Ioss::GroupingEntity::put_field_data(const std::string & field_name,
657  Kokkos::View<T **, Args...> &data) const
658 {
659  typedef Kokkos::View<T **, Args...> ViewType;
660 
661  verify_field_exists(field_name, "output");
662 
663  Ioss::Field field = get_field(field_name);
664 
665  int view_size_left = data.extent(0);
666  int view_size_right = data.extent(1);
667  size_t data_size = field.raw_count() * field.raw_storage()->component_count() * sizeof(T);
668 
669  if (view_size_left * view_size_right * sizeof(T) != data_size) {
670  std::ostringstream errmsg;
671  errmsg << "\nERROR: View dimensions are inconsistent with field raw count or raw storage "
672  "component count"
673  << "for field" << field_name << "\n\n";
674  IOSS_ERROR(errmsg);
675  }
676 
677  // Create a host mirror view. (No memory allocation if data is in HostSpace.)
678  typename ViewType::HostMirror host_data = Kokkos::create_mirror_view(data);
679 
680  // Copy the data to the host. (No op if data is in HostSpace.)
681  Kokkos::deep_copy(host_data, data);
682 
683  // Create and allocate an array to hold the data temporarily.
684  // This is necessary to ensure the data is taken from the correct
685  // location in the 2-D array, avoiding incorrect location due
686  // to Views with padded dimensions.
687  T *data_array = new T[data_size];
688 
689  // Copy the data from the host Mirror view.
690  // The host mirror view has the same layout as the device view.
691  // For CUDA, this will be LayoutLeft. In this case, the loop order
692  // chosen here will be slower than the reversed loop order.
693  // However, The time for this extra in-memory copy is small
694  // compared with the time to copy to disk from memory.
695  for (int i = 0; i < view_size_left; ++i) {
696  for (int j = 0; j < view_size_right; ++j) {
697  data_array[view_size_right * i + j] = host_data(i, j);
698  }
699  }
700 
701  // Transform the field
702  field.transform(data_array);
703 
704  // Copy the data to disk from the underlying memory pointed to by data_array.
705  auto retval = internal_put_field_data(field, data_array, data_size);
706 
707  // Delete the temporary array
708  delete[] data_array;
709 
710  return retval;
711 }
712 #endif
713 
714 #endif
Ioss::GroupingEntity::is_alias
bool is_alias(const std::string &my_name) const
Definition: Ioss_GroupingEntity.C:92
Ioss::NameList
std::vector< std::string > NameList
Definition: Ioss_CodeTypes.h:27
Ioss::Field
Holds metadata for bulk data associated with a GroupingEntity.
Definition: Ioss_Field.h:22
Ioss_Property.h
Ioss::GroupingEntity::really_delete_database
void really_delete_database()
Definition: Ioss_GroupingEntity.C:69
Ioss::GroupingEntity::contains_string
virtual std::string contains_string() const =0
What does this entity contain.
Ioss::GroupingEntity::set_state
bool set_state(State new_state)
Definition: Ioss_GroupingEntity.h:248
Ioss::GroupingEntity::get_fieldref
const Field & get_fieldref(const std::string &field_name) const
Get a reference to a field from the entity's field manager.
Definition: Ioss_GroupingEntity.h:400
Ioss::GroupingEntity::entityState
State entityState
Definition: Ioss_GroupingEntity.h:290
Ioss::GroupingEntity::contained_in
virtual const GroupingEntity * contained_in() const
Definition: Ioss_GroupingEntity.C:75
Ioss::GroupingEntity::type
virtual EntityType type() const =0
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Ioss::Field::has_transform
bool has_transform() const
Definition: Ioss_Field.h:146
Ioss::FieldManager
A collection of Ioss::Field objects.
Definition: Ioss_FieldManager.h:26
Ioss::Field::get_field_type
static Ioss::Field::BasicType get_field_type(char)
Definition: Ioss_Field.h:38
Ioss
The main namespace for the Ioss library.
Definition: Ioad_DatabaseIO.C:40
Ioss::State
State
Access states for a database.
Definition: Ioss_State.h:16
Ioss::GroupingEntity::properties
PropertyManager properties
Definition: Ioss_GroupingEntity.h:268
Ioss::GroupingEntity::hash_
unsigned int hash_
Definition: Ioss_GroupingEntity.h:291
Ioss::GroupingEntity::property_add
void property_add(const Property &new_prop)
Add a property to the entity's property manager.
Definition: Ioss_GroupingEntity.h:299
Ioss::Field::check_type
void check_type(BasicType the_type) const
Definition: Ioss_Field.C:149
Ioss::GroupingEntity::internal_put_field_data
virtual int64_t internal_put_field_data(const Field &field, void *data, size_t data_size=0) const =0
Ioss::Field::transform
bool transform(void *data)
Definition: Ioss_Field.C:228
Ioss::PropertyManager
A collection of Ioss::Property objects.
Definition: Ioss_PropertyManager.h:24
Ioss::GroupingEntity::get_implicit_property
virtual Property get_implicit_property(const std::string &my_name) const =0
Calculate and get an implicit property.
Definition: Ioss_GroupingEntity.C:159
Ioss::Field::INT64
@ INT64
Definition: Ioss_Field.h:32
Ioss::GroupingEntity::set_database
void set_database(DatabaseIO *io_database)
Definition: Ioss_GroupingEntity.C:118
Ioss::EntityType
EntityType
The particular type of GroupingEntity.
Definition: Ioss_EntityType.h:13
Ioss::GroupingEntity::field_int_type
Ioss::Field::BasicType field_int_type() const
Definition: Ioss_GroupingEntity.h:232
Ioss_EntityType.h
Ioss::GroupingEntity::get_database
DatabaseIO * get_database() const
Definition: Ioss_GroupingEntity.C:98
Ioss::GroupingEntity::field_exists
bool field_exists(const std::string &field_name) const
Checks if a field with a given name exists in the entity's field manager.
Definition: Ioss_GroupingEntity.h:378
Ioss::GroupingEntity::delete_database
virtual void delete_database()
Definition: Ioss_GroupingEntity.C:67
Ioss::GroupingEntity::block_membership
virtual void block_membership(std::vector< std::string > &)
Get list of blocks that the entities in this GroupingEntity "touch".
Definition: Ioss_GroupingEntity.h:132
Ioss::GroupingEntity::verify_field_exists
void verify_field_exists(const std::string &field_name, const std::string &inout) const
Definition: Ioss_GroupingEntity.C:291
Ioss::GroupingEntity::generic_name
std::string generic_name() const
Get a generated name based on the type of the entity and the id.
Definition: Ioss_GroupingEntity.C:83
Ioss::GroupingEntity::type_string
virtual std::string type_string() const =0
Get the name of the particular type of entity.
Ioss::GroupingEntity::field_describe
int field_describe(NameList *names) const
Get the names of all fields in the entity's field manager.
Definition: Ioss_GroupingEntity.h:411
Ioss::GroupingEntity::set_name
void set_name(const std::string &new_name)
Set the name of the entity.
Definition: Ioss_GroupingEntity.h:107
Ioss::GroupingEntity::get_filename
std::string get_filename() const
Get the file name associated with the database containing this entity.
Definition: Ioss_GroupingEntity.C:108
Ioss::DatabaseIO
An input or output Database.
Definition: Ioss_DatabaseIO.h:59
Ioss::GroupingEntity::attributeCount
int64_t attributeCount
Definition: Ioss_GroupingEntity.h:289
IOSS_ERROR
#define IOSS_ERROR(errmsg)
Definition: Ioss_Utils.h:32
Ioss::GroupingEntity::property_count
size_t property_count() const
Get the number of properties defined in the property manager for this entity.
Definition: Ioss_GroupingEntity.h:357
Ioss::PropertyManager::add
void add(const Property &new_prop)
Add a property to the property manager.
Definition: Ioss_PropertyManager.C:36
Ioss_State.h
Ioss::GroupingEntity::property_erase
void property_erase(const std::string &property_name)
Remove a property from the entity's property manager.
Definition: Ioss_GroupingEntity.h:311
Ioss_Field.h
Ioss::GroupingEntity::short_type_string
virtual std::string short_type_string() const =0
Get a short name of the particular type of entity.
Ioss::GroupingEntity::field_erase
void field_erase(const std::string &field_name)
Remove a field from the entity's field manager.
Definition: Ioss_GroupingEntity.h:367
Ioss::GroupingEntity::get_field_data
int64_t get_field_data(const std::string &field_name, void *data, size_t data_size) const
Read field data from the database file into memory using a pointer.
Definition: Ioss_GroupingEntity.C:220
Ioss::GroupingEntity::property_describe
int property_describe(NameList *names) const
Get the names of all properties in the property manager for this entity.
Definition: Ioss_GroupingEntity.h:342
Ioss::GroupingEntity::hash
unsigned int hash() const
Definition: Ioss_GroupingEntity.h:241
Ioss::GroupingEntity::property_update
void property_update(const std::string &property, int64_t value) const
Definition: Ioss_GroupingEntity.C:303
Ioss_PropertyManager.h
Ioss::GroupingEntity::database_
DatabaseIO * database_
Definition: Ioss_GroupingEntity.h:287
Ioss::Property::get_int
int64_t get_int() const
Get the property value if it is of type INTEGER.
Definition: Ioss_Property.C:235
Ioss::Field::raw_count
size_t raw_count() const
Definition: Ioss_Field.h:116
Ioss::GroupingEntity::entityName
std::string entityName
Definition: Ioss_GroupingEntity.h:285
Ioss::GroupingEntity::get_field
Field get_field(const std::string &field_name) const
Get a field from the entity's field manager.
Definition: Ioss_GroupingEntity.h:389
Ioss_FieldManager.h
Ioss::Field::INT32
@ INT32
Definition: Ioss_Field.h:31
Ioss::GroupingEntity::get_property
Property get_property(const std::string &property_name) const
Get the Property from the property manager associated with the entity.
Definition: Ioss_GroupingEntity.h:332
Ioss::Property::Origin
Origin
Definition: Ioss_Property.h:27
anonymous_namespace{cth_pressure_map.C}::data
std::vector< char > data
Definition: cth_pressure_map.C:48
Ioss::GroupingEntity::name
const std::string & name() const
Get name of entity.
Definition: Ioss_GroupingEntity.h:101
Ioss::GroupingEntity::property_exists
bool property_exists(const std::string &property_name) const
Checks if a property exists in the entity's property manager.
Definition: Ioss_GroupingEntity.h:321
Ioss::GroupingEntity::~GroupingEntity
virtual ~GroupingEntity()
Definition: Ioss_GroupingEntity.C:59
Ioss::GroupingEntity::entityCount
int64_t entityCount
Definition: Ioss_GroupingEntity.h:276
Ioss::Field::raw_storage
const VariableType * raw_storage() const
Definition: Ioss_Field.h:113
Ioss::GroupingEntity::field_count
size_t field_count() const
Get the number of fields in the entity's field manager.
Definition: Ioss_GroupingEntity.h:432
Ioss::GroupingEntity::reset_database
void reset_database(DatabaseIO *io_database)
Definition: Ioss_GroupingEntity.C:125
Ioss::GroupingEntity::GroupingEntity
GroupingEntity()=default
Ioss::GroupingEntity::field_add
void field_add(Field new_field)
Add a field to the entity's field manager.
Definition: Ioss_GroupingEntity.C:182
Ioss::Field::BasicType
BasicType
The basic data type held in the field.
Definition: Ioss_Field.h:26
Ioss::STATE_CLOSED
@ STATE_CLOSED
Definition: Ioss_State.h:23
Ioss::Field::RoleType
RoleType
Definition: Ioss_Field.h:49
Ioss::GroupingEntity::count_attributes
void count_attributes() const
Definition: Ioss_GroupingEntity.C:268
Ioss::GroupingEntity::entity_count
int64_t entity_count() const
Definition: Ioss_GroupingEntity.h:243
Ioss::Property
A named value that has a known type.
Definition: Ioss_Property.h:24
Ioss::GroupingEntity::put_field_data
int64_t put_field_data(const std::string &field_name, void *data, size_t data_size) const
Write field data from memory into the database file using a pointer.
Definition: Ioss_GroupingEntity.C:244
Ioss::GroupingEntity
Base class for all 'grouping' entities. The following derived classes are typical:
Definition: Ioss_GroupingEntity.h:68
Ioss_CodeTypes.h
Ioss::GroupingEntity::operator=
GroupingEntity & operator=(const GroupingEntity &)=delete
Ioss::GroupingEntity::get_state
State get_state() const
Get the current Ioss::State of the entity.
Definition: Ioss_GroupingEntity.C:148
Ioss::GroupingEntity::fields
FieldManager fields
Definition: Ioss_GroupingEntity.h:269
Ioss_VariableType.h
Ioss::GroupingEntity::internal_get_field_data
virtual int64_t internal_get_field_data(const Field &field, void *data, size_t data_size=0) const =0
Ioss::VariableType::component_count
int component_count() const
Definition: Ioss_VariableType.h:103
Ioss_DatabaseIO.h