IOSS  2.0
Ioss_NodeBlock.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_NodeBlock_h
8 #define IOSS_Ioss_NodeBlock_h
9 
10 #include "Ioss_EntityType.h" // for EntityType, etc
11 #include "Ioss_Property.h" // for Property
12 #include <Ioss_EntityBlock.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 } // namespace Ioss
19 namespace Ioss {
20  class Field;
21 } // namespace Ioss
22 
23 namespace Ioss {
24 
25  /** \brief A collection of all nodes in the region.
26  */
27  class NodeBlock : public EntityBlock
28  {
29  public:
30  NodeBlock(DatabaseIO *io_database, const std::string &my_name, int64_t node_count,
31  int64_t degrees_of_freedom);
32 
33  NodeBlock(const NodeBlock &);
34 
35  ~NodeBlock() override;
36 
37  std::string type_string() const override { return "NodeBlock"; }
38  std::string short_type_string() const override { return "nodeblock"; }
39  std::string contains_string() const override { return "Node"; }
40  EntityType type() const override { return NODEBLOCK; }
41 
42  bool is_nonglobal_nodeblock() const { return properties.exists("IOSS_INTERNAL_CONTAINED_IN"); }
43 
44  const GroupingEntity *contained_in() const override
45  {
46  if (properties.exists("IOSS_INTERNAL_CONTAINED_IN")) {
47  auto ge = properties.get("IOSS_INTERNAL_CONTAINED_IN").get_pointer();
48  return static_cast<const GroupingEntity *>(ge);
49  }
50  else {
52  }
53  }
54 
55  // Handle implicit properties -- These are calcuated from data stored
56  // in the grouping entity instead of having an explicit value assigned.
57  // An example would be 'element_block_count' for a region.
58  Property get_implicit_property(const std::string &my_name) const override;
59 
60  protected:
61  int64_t internal_get_field_data(const Field &field, void *data,
62  size_t data_size) const override;
63 
64  int64_t internal_put_field_data(const Field &field, void *data,
65  size_t data_size) const override;
66  };
67 } // namespace Ioss
68 #endif
Ioss::NodeBlock::type
EntityType type() const override
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Definition: Ioss_NodeBlock.h:40
Ioss::NodeBlock::contained_in
const GroupingEntity * contained_in() const override
Definition: Ioss_NodeBlock.h:44
Ioss::Field
Holds metadata for bulk data associated with a GroupingEntity.
Definition: Ioss_Field.h:22
Ioss_Property.h
Ioss::PropertyManager::exists
bool exists(const std::string &property_name) const
Checks if a property exists in the database.
Definition: Ioss_PropertyManager.C:51
Ioss::GroupingEntity::contained_in
virtual const GroupingEntity * contained_in() const
Definition: Ioss_GroupingEntity.C:75
Ioss::PropertyManager::get
Property get(const std::string &property_name) const
Get a property object from the property manager.
Definition: Ioss_PropertyManager.C:62
Ioss::NodeBlock::~NodeBlock
~NodeBlock() override
Ioss
The main namespace for the Ioss library.
Definition: Ioad_DatabaseIO.C:40
Ioss::NodeBlock::internal_get_field_data
int64_t internal_get_field_data(const Field &field, void *data, size_t data_size) const override
Definition: Ioss_NodeBlock.C:84
Ioss::GroupingEntity::properties
PropertyManager properties
Definition: Ioss_GroupingEntity.h:268
Ioss::EntityType
EntityType
The particular type of GroupingEntity.
Definition: Ioss_EntityType.h:13
Ioss_EntityType.h
Ioss::Property::get_pointer
void * get_pointer() const
Get the property value if it is of type POINTER.
Definition: Ioss_Property.C:263
Ioss::NodeBlock::is_nonglobal_nodeblock
bool is_nonglobal_nodeblock() const
Definition: Ioss_NodeBlock.h:42
Ioss::DatabaseIO
An input or output Database.
Definition: Ioss_DatabaseIO.h:59
Ioss::NodeBlock::NodeBlock
NodeBlock(DatabaseIO *io_database, const std::string &my_name, int64_t node_count, int64_t degrees_of_freedom)
Create a node block.
Definition: Ioss_NodeBlock.C:26
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::NODEBLOCK
@ NODEBLOCK
Definition: Ioss_EntityType.h:14
Ioss::NodeBlock::short_type_string
std::string short_type_string() const override
Get a short name of the particular type of entity.
Definition: Ioss_NodeBlock.h:38
Ioss::NodeBlock::internal_put_field_data
int64_t internal_put_field_data(const Field &field, void *data, size_t data_size) const override
Definition: Ioss_NodeBlock.C:90
Ioss::NodeBlock::type_string
std::string type_string() const override
Get the name of the particular type of entity.
Definition: Ioss_NodeBlock.h:37
Ioss::NodeBlock::contains_string
std::string contains_string() const override
What does this entity contain.
Definition: Ioss_NodeBlock.h:39
Ioss::NodeBlock::get_implicit_property
Property get_implicit_property(const std::string &my_name) const override
Calculate and get an implicit property.
Definition: Ioss_NodeBlock.C:79
anonymous_namespace{cth_pressure_map.C}::data
std::vector< char > data
Definition: cth_pressure_map.C:48
Ioss::NodeBlock
A collection of all nodes in the region.
Definition: Ioss_NodeBlock.h:28
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_EntityBlock.h