IOSS  2.0
Ioss_Assembly.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_Assembly_h
8 #define IOSS_Ioss_Assembly_h
9 
10 #include "Ioss_EntityType.h" // for EntityType, etc
11 #include "Ioss_Property.h" // for Property
12 #include <Ioss_GroupingEntity.h>
13 #include <cstddef> // for size_t
14 #include <cstdint> // for int64_t
15 #include <string> // for string
16 namespace Ioss {
17  class DatabaseIO;
18  class Field;
19 } // namespace Ioss
20 
21 namespace Ioss {
22 
23  using EntityContainer = std::vector<const Ioss::GroupingEntity *>;
24 
25  /** \brief A homogeneous collection of other GroupingEntities.
26  */
27  class Assembly : public GroupingEntity
28  {
29  public:
30  Assembly() = default; // Used for template typing only
31  ~Assembly() = default;
32  Assembly(const Assembly &);
33 
34  Assembly(DatabaseIO *io_database, const std::string &my_name);
35 
36  std::string type_string() const override { return "Assembly"; }
37  std::string short_type_string() const override { return "assembly"; }
38  std::string contains_string() const override
39  {
40  return m_members.empty() ? "<EMPTY>" : m_members[0]->type_string();
41  }
42  EntityType type() const override { return ASSEMBLY; }
43 
44  EntityType get_member_type() const { return m_type; }
45 
46  bool add(const GroupingEntity *member);
47  bool remove(const GroupingEntity *member);
48  const EntityContainer &get_members() const;
49  const GroupingEntity * get_member(const std::string &my_name) const;
50  void remove_members();
51  size_t member_count() const { return m_members.size(); }
52 
53  // Handle implicit properties -- These are calcuated from data stored
54  // in the grouping entity instead of having an explicit value assigned.
55  // An example would be 'element_block_count' for a region.
56  Property get_implicit_property(const std::string &my_name) const override;
57 
58  protected:
59  int64_t internal_get_field_data(const Field &field, void *data,
60  size_t data_size) const override;
61 
62  int64_t internal_put_field_data(const Field &field, void *data,
63  size_t data_size) const override;
64 
65  private:
68  };
69 } // namespace Ioss
70 #endif
Ioss::Assembly::internal_get_field_data
int64_t internal_get_field_data(const Field &field, void *data, size_t data_size) const override
Definition: Ioss_Assembly.C:141
Ioss::Assembly::remove_members
void remove_members()
Definition: Ioss_Assembly.C:122
Ioss::Field
Holds metadata for bulk data associated with a GroupingEntity.
Definition: Ioss_Field.h:22
Ioss_Property.h
Ioss::Assembly::get_member
const GroupingEntity * get_member(const std::string &my_name) const
Definition: Ioss_Assembly.C:98
Ioss::Assembly::type_string
std::string type_string() const override
Get the name of the particular type of entity.
Definition: Ioss_Assembly.h:36
Ioss::Assembly
A homogeneous collection of other GroupingEntities.
Definition: Ioss_Assembly.h:28
Ioss::Assembly::get_members
const EntityContainer & get_members() const
Definition: Ioss_Assembly.C:96
Ioss::Assembly::m_type
EntityType m_type
Definition: Ioss_Assembly.h:67
Ioss
The main namespace for the Ioss library.
Definition: Ioad_DatabaseIO.C:40
Ioss::Assembly::member_count
size_t member_count() const
Definition: Ioss_Assembly.h:51
Ioss::Assembly::Assembly
Assembly()=default
Ioss::Assembly::get_implicit_property
Property get_implicit_property(const std::string &my_name) const override
Calculate and get an implicit property.
Definition: Ioss_Assembly.C:153
Ioss::INVALID_TYPE
@ INVALID_TYPE
Definition: Ioss_EntityType.h:31
Ioss::Assembly::m_members
EntityContainer m_members
Definition: Ioss_Assembly.h:66
Ioss::Assembly::type
EntityType type() const override
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Definition: Ioss_Assembly.h:42
Ioss::EntityType
EntityType
The particular type of GroupingEntity.
Definition: Ioss_EntityType.h:13
Ioss_EntityType.h
Ioss::Assembly::contains_string
std::string contains_string() const override
What does this entity contain.
Definition: Ioss_Assembly.h:38
Ioss::DatabaseIO
An input or output Database.
Definition: Ioss_DatabaseIO.h:59
Ioss::Assembly::remove
bool remove(const GroupingEntity *member)
Definition: Ioss_Assembly.C:129
Ioss::Assembly::short_type_string
std::string short_type_string() const override
Get a short name of the particular type of entity.
Definition: Ioss_Assembly.h:37
Ioss_GroupingEntity.h
Ioss::Assembly::~Assembly
~Assembly()=default
anonymous_namespace{cth_pressure_map.C}::data
std::vector< char > data
Definition: cth_pressure_map.C:48
Ioss::ASSEMBLY
@ ASSEMBLY
Definition: Ioss_EntityType.h:29
Ioss::Assembly::get_member_type
EntityType get_member_type() const
Definition: Ioss_Assembly.h:44
Ioss::Assembly::add
bool add(const GroupingEntity *member)
Definition: Ioss_Assembly.C:111
Ioss::EntityContainer
std::vector< const Ioss::GroupingEntity * > EntityContainer
Definition: Ioss_Assembly.h:23
Ioss::Property
A named value that has a known type.
Definition: Ioss_Property.h:24
Ioss::GroupingEntity
Base class for all 'grouping' entities. The following derived classes are typical:
Definition: Ioss_GroupingEntity.h:68
Ioss::Assembly::internal_put_field_data
int64_t internal_put_field_data(const Field &field, void *data, size_t data_size) const override
Definition: Ioss_Assembly.C:147