IOSS 2.0
Loading...
Searching...
No Matches
Ioss_NodeBlock.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_BoundingBox.h"
10#include "Ioss_EntityBlock.h"
11#include "Ioss_EntityType.h" // for EntityType, etc
12#include "Ioss_Property.h" // for Property
13#include <cstddef> // for size_t
14#include <cstdint> // for int64_t
15#include <string> // for string
16
17#include "Ioss_GroupingEntity.h"
19#include "ioss_export.h"
20
21namespace Ioss {
22 class DatabaseIO;
23} // namespace Ioss
24namespace Ioss {
25 class Field;
26} // namespace Ioss
27
28namespace Ioss {
29
30 /** \brief A collection of all nodes in the region.
31 */
32 class IOSS_EXPORT NodeBlock : public EntityBlock
33 {
34 public:
35 NodeBlock(DatabaseIO *io_database, const std::string &my_name, int64_t node_count,
36 int64_t degrees_of_freedom);
37
38 NodeBlock(const NodeBlock &other);
39
40 IOSS_NODISCARD std::string type_string() const override { return "NodeBlock"; }
41 IOSS_NODISCARD std::string short_type_string() const override { return "nodeblock"; }
42 IOSS_NODISCARD std::string contains_string() const override { return "Node"; }
43 IOSS_NODISCARD EntityType type() const override { return NODEBLOCK; }
44
46 {
47 return properties.exists("IOSS_INTERNAL_CONTAINED_IN");
48 }
49
51 {
52 if (properties.exists("IOSS_INTERNAL_CONTAINED_IN")) {
53 auto *ge = properties.get("IOSS_INTERNAL_CONTAINED_IN").get_pointer();
54 return static_cast<const GroupingEntity *>(ge);
55 }
56 return GroupingEntity::contained_in();
57 }
58
59 // Handle implicit properties -- These are calculated from data stored
60 // in the grouping entity instead of having an explicit value assigned.
61 // An example would be 'element_block_count' for a region.
62 IOSS_NODISCARD Property get_implicit_property(const std::string &my_name) const override;
63
64 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box() const;
65 IOSS_NODISCARD bool operator!=(const Ioss::NodeBlock &rhs) const;
66 IOSS_NODISCARD bool operator==(const Ioss::NodeBlock &rhs) const;
67 IOSS_NODISCARD bool equal(const Ioss::NodeBlock &rhs) const;
68
69 protected:
70 int64_t internal_get_field_data(const Field &field, void *data,
71 size_t data_size) const override;
72
73 int64_t internal_put_field_data(const Field &field, void *data,
74 size_t data_size) const override;
75
76 int64_t internal_get_zc_field_data(const Field &field, void **data,
77 size_t *data_size) const override;
78 };
79} // namespace Ioss
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:54
An input or output Database.
Definition Ioss_DatabaseIO.h:63
Base class for all 'block'-type grouping entities, which means all members of the block are similar o...
Definition Ioss_EntityBlock.h:38
Holds metadata for bulk data associated with a GroupingEntity.
Definition Ioss_Field.h:25
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
IOSS_NODISCARD std::string contains_string() const override
What does this entity contain.
Definition Ioss_NodeBlock.h:42
IOSS_NODISCARD bool is_nonglobal_nodeblock() const
Definition Ioss_NodeBlock.h:45
IOSS_NODISCARD const GroupingEntity * contained_in() const override
Definition Ioss_NodeBlock.h:50
IOSS_NODISCARD std::string short_type_string() const override
Get a short name of the particular type of entity.
Definition Ioss_NodeBlock.h:41
IOSS_NODISCARD EntityType type() const override
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Definition Ioss_NodeBlock.h:43
NodeBlock(const NodeBlock &other)
IOSS_NODISCARD std::string type_string() const override
Get the name of the particular type of entity.
Definition Ioss_NodeBlock.h:40
A named value that has a known type.
Definition Ioss_Property.h:27
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
EntityType
The particular type of GroupingEntity.
Definition Ioss_EntityType.h:12
@ NODEBLOCK
Definition Ioss_EntityType.h:13
Definition Ioss_BoundingBox.h:13