BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
cl_Element_TRI3.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 BELFEM_CL_ELEMENT_TRI3_HPP
13#define BELFEM_CL_ELEMENT_TRI3_HPP
14
15#include "typedefs.hpp"
16#include "Mesh_Enums.hpp"
18
19namespace belfem
20{
21 namespace mesh
22 {
23//------------------------------------------------------------------------------
24
25 template <>
31
32//------------------------------------------------------------------------------
33
34 template <>
35 uint
37 {
38 return 2 ;
39 }
40
41//------------------------------------------------------------------------------
42
43 template <>
44 void
46 {
47 // allocate the node container
48 aNodes.set_size( 2, nullptr );
49
50 switch( aFacetIndex )
51 {
52 case( 0 ):
53 {
54 aNodes( 0 ) = mNodes[ 0 ];
55 aNodes( 1 ) = mNodes[ 1 ];
56 break;
57 }
58 case( 1 ):
59 {
60 aNodes( 0 ) = mNodes[ 1 ];
61 aNodes( 1 ) = mNodes[ 2 ];
62 break;
63 }
64 case( 2 ):
65 {
66 aNodes( 0 ) = mNodes[ 2 ];
67 aNodes( 1 ) = mNodes[ 0 ];
68 break;
69 }
70 default:
71 {
72 this->throw_facet_error( aFacetIndex );
73 }
74 }
75 }
76
77//------------------------------------------------------------------------------
78
79 template <>
80 void
82 {
83 this->get_nodes_of_facet( aFacetIndex, aNodes );
84 }
85
86//------------------------------------------------------------------------------
87
88 template <>
89 void
91 const uint aFacetIndex, Cell< Edge * > & aEdges )
92 {
93 // allocate the node container
94 aEdges.set_size( 1, nullptr );
95
96 switch( aFacetIndex )
97 {
98 case( 0 ):
99 {
100 aEdges( 0 ) = mEdges[ 0 ];
101 break ;
102 }
103 case( 1 ):
104 {
105 aEdges( 0 ) = mEdges[ 1 ];
106 break ;
107 }
108 case( 2 ):
109 {
110 aEdges( 0 ) = mEdges[ 2 ];
111 break ;
112 }
113 default:
114 {
115 this->throw_facet_error( aFacetIndex );
116 }
117 }
118 }
119
120//------------------------------------------------------------------------------
121 } /* namespace mesh */
122} /* namespace belfem */
123
124#endif //BELFEM_CL_ELEMENT_TRI3_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_facet(const uint aFacetIndex, Cell< Node * > &aNodes) override
Definition cl_ElementTemplate.hpp:896
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
@ TRI3
Definition Mesh_Enums.hpp:30