IOSS 2.0
Loading...
Searching...
No Matches
Ioss_ElementBlock.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_CodeTypes.h"
11#include "Ioss_EntityBlock.h"
12#include "Ioss_Property.h"
13#include <cassert>
14#include <stddef.h>
15#include <stdint.h>
16#include <string>
17#include <vector>
18
19#include "Ioss_EntityType.h"
20#include "ioss_export.h"
21
22namespace Ioss {
23 class DatabaseIO;
24 class Field;
25
26 /** \brief A collection of elements having the same topology.
27 */
28 class IOSS_EXPORT ElementBlock : public EntityBlock
29 {
30 public:
31 ElementBlock(DatabaseIO *io_database, const std::string &my_name,
32 const std::string &element_type, int64_t number_elements);
33
34 ElementBlock(const ElementBlock &) = default;
35
36 IOSS_NODISCARD std::string type_string() const override { return "ElementBlock"; }
37 IOSS_NODISCARD std::string short_type_string() const override { return "block"; }
38 IOSS_NODISCARD std::string contains_string() const override { return "Element"; }
39 IOSS_NODISCARD EntityType type() const override { return ELEMENTBLOCK; }
40
41 // Handle implicit properties -- These are calculated from data stored
42 // in the grouping entity instead of having an explicit value assigned.
43 // An example would be 'element_block_count' for a region.
44 IOSS_NODISCARD Property get_implicit_property(const std::string &my_name) const override;
45
46 IOSS_NODISCARD std::vector<std::string> get_block_adjacencies() const;
47 void get_block_adjacencies(std::vector<std::string> &block_adjacency) const;
48 IOSS_NODISCARD AxisAlignedBoundingBox get_bounding_box() const;
49 IOSS_NODISCARD bool operator==(const Ioss::ElementBlock &rhs) const;
50 IOSS_NODISCARD bool operator!=(const Ioss::ElementBlock &rhs) const;
51 IOSS_NODISCARD bool equal(const Ioss::ElementBlock &rhs) const;
52
53 protected:
54 int64_t internal_get_field_data(const Field &field, void *data,
55 size_t data_size) const override;
56
57 int64_t internal_put_field_data(const Field &field, void *data,
58 size_t data_size) const override;
59
60 int64_t internal_get_zc_field_data(const Field &field, void **data,
61 size_t *data_size) const override;
62
63 private:
64 };
65} // namespace Ioss
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:54
An input or output Database.
Definition Ioss_DatabaseIO.h:63
A collection of elements having the same topology.
Definition Ioss_ElementBlock.h:29
ElementBlock(const ElementBlock &)=default
IOSS_NODISCARD std::string short_type_string() const override
Get a short name of the particular type of entity.
Definition Ioss_ElementBlock.h:37
IOSS_NODISCARD EntityType type() const override
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Definition Ioss_ElementBlock.h:39
IOSS_NODISCARD std::string contains_string() const override
What does this entity contain.
Definition Ioss_ElementBlock.h:38
IOSS_NODISCARD std::string type_string() const override
Get the name of the particular type of entity.
Definition Ioss_ElementBlock.h:36
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
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
@ ELEMENTBLOCK
Definition Ioss_EntityType.h:16
Definition Ioss_BoundingBox.h:13