BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Element_QUAD4TS.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef CL_ELEMENT_QUAD4TS_HPP
13#define CL_ELEMENT_QUAD4TS_HPP
14
15
16#include "typedefs.hpp"
17#include "Mesh_Enums.hpp"
19
20namespace belfem
21{
22 namespace mesh
23 {
24//------------------------------------------------------------------------------
25
26 template <>
32
33//------------------------------------------------------------------------------
34
35 template <>
36 uint
38 {
39 return 2 ;
40 }
41
42//------------------------------------------------------------------------------
43
44 template <>
45 bool
47 {
48 return true ;
49 }
50
51//------------------------------------------------------------------------------
52
53 template <>
54 void
56 {
57 // allocate the node container
58 aNodes.set_size( 2, nullptr );
59
60 switch( aFacetIndex )
61 {
62 case 0 :
63 {
64 aNodes( 0 ) = mNodes[ 0 ];
65 aNodes( 1 ) = mNodes[ 1 ];
66 break;
67 }
68 case 1 :
69 {
70 aNodes( 0 ) = mNodes[ 1 ];
71 aNodes( 1 ) = mNodes[ 2 ];
72 break;
73 }
74 case 2 :
75 {
76 aNodes( 0 ) = mNodes[ 2 ];
77 aNodes( 1 ) = mNodes[ 3 ];
78 break;
79 }
80 case 3 :
81 {
82 aNodes( 0 ) = mNodes[ 3 ];
83 aNodes( 1 ) = mNodes[ 0 ];
84 break;
85 }
86 default:
87 {
88 this->throw_facet_error( aFacetIndex );
89 }
90 }
91 }
92
93//------------------------------------------------------------------------------
94
95 template <>
96 void
98 {
99 this->get_nodes_of_facet( aFacetIndex, aNodes );
100 }
101
102//------------------------------------------------------------------------------
103
104 template <>
105 void
107 {
108 // allocate the node container
109 aNodes.set_size( 2, nullptr );
110
111 // QUAD4TS has only 2 edges corresponding to the bottom and top curve
112 // (the two Nédélec-carrying edges of the thin shell)
113 switch( aEdgeIndex )
114 {
115 case 0 :
116 {
117 // bottom curve edge: node 0 -> node 1
118 aNodes( 0 ) = mNodes[ 0 ];
119 aNodes( 1 ) = mNodes[ 1 ];
120 break;
121 }
122 case 1 :
123 {
124 // top curve edge: node 3 -> node 2 (same tangent direction
125 // as bottom, so parallel edges can share Nédélec DOFs)
126 aNodes( 0 ) = mNodes[ 3 ];
127 aNodes( 1 ) = mNodes[ 2 ];
128 break;
129 }
130 default:
131 {
132 this->throw_edge_error( aEdgeIndex );
133 }
134 }
135 }
136
137//------------------------------------------------------------------------------
138
139 template <>
140 void
142 const uint aFacetIndex, Cell< Edge * > & aEdges )
143 {
144 switch( aFacetIndex )
145 {
146 case 0 :
147 {
148 // bottom facet uses the bottom curve edge (mEdges[0])
149 aEdges.set_size( 1, nullptr );
150 aEdges( 0 ) = mEdges[ 0 ];
151 break ;
152 }
153 case 2 :
154 {
155 // top facet uses the top curve edge (mEdges[1]).
156 // mEdges[1] is stored as {3,2} but the facet traversal
157 // here is {2,3}; fem::Element::compute_edge_directions resolves
158 // the local sign from the node-ID comparison.
159 aEdges.set_size( 1, nullptr );
160 aEdges( 0 ) = mEdges[ 1 ];
161 break ;
162 }
163 // Side facets 1 and 3 have no Nédélec edge in the thin-shell
164 // reduction (analogous to PENTA6TS side-quad facets 0/1/2).
165 default:
166 {
167 this->throw_facet_error( aFacetIndex );
168 }
169 }
170 }
171
172//------------------------------------------------------------------------------
173 } /* namespace mesh */
174} /* namespace belfem */
175
176#endif //CL_ELEMENT_QUAD4TS_HPP
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
void set_size(const size_t aSize)
Definition cl_Cell.hpp:189
void get_nodes_of_edge(const uint aEdgeIndex, Cell< Node * > &aNodes) override
Definition cl_ElementTemplate.hpp:930
void get_nodes_of_facet(const uint aFacetIndex, Cell< Node * > &aNodes) override
Definition cl_ElementTemplate.hpp:896
bool is_thinshell() const override
Definition cl_ElementTemplate.hpp:1018
void get_corner_nodes_of_facet(const uint aFacetIndex, Cell< Node * > &aNodes) override
Definition cl_ElementTemplate.hpp:907
uint dimension() const override
Definition cl_ElementTemplate.hpp:978
ElementType type() const override
return the type of the element
Definition cl_ElementTemplate.hpp:470
void get_edges_of_facet(const uint aFacetIndex, Cell< Edge * > &aEdges) override
Definition cl_ElementTemplate.hpp:918
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
ElementType
Element types.
Definition Mesh_Enums.hpp:27
@ QUAD4TS
Definition Mesh_Enums.hpp:58