IOSS  2.0
Ioss_SideBlock.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_SideBlock_h
8 #define IOSS_Ioss_SideBlock_h
9 
10 #include <Ioss_ElementBlock.h>
11 #include <Ioss_EntityBlock.h> // for EntityBlock
12 #include <Ioss_EntityType.h> // for EntityType, etc
13 #include <Ioss_Property.h> // for Property
14 #include <Ioss_SideSet.h>
15 #include <cstddef> // for size_t
16 #include <cstdint> // for int64_t
17 #include <string> // for string
18 #include <vector> // for vector
19 namespace Ioss {
20  class DatabaseIO;
21 } // namespace Ioss
22 namespace Ioss {
23  class ElementTopology;
24 } // namespace Ioss
25 namespace Ioss {
26  class Field;
27 } // namespace Ioss
28 
29 namespace Ioss {
30 
31  /** \brief A collection of element sides having the same topology.
32  */
33  class SideBlock : public EntityBlock
34  {
35  public:
36  friend class SideSet;
37 
38  SideBlock(DatabaseIO *io_database, const std::string &my_name, const std::string &side_type,
39  const std::string &element_type, size_t side_count);
40 
41  SideBlock(const SideBlock &other);
42 
43  std::string type_string() const override { return "SideBlock"; }
44  std::string short_type_string() const override { return "sideblock"; }
45  std::string contains_string() const override { return "Element/Side pair"; }
46  EntityType type() const override { return SIDEBLOCK; }
47 
48  const SideSet * owner() const { return owner_; }
49  const Ioss::GroupingEntity *contained_in() const override { return owner_; }
50 
51  void block_membership(std::vector<std::string> &block_members) override;
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  // For faceblock, edgeblock, if they are split by element block, then this
59  // will be non-nullptr and is a pointer to the parent element block for this
60  // faceblock or edgeblock. Has no meaning for other EntityBlock types or split
61  // types.
63  {
64  return dynamic_cast<const ElementBlock *>(parentBlock_);
65  }
66 
67  void set_parent_element_block(const ElementBlock *element_block)
68  {
69  parentBlock_ = element_block;
70  }
71 
72  const EntityBlock *parent_block() const { return parentBlock_; }
73  void set_parent_block(const EntityBlock *block) { parentBlock_ = block; }
74 
75  // Describes the contained entities element block topology
77 
78  // For faceblock, edgeblock, return whether the surface is applied
79  // to the same face/edge for all elements in the surface. If not,
80  // return 0; otherwise return the consistent face number.
81  int get_consistent_side_number() const;
83 
84  protected:
85  int64_t internal_get_field_data(const Field &field, void *data,
86  size_t data_size) const override;
87 
88  int64_t internal_put_field_data(const Field &field, void *data,
89  size_t data_size) const override;
90 
91  private:
92  const SideSet * owner_{nullptr};
93  ElementTopology * parentTopology_{nullptr}; // Topology of parent element (if any)
94  const EntityBlock *parentBlock_{nullptr};
95 
96  // Pointer to the SideSet (if any) that contains this side block.
97  std::vector<std::string> blockMembership{}; // What element blocks do the
98  // elements in this sideset belong to.
99  mutable int consistentSideNumber{-1};
100  };
101 } // namespace Ioss
102 #endif
Ioss::SideBlock::internal_get_field_data
int64_t internal_get_field_data(const Field &field, void *data, size_t data_size) const override
Definition: Ioss_SideBlock.C:60
Ioss::SideBlock::parent_element_topology
const ElementTopology * parent_element_topology() const
Definition: Ioss_SideBlock.h:76
Ioss::Field
Holds metadata for bulk data associated with a GroupingEntity.
Definition: Ioss_Field.h:22
Ioss_Property.h
Ioss::SideBlock::consistentSideNumber
int consistentSideNumber
Definition: Ioss_SideBlock.h:99
Ioss::SideBlock::contains_string
std::string contains_string() const override
What does this entity contain.
Definition: Ioss_SideBlock.h:45
Ioss
The main namespace for the Ioss library.
Definition: Ioad_DatabaseIO.C:40
Ioss::SideBlock::get_implicit_property
Property get_implicit_property(const std::string &my_name) const override
Calculate and get an implicit property.
Definition: Ioss_SideBlock.C:72
Ioss::SideBlock::parent_block
const EntityBlock * parent_block() const
Definition: Ioss_SideBlock.h:72
Ioss::SideBlock::set_consistent_side_number
void set_consistent_side_number(int side)
Definition: Ioss_SideBlock.h:82
Ioss::SideBlock::parent_element_block
const ElementBlock * parent_element_block() const
Definition: Ioss_SideBlock.h:62
Ioss::SideBlock::type_string
std::string type_string() const override
Get the name of the particular type of entity.
Definition: Ioss_SideBlock.h:43
Ioss_ElementBlock.h
Ioss_SideSet.h
Ioss::EntityType
EntityType
The particular type of GroupingEntity.
Definition: Ioss_EntityType.h:13
Ioss::SideBlock::short_type_string
std::string short_type_string() const override
Get a short name of the particular type of entity.
Definition: Ioss_SideBlock.h:44
Ioss_EntityType.h
Ioss::SideBlock::parentBlock_
const EntityBlock * parentBlock_
Definition: Ioss_SideBlock.h:94
Ioss::DatabaseIO
An input or output Database.
Definition: Ioss_DatabaseIO.h:59
Ioss::SideBlock
A collection of element sides having the same topology.
Definition: Ioss_SideBlock.h:34
Ioss::SideBlock::owner_
const SideSet * owner_
Definition: Ioss_SideBlock.h:92
Ioss::EntityBlock
Base class for all 'block'-type grouping entities, which means all members of the block are similar o...
Definition: Ioss_EntityBlock.h:36
Ioss::SideBlock::contained_in
const Ioss::GroupingEntity * contained_in() const override
Definition: Ioss_SideBlock.h:49
Ioss::ElementBlock
A collection of elements having the same topology.
Definition: Ioss_ElementBlock.h:23
Ioss::ElementTopology
Represents an element topology.
Definition: Ioss_ElementTopology.h:47
Ioss::SideBlock::SideBlock
SideBlock(DatabaseIO *io_database, const std::string &my_name, const std::string &side_type, const std::string &element_type, size_t side_count)
Create a side block.
Definition: Ioss_SideBlock.C:32
Ioss::SideBlock::blockMembership
std::vector< std::string > blockMembership
Definition: Ioss_SideBlock.h:97
Ioss::SideBlock::block_membership
void block_membership(std::vector< std::string > &block_members) override
Get list of blocks that the entities in this GroupingEntity "touch".
Definition: Ioss_SideBlock.C:89
Ioss::SideBlock::internal_put_field_data
int64_t internal_put_field_data(const Field &field, void *data, size_t data_size) const override
Definition: Ioss_SideBlock.C:66
Ioss::SIDEBLOCK
@ SIDEBLOCK
Definition: Ioss_EntityType.h:25
anonymous_namespace{cth_pressure_map.C}::data
std::vector< char > data
Definition: cth_pressure_map.C:48
Ioss::SideBlock::type
EntityType type() const override
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Definition: Ioss_SideBlock.h:46
Ioss::SideBlock::owner
const SideSet * owner() const
Definition: Ioss_SideBlock.h:48
Ioss::SideBlock::parentTopology_
ElementTopology * parentTopology_
Definition: Ioss_SideBlock.h:93
Ioss::SideBlock::set_parent_block
void set_parent_block(const EntityBlock *block)
Definition: Ioss_SideBlock.h:73
Ioss::SideBlock::set_parent_element_block
void set_parent_element_block(const ElementBlock *element_block)
Definition: Ioss_SideBlock.h:67
Ioss::Property
A named value that has a known type.
Definition: Ioss_Property.h:24
Ioss::SideSet
A collection of element sides.
Definition: Ioss_SideSet.h:28
Ioss::GroupingEntity
Base class for all 'grouping' entities. The following derived classes are typical:
Definition: Ioss_GroupingEntity.h:68
Ioss_EntityBlock.h
Ioss::SideBlock::get_consistent_side_number
int get_consistent_side_number() const
Definition: Ioss_SideBlock.C:122