IOSS 2.0
Loading...
Searching...
No Matches
Ioss_QuadratureVariableType.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 {
20 double xi;
21 double eta;
22 double zeta;
23 double weight;
24 };
25
26 class IOSS_EXPORT QuadratureVariableType : public VariableType
27 {
28 public:
29 // 'which' is 1-based
30 IOSS_NODISCARD std::string label(int which, const char /* suffix_sep */) const override
31 {
32 assert(which > 0 && which <= component_count());
33 if (component_count() == 1) {
34 return "";
35 }
36 return VariableType::numeric_label(which, component_count(), name());
37 }
38
39 QuadratureVariableType(const std::string &my_name,
40 const std::vector<Ioss::QuadraturePoint> &quad_points, bool delete_me)
41 : Ioss::VariableType(Ioss::Utils::lowercase(my_name), quad_points.size(), delete_me),
42 m_quadratureType_(my_name), m_quadrature_(quad_points)
43 {
44 }
45
47
48 IOSS_NODISCARD VariableType::Type type() const override { return Type::QUADRATURE; }
49 IOSS_NODISCARD std::string type_string() const override { return "Quadrature"; }
50
51 IOSS_NODISCARD std::vector<Ioss::QuadraturePoint> get_quadrature() const
52 {
53 return m_quadrature_;
54 }
56 {
57 assert(which > 0 && which <= component_count());
58 return m_quadrature_[which - 1];
59 }
60
61 void print() const override final;
62
63 private:
64 std::string m_quadratureType_{};
65 std::vector<Ioss::QuadraturePoint> m_quadrature_{};
66 };
67} // namespace Ioss
68
69#if 0
70typedef struct ex_quadrature
71{
72 char name[EX_MAX_NAME + 1];
73 int cardinality; /* Number of quadrature points */
74 int dimension; /* 1,2,3 -- spatial dimension of points */
75 double *xi; /* xi (x) coordinate of points; dimension = cardinality or NULL */
76 double *
77 eta; /* eta (y) coordinate of points; dimension = cardinality if dimension = 2 or 3 or NULL */
78 double
79 *zeta; /* zeta (z) coordinate of points; dimension = cardinality if dimension == 3. or NULL */
80 double *weight; /* weights for each point; dimension = cardinality or NULL */
81} ex_quadrature;
82#endif
#define IOSS_NODISCARD
Definition Ioss_CodeTypes.h:55
Definition Ioss_QuadratureVariableType.h:27
IOSS_NODISCARD std::string type_string() const override
Definition Ioss_QuadratureVariableType.h:49
QuadratureVariableType(const QuadratureVariableType &)=delete
QuadratureVariableType(const std::string &my_name, const std::vector< Ioss::QuadraturePoint > &quad_points, bool delete_me)
Definition Ioss_QuadratureVariableType.h:39
IOSS_NODISCARD Ioss::QuadraturePoint get_quadrature_component(int which) const
Definition Ioss_QuadratureVariableType.h:55
IOSS_NODISCARD std::vector< Ioss::QuadraturePoint > get_quadrature() const
Definition Ioss_QuadratureVariableType.h:51
IOSS_NODISCARD VariableType::Type type() const override
Definition Ioss_QuadratureVariableType.h:48
IOSS_NODISCARD std::string label(int which, const char) const override
Definition Ioss_QuadratureVariableType.h:30
Definition Ioss_Utils.h:86
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_QuadratureVariableType.h:19
double eta
Definition Ioss_QuadratureVariableType.h:21
double xi
Definition Ioss_QuadratureVariableType.h:20
double zeta
Definition Ioss_QuadratureVariableType.h:22
double weight
Definition Ioss_QuadratureVariableType.h:23