PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
FEM_PCC_3D_LocalSpace.hpp
Go to the documentation of this file.
1// _LICENSE_HEADER_
2//
3// Copyright (C) 2019 - 2025.
4// Terms register on the GPL-3.0 license.
5//
6// This file can be redistributed and/or modified under the license terms.
7//
8// See top level LICENSE file for more details.
9//
10// This file can be used citing references in CITATION.cff file.
11
12#ifndef __FEM_PCC_3D_LocalSpace_HPP
13#define __FEM_PCC_3D_LocalSpace_HPP
14
19
20namespace Polydim
21{
22namespace FEM
23{
24namespace PCC
25{
26
28{
29 private:
32
33 public:
36
37 inline Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data,
38 const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space) const
39 {
40 switch (local_space.fem_type)
41 {
43
44 return tetrahedron_local_space.ComputeBasisFunctionsValues(reference_element_data.tetrahedron_reference_element_data,
46 }
48 return hexahedron_local_space.ComputeBasisFunctionsValues(reference_element_data.hexahedron_reference_element_data,
49 local_space.hexahedron_local_space_data);
50 }
51 default:
52 throw std::runtime_error("not valid fem type");
53 }
54 }
55
56 inline std::vector<Eigen::MatrixXd> ComputeBasisFunctionsDerivativeValues(
57 const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data,
58 const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space) const
59 {
60 switch (local_space.fem_type)
61 {
63
64 return tetrahedron_local_space.ComputeBasisFunctionsDerivativeValues(reference_element_data.tetrahedron_reference_element_data,
66 }
68 return hexahedron_local_space.ComputeBasisFunctionsDerivativeValues(reference_element_data.hexahedron_reference_element_data,
69 local_space.hexahedron_local_space_data);
70 }
71 default:
72 throw std::runtime_error("not valid fem type");
73 }
74 }
75
76 inline Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data,
78 const Eigen::MatrixXd &points) const
79 {
80
81 switch (local_space.fem_type)
82 {
84
85 return tetrahedron_local_space.ComputeBasisFunctionsValues(reference_element_data.tetrahedron_reference_element_data,
87 points);
88 }
90 return hexahedron_local_space.ComputeBasisFunctionsValues(reference_element_data.hexahedron_reference_element_data,
92 points);
93 }
94 default:
95 throw std::runtime_error("not valid fem type");
96 }
97 }
98
99 inline std::vector<Eigen::MatrixXd> ComputeBasisFunctionsDerivativeValues(
100 const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data,
102 const Eigen::MatrixXd &points) const
103 {
104 switch (local_space.fem_type)
105 {
107
108 return tetrahedron_local_space.ComputeBasisFunctionsDerivativeValues(reference_element_data.tetrahedron_reference_element_data,
110 points);
111 }
113 return hexahedron_local_space.ComputeBasisFunctionsDerivativeValues(reference_element_data.hexahedron_reference_element_data,
114 local_space.hexahedron_local_space_data,
115 points);
116 }
117 default:
118 throw std::runtime_error("not valid fem type");
119 }
120 }
121
124 const unsigned int face_index) const
125 {
126 switch (local_space.fem_type)
127 {
129
130 return tetrahedron_local_space.ComputeBasisFunctionsValuesOnFace(reference_element_data.tetrahedron_reference_element_data,
132 face_index);
133 }
135 return hexahedron_local_space.ComputeBasisFunctionsValuesOnFace(reference_element_data.hexahedron_reference_element_data,
136 local_space.hexahedron_local_space_data,
137 face_index);
138 }
139 default:
140 throw std::runtime_error("not valid fem type");
141 }
142 }
143
146 const unsigned int face_index,
147 const Eigen::MatrixXd &points2D) const
148 {
149 switch (local_space.fem_type)
150 {
152
153 return tetrahedron_local_space.ComputeBasisFunctionsValuesOnFace(reference_element_data.tetrahedron_reference_element_data,
155 face_index,
156 points2D);
157 }
159 return hexahedron_local_space.ComputeBasisFunctionsValuesOnFace(reference_element_data.hexahedron_reference_element_data,
160 local_space.hexahedron_local_space_data,
161 face_index,
162 points2D);
163 }
164 default:
165 throw std::runtime_error("not valid fem type");
166 }
167 }
168
169 inline Eigen::MatrixXd FaceDOFsCoordinates(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data,
171 const unsigned int face_local_index) const
172 {
173 switch (local_space.fem_type)
174 {
176
177 return tetrahedron_local_space.FaceDOFsCoordinates(reference_element_data.tetrahedron_reference_element_data,
179 face_local_index);
180 }
182 return hexahedron_local_space.FaceDOFsCoordinates(reference_element_data.hexahedron_reference_element_data,
183 local_space.hexahedron_local_space_data,
184 face_local_index);
185 }
186 default:
187 throw std::runtime_error("not valid fem type");
188 }
189 }
190
191 inline Eigen::MatrixXd EdgeDOFsCoordinates(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data,
193 const unsigned int edge_local_index) const
194 {
195 switch (local_space.fem_type)
196 {
198
199 return tetrahedron_local_space.EdgeDOFsCoordinates(reference_element_data.tetrahedron_reference_element_data,
201 edge_local_index);
202 }
204 return hexahedron_local_space.EdgeDOFsCoordinates(reference_element_data.hexahedron_reference_element_data,
205 local_space.hexahedron_local_space_data,
206 edge_local_index);
207 }
208 default:
209 throw std::runtime_error("not valid fem type");
210 }
211 }
212
215 const Eigen::VectorXd &pointsCurvilinearCoordinates) const
216 {
217 switch (local_space.fem_type)
218 {
220 return tetrahedron_local_space.ComputeBasisFunctionsValuesOnEdge(reference_element_data.tetrahedron_reference_element_data,
221 pointsCurvilinearCoordinates);
222 }
224 return hexahedron_local_space.ComputeBasisFunctionsValuesOnEdge(reference_element_data.hexahedron_reference_element_data,
225 pointsCurvilinearCoordinates);
226 }
227 default:
228 throw std::runtime_error("not valid fem type");
229 }
230 }
231};
232} // namespace PCC
233} // namespace FEM
234} // namespace Polydim
235
236#endif
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:28
std::vector< Eigen::MatrixXd > ComputeBasisFunctionsDerivativeValues(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data &local_space) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:54
Eigen::MatrixXd ComputeBasisFunctionsValuesOnEdge(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Eigen::VectorXd &pointsCurvilinearCoordinates) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:154
Eigen::MatrixXd EdgeDOFsCoordinates(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data &local_space, const unsigned int edge_local_index) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:125
Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data &local_space) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:48
Eigen::MatrixXd ComputeBasisFunctionsValuesOnFace(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data &local_space, const unsigned int face_index) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:103
Eigen::MatrixXd FaceDOFsCoordinates(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data &local_space, const unsigned int face_local_index) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:142
Definition FEM_PCC_3D_LocalSpace.hpp:28
std::vector< Eigen::MatrixXd > ComputeBasisFunctionsDerivativeValues(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space, const Eigen::MatrixXd &points) const
Definition FEM_PCC_3D_LocalSpace.hpp:99
Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space) const
Definition FEM_PCC_3D_LocalSpace.hpp:37
Eigen::MatrixXd ComputeBasisFunctionsValuesOnFace(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space, const unsigned int face_index) const
Definition FEM_PCC_3D_LocalSpace.hpp:122
Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data CreateLocalSpace(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_Polyhedron_Geometry &polyhedron) const
Definition FEM_PCC_3D_LocalSpace.cpp:23
Eigen::MatrixXd ComputeBasisFunctionsValuesOnFace(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space, const unsigned int face_index, const Eigen::MatrixXd &points2D) const
Definition FEM_PCC_3D_LocalSpace.hpp:144
Eigen::MatrixXd EdgeDOFsCoordinates(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space, const unsigned int edge_local_index) const
Definition FEM_PCC_3D_LocalSpace.hpp:191
Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space, const Eigen::MatrixXd &points) const
Definition FEM_PCC_3D_LocalSpace.hpp:76
Eigen::MatrixXd ComputeBasisFunctionsValuesOnEdge(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space, const Eigen::VectorXd &pointsCurvilinearCoordinates) const
Definition FEM_PCC_3D_LocalSpace.hpp:213
Eigen::MatrixXd FaceDOFsCoordinates(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space, const unsigned int face_local_index) const
Definition FEM_PCC_3D_LocalSpace.hpp:169
std::vector< Eigen::MatrixXd > ComputeBasisFunctionsDerivativeValues(const Polydim::FEM::PCC::FEM_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_LocalSpace_Data &local_space) const
Definition FEM_PCC_3D_LocalSpace.hpp:56
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:28
Eigen::MatrixXd FaceDOFsCoordinates(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data &local_space, const unsigned int face_local_index) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:100
Eigen::MatrixXd ComputeBasisFunctionsValuesOnFace(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data &local_space, const unsigned int face_index) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:112
std::vector< Eigen::MatrixXd > ComputeBasisFunctionsDerivativeValues(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data &local_space) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:53
Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data &local_space) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:47
Eigen::MatrixXd ComputeBasisFunctionsValuesOnEdge(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Eigen::VectorXd &pointsCurvilinearCoordinates) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:134
Eigen::MatrixXd EdgeDOFsCoordinates(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data &local_space, const unsigned int edge_local_index) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:83
Definition FEM_MCC_2D_LocalSpace.cpp:17
Definition FEM_PCC_3D_LocalSpace_Data.hpp:100
Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data hexahedron_local_space_data
Definition FEM_PCC_3D_LocalSpace_Data.hpp:101
Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data tetrahedron_local_space_data
Definition FEM_PCC_3D_LocalSpace_Data.hpp:102
Polydim::FEM::PCC::FEM_PCC_3D_Types fem_type
Definition FEM_PCC_3D_LocalSpace_Data.hpp:103
Definition FEM_PCC_3D_LocalSpace_Data.hpp:41
Definition FEM_PCC_3D_ReferenceElement.hpp:26
Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data tetrahedron_reference_element_data
Definition FEM_PCC_3D_ReferenceElement.hpp:33
Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data hexahedron_reference_element_data
Definition FEM_PCC_3D_ReferenceElement.hpp:34