IOSS 2.0
Loading...
Searching...
No Matches
Ioss_BasisVariableType.h
Go to the documentation of this file.
1/*
2 * Copyright(C) 2024 National Technology & Engineering Solutions
3 * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 * NTESS, the U.S. Government retains certain rights in this software.
5 *
6 * See packages/seacas/LICENSE for details
7 */
8#pragma once
9
10#include "ioss_export.h"
11
12#include "Ioss_CodeTypes.h"
13#include <string>
14
15#include "Ioss_VariableType.h"
16
17namespace Ioss {
19 {
24 double xi;
25 double eta;
26 double zeta;
27 };
28
29 struct Basis
30 {
31 size_t size() const { return basies.size(); }
32 std::vector<BasisComponent> basies;
33 };
34
35 class IOSS_EXPORT BasisVariableType : public VariableType
36 {
37 public:
38 // 'which' is 1-based
39 IOSS_NODISCARD std::string label(int which, const char /* suffix_sep */) const override
40 {
41 assert(which > 0 && which <= component_count());
42 if (component_count() == 1) {
43 return "";
44 }
45 return VariableType::numeric_label(which - 1, component_count(), name());
46 }
47
48 BasisVariableType(const std::string &my_name, const Ioss::Basis &basis, bool delete_me)
49 : Ioss::VariableType(my_name, basis.size(), delete_me), m_basis_type_(my_name),
50 m_basis_(basis)
51 {
52 }
53
55
56 IOSS_NODISCARD VariableType::Type type() const override { return Type::BASIS; }
57 IOSS_NODISCARD std::string type_string() const override { return "Basis"; }
58
59 IOSS_NODISCARD const Ioss::Basis &get_basis() const { return m_basis_; }
61 {
62 assert(which > 0 && which <= component_count());
63 return m_basis_.basies[which - 1];
64 }
65
66 void print() const override final;
67
68 private:
69 std::string m_basis_type_{};
70 Ioss::Basis m_basis_{};
71 };
72} // namespace Ioss
73
74#if 0
75typedef struct ex_basis
76{
77 /*
78 * subc_dim: dimension of the subcell associated with the specified DoF ordinal
79 * -- 0 node, 1 edge, 2 face, 3 volume [Range: 0..3]
80 * subc_ordinal: ordinal of the subcell relative to its parent cell
81 * -- 0..n for each ordinal with the same subc dim [Range: <= DoF ordinal]
82 * subc_dof_ordinal: ordinal of the DoF relative to the subcell
83 * subc_num_dof: cardinality of the DoF set associated with this subcell.
84 * xi, eta, mu (ξ, η, ζ): Parametric coordinate location of the DoF
85 * -- (Only first ndim values are valid)
86 */
87 char name[EX_MAX_NAME + 1];
88 int cardinality; /* number of `basis` points == dimension of non-null subc_*, xi, eta, mu */
89 int *subc_dim;
90 int *subc_ordinal;
91 int *subc_dof_ordinal;
92 int *subc_num_dof;
93 double *xi;
94 double *eta;
95 double *zeta;
96} ex_basis;
97#endif
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:55
Definition Ioss_BasisVariableType.h:36
BasisVariableType(const BasisVariableType &)=delete
BasisVariableType(const std::string &my_name, const Ioss::Basis &basis, bool delete_me)
Definition Ioss_BasisVariableType.h:48
IOSS_NODISCARD VariableType::Type type() const override
Definition Ioss_BasisVariableType.h:56
IOSS_NODISCARD const Ioss::BasisComponent & get_basis_component(int which) const
Definition Ioss_BasisVariableType.h:60
IOSS_NODISCARD std::string label(int which, const char) const override
Definition Ioss_BasisVariableType.h:39
IOSS_NODISCARD std::string type_string() const override
Definition Ioss_BasisVariableType.h:57
IOSS_NODISCARD const Ioss::Basis & get_basis() const
Definition Ioss_BasisVariableType.h:59
A generic variable type.
Definition Ioss_VariableType.h:70
Type
Definition Ioss_VariableType.h:72
The main namespace for the Ioss library.
Definition Ioad_DatabaseIO.C:40
std::string name(const Ioss::GroupingEntity *entity)
Definition io_info.C:128
Definition Ioss_BasisVariableType.h:19
int subc_num_dof
Definition Ioss_BasisVariableType.h:23
int subc_dof_ordinal
Definition Ioss_BasisVariableType.h:22
int subc_ordinal
Definition Ioss_BasisVariableType.h:21
double eta
Definition Ioss_BasisVariableType.h:25
double xi
Definition Ioss_BasisVariableType.h:24
double zeta
Definition Ioss_BasisVariableType.h:26
int subc_dim
Definition Ioss_BasisVariableType.h:20
Definition Ioss_BasisVariableType.h:30
std::vector< BasisComponent > basies
Definition Ioss_BasisVariableType.h:32
size_t size() const
Definition Ioss_BasisVariableType.h:31