| 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 |
|
| 22 |
namespace 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 Ioss::NameList get_block_adjacencies() const; |
| 47 |
void get_block_adjacencies(Ioss::NameList &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 |