IOSS 2.0
Loading...
Searching...
No Matches
Ioss_Assembly.h
Go to the documentation of this file.
1// Copyright(C) 1999-2020, 2022, 2023, 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
10#include <cstddef> // for size_t
11#include <cstdint> // for int64_t
12#include <string> // for string
13#include <vector>
14
15#include "Ioss_EntityType.h" // for EntityType, etc
16#include "Ioss_Property.h" // for Property
17#include "ioss_export.h"
18
19namespace Ioss {
20 class DatabaseIO;
21 class Field;
22} // namespace Ioss
23
24namespace Ioss {
25
26 using EntityContainer = std::vector<const Ioss::GroupingEntity *>;
27
28 /** \brief A homogeneous collection of other GroupingEntities.
29 */
30 class IOSS_EXPORT Assembly : public GroupingEntity
31 {
32 public:
33 Assembly() = default; // Used for template typing only
34 Assembly(const Assembly &) = default;
35
36 Assembly(DatabaseIO *io_database, const std::string &my_name);
37
38 IOSS_NODISCARD std::string type_string() const override { return "Assembly"; }
39 IOSS_NODISCARD std::string short_type_string() const override { return "assembly"; }
40 IOSS_NODISCARD std::string contains_string() const override
41 {
42 return m_members.empty() ? "<EMPTY>" : m_members[0]->type_string();
43 }
44 IOSS_NODISCARD EntityType type() const override { return ASSEMBLY; }
45
46 IOSS_NODISCARD EntityType get_member_type() const { return m_type; }
47
48 bool add(const GroupingEntity *member);
49 bool remove(const GroupingEntity *removal);
50 IOSS_NODISCARD const EntityContainer &get_members() const;
51 IOSS_NODISCARD const GroupingEntity *get_member(const std::string &my_name) const;
52 void remove_members();
53 IOSS_NODISCARD size_t member_count() const { return m_members.size(); }
54
55 // Handle implicit properties -- These are calculated 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 IOSS_NODISCARD 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 int64_t internal_get_zc_field_data(const Field &field, void **data,
68 size_t *data_size) const override;
69
70 private:
73 };
74} // namespace Ioss
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:54
A homogeneous collection of other GroupingEntities.
Definition Ioss_Assembly.h:31
IOSS_NODISCARD EntityType type() const override
Get the EntityType, which indicates the particular type of GroupingEntity this is.
Definition Ioss_Assembly.h:44
IOSS_NODISCARD std::string short_type_string() const override
Get a short name of the particular type of entity.
Definition Ioss_Assembly.h:39
Assembly()=default
IOSS_NODISCARD size_t member_count() const
Definition Ioss_Assembly.h:53
IOSS_NODISCARD std::string type_string() const override
Get the name of the particular type of entity.
Definition Ioss_Assembly.h:38
IOSS_NODISCARD EntityType get_member_type() const
Definition Ioss_Assembly.h:46
EntityContainer m_members
Definition Ioss_Assembly.h:71
IOSS_NODISCARD std::string contains_string() const override
What does this entity contain.
Definition Ioss_Assembly.h:40
Assembly(const Assembly &)=default
An input or output Database.
Definition Ioss_DatabaseIO.h:63
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 named value that has a known type.
Definition Ioss_Property.h:27
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
std::vector< const Ioss::GroupingEntity * > EntityContainer
Definition Ioss_Assembly.h:26
EntityType
The particular type of GroupingEntity.
Definition Ioss_EntityType.h:12
@ INVALID_TYPE
Definition Ioss_EntityType.h:30
@ ASSEMBLY
Definition Ioss_EntityType.h:28