Debian Codegraph @

packages/seacas/libraries/ioss/src/elements/Ioss_Unknown.C

raw
1 // Copyright(C) 1999-2021 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 #include "Ioss_ElementVariableType.h" // for ElementVariableType
8 #include "Ioss_Unknown.h"
9 #include <cassert> // for assert
10 #include <string>
11
12 #include "Ioss_CodeTypes.h" // for IntVector
13 #include "Ioss_ElementTopology.h" // for ElementTopology
14 #include "Ioss_Utils.h"
15
16 // ========================================================================
17 namespace Ioss {
18 const char *Unknown::name = "unknown";
19 class St_Unknown : public ElementVariableType
20 {
21 public:
22 static void factory();
23
24 protected:
25 St_Unknown() : ElementVariableType(Ioss::Unknown::name, 0) {}
26 };
27 } // namespace Ioss
28 void Ioss::St_Unknown::factory() { static Ioss::St_Unknown registerThis; }
29
30 // ========================================================================
31 namespace {
32 struct Constants
33 {
34 static const int nnode = 0;
35 static const int nedge = 0;
36 static const int nedgenode = 0;
37 static const int nface = 0;
38 static const int nfacenode = 0;
39 };
40 } // namespace
41
42 void Ioss::Unknown::factory()
43 {
44 static Ioss::Unknown registerThis;
45 Ioss::St_Unknown::factory();
46 }
47
48 Ioss::Unknown::Unknown() : Ioss::ElementTopology(Ioss::Unknown::name, Ioss::Unknown::name)
49 {
50 Ioss::ElementTopology::alias(Ioss::Unknown::name, "invalid_topology");
51 }
52
53 int Ioss::Unknown::parametric_dimension() const { return 0; }
54 int Ioss::Unknown::spatial_dimension() const { return 3; }
55 int Ioss::Unknown::order() const { return 0; }
56
57 int Ioss::Unknown::number_corner_nodes() const { return number_nodes(); }
58 int Ioss::Unknown::number_nodes() const { return Constants::nnode; }
59 int Ioss::Unknown::number_edges() const { return Constants::nedge; }
60 int Ioss::Unknown::number_faces() const { return Constants::nface; }
61
62 int Ioss::Unknown::number_nodes_edge(int /* edge */) const { return Constants::nedgenode; }
63
64 int Ioss::Unknown::number_nodes_face(int face) const
65 {
66 // face is 1-based. 0 passed in for all faces.
67 assert(face >= 0 && face <= number_faces());
68 IOSS_ASSERT_USED(face);
69 return Constants::nfacenode;
70 }
71
72 int Ioss::Unknown::number_edges_face(int face) const
73 {
74 // face is 1-based. 0 passed in for all faces.
75 assert(face >= 0 && face <= number_faces());
76 IOSS_ASSERT_USED(face);
77 return Constants::nfacenode;
78 }
79
80 Ioss::IntVector Ioss::Unknown::edge_connectivity(int edge_number) const
81 {
82 Ioss::IntVector connectivity;
83 assert(edge_number >= 0 && edge_number <= Constants::nedge);
84 IOSS_ASSERT_USED(edge_number);
85 return connectivity;
86 }
87
88 Ioss::IntVector Ioss::Unknown::face_connectivity(int face_number) const
89 {
90 assert(face_number >= 0 && face_number <= number_faces());
91 IOSS_ASSERT_USED(face_number);
92 Ioss::IntVector connectivity;
93 return connectivity;
94 }
95
96 Ioss::IntVector Ioss::Unknown::element_connectivity() const
97 {
98 Ioss::IntVector connectivity;
99 return connectivity;
100 }
101
102 Ioss::ElementTopology *Ioss::Unknown::face_type(int face_number) const
103 {
104 // face_number == 0 returns topology for all faces if
105 // all faces are the same topology; otherwise, returns nullptr
106 // face_number is 1-based.
107
108 assert(face_number >= 0 && face_number <= number_faces());
109 IOSS_ASSERT_USED(face_number);
110 return Ioss::ElementTopology::factory(Ioss::Unknown::name);
111 }
112
113 Ioss::ElementTopology *Ioss::Unknown::edge_type(int edge_number) const
114 {
115 // edge_number == 0 returns topology for all edges if
116 // all edges are the same topology; otherwise, returns nullptr
117 // edge_number is 1-based.
118
119 assert(edge_number >= 0 && edge_number <= number_edges());
120 IOSS_ASSERT_USED(edge_number);
121 return Ioss::ElementTopology::factory(Ioss::Unknown::name);
122 }