Debian Codegraph @

packages/seacas/libraries/ioss/src/elements/Ioss_Edge4.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_Edge4.h"
8 #include "Ioss_ElementVariableType.h" // for ElementVariableType
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 // Define a variable type for storage of this elements connectivity
18 namespace Ioss {
19 const char *Edge4::name = "edge4";
20 class St_Edge4 : public ElementVariableType
21 {
22 public:
23 static void factory() { static St_Edge4 registerThis; }
24
25 protected:
26 St_Edge4() : ElementVariableType(Ioss::Edge4::name, 4) {}
27 };
28 } // namespace Ioss
29 // ========================================================================
30 namespace {
31 struct Constants
32 {
33 static const int nnode = 4;
34 static const int nedge = 0;
35 static const int nedgenode = 0;
36 static const int nface = 0;
37 static const int nfacenode = 0;
38 static const int nfaceedge = 0;
39 };
40 } // namespace
41
42 void Ioss::Edge4::factory()
43 {
44 static Ioss::Edge4 registerThis;
45 Ioss::St_Edge4::factory();
46 }
47
48 Ioss::Edge4::Edge4() : Ioss::ElementTopology(Ioss::Edge4::name, "Line_4")
49 {
50 Ioss::ElementTopology::alias(Ioss::Edge4::name, "edge3d4");
51 Ioss::ElementTopology::alias(Ioss::Edge4::name, "LINE_4_1D");
52 }
53
54 int Ioss::Edge4::parametric_dimension() const { return 1; }
55 int Ioss::Edge4::spatial_dimension() const { return 3; }
56 int Ioss::Edge4::order() const { return 3; }
57
58 int Ioss::Edge4::number_corner_nodes() const { return 2; }
59 int Ioss::Edge4::number_nodes() const { return Constants::nnode; }
60 int Ioss::Edge4::number_edges() const { return Constants::nedge; }
61 int Ioss::Edge4::number_faces() const { return Constants::nface; }
62
63 int Ioss::Edge4::number_nodes_edge(int /* edge */) const { return Constants::nedgenode; }
64
65 int Ioss::Edge4::number_nodes_face(int face) const
66 {
67 // face is 1-based. 0 passed in for all faces.
68 assert(face >= 0 && face <= number_faces());
69 IOSS_ASSERT_USED(face);
70 return Constants::nfacenode;
71 }
72
73 int Ioss::Edge4::number_edges_face(int face) const
74 {
75 // face is 1-based. 0 passed in for all faces.
76 assert(face >= 0 && face <= number_faces());
77 IOSS_ASSERT_USED(face);
78 return Constants::nfaceedge;
79 }
80
81 Ioss::IntVector Ioss::Edge4::edge_connectivity(int /* edge_number */) const
82 {
83 Ioss::IntVector connectivity;
84 return connectivity;
85 }
86
87 Ioss::IntVector Ioss::Edge4::face_connectivity(int /* face_number */) const
88 {
89 Ioss::IntVector connectivity;
90 return connectivity;
91 }
92
93 Ioss::IntVector Ioss::Edge4::element_connectivity() const
94 {
95 Ioss::IntVector connectivity(number_nodes());
96 for (int i = 0; i < number_nodes(); i++) {
97 connectivity[i] = i;
98 }
99 return connectivity;
100 }
101
102 Ioss::ElementTopology *Ioss::Edge4::face_type(int /* face_number */) const
103 {
104 return (Ioss::ElementTopology *)nullptr;
105 }
106
107 Ioss::ElementTopology *Ioss::Edge4::edge_type(int /* edge_number */) const
108 {
109 return Ioss::ElementTopology::factory("node1");
110 }