PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
FEM_Hexahedron_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_Hexahedron_PCC_3D_LocalSpace_HPP
13#define __FEM_Hexahedron_PCC_3D_LocalSpace_HPP
14
18#include "MapParallelepiped.hpp"
19
20namespace Polydim
21{
22namespace FEM
23{
24namespace PCC
25{
26
28{
29 private:
30 Eigen::MatrixXd MapValues(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data &local_space,
31 const Eigen::MatrixXd &referenceValues) const;
32
33 std::vector<Eigen::MatrixXd> MapDerivativeValues(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data &local_space,
34 const std::vector<Eigen::MatrixXd> &referenceDerivateValues) const;
35
36 Gedim::Quadrature::QuadratureData InternalQuadrature(const Gedim::Quadrature::QuadratureData &reference_quadrature,
38
39 std::array<Gedim::Quadrature::QuadratureData, 6> BoundaryQuadrature(
40 const std::array<Polydim::FEM::PCC::FEM_Quadrilateral_PCC_2D_LocalSpace_Data, 6> &faces_local_space_data,
42
43 public:
47
50 {
51 return MapValues(local_space, reference_element_data.ReferenceBasisFunctionValues);
52 }
53
54 inline std::vector<Eigen::MatrixXd> ComputeBasisFunctionsDerivativeValues(
57 {
58 return MapDerivativeValues(local_space, reference_element_data.ReferenceBasisFunctionDerivativeValues);
59 }
60
63 const Eigen::MatrixXd &points) const
64 {
65 Eigen::MatrixXd referencePoints;
66 switch (local_space.hexahedron_type)
67 {
69 referencePoints = Gedim::MapParallelepiped::FInv(local_space.MapDataParallelepiped, points);
70 }
71 break;
72 default:
73 throw std::runtime_error("not valid hexahedron type");
74 }
75
77
78 return MapValues(local_space, reference_element.EvaluateBasisFunctions(referencePoints, reference_element_data));
79 }
80
81 inline std::vector<Eigen::MatrixXd> ComputeBasisFunctionsDerivativeValues(
84 const Eigen::MatrixXd &points) const
85 {
86
87 Eigen::MatrixXd referencePoints;
88 switch (local_space.hexahedron_type)
89 {
91 referencePoints = Gedim::MapParallelepiped::FInv(local_space.MapDataParallelepiped, points);
92 }
93 break;
94 default:
95 throw std::runtime_error("not valid hexahedron type");
96 }
97
99
100 return MapDerivativeValues(local_space, reference_element.EvaluateBasisFunctionDerivatives(referencePoints, reference_element_data));
101 }
102
105 const unsigned int face_index) const
106 {
108
109 return face_local_space.ComputeBasisFunctionsValues(reference_element_data.BoundaryReferenceElement_Data,
110 local_space.Boundary_LocalSpace_Data[face_index]);
111 }
112
115 const unsigned int face_index,
116 const Eigen::MatrixXd &points2D) const
117 {
119
120 return face_local_space.ComputeBasisFunctionsValues(reference_element_data.BoundaryReferenceElement_Data,
121 local_space.Boundary_LocalSpace_Data[face_index],
122 points2D);
123 }
124
127 const unsigned int edge_local_index) const
128 {
129 const auto &dof_coordinates = local_space.Dofs;
130
131 const unsigned int cell1DStartingLocalIdex = local_space.Dof1DsIndex.at(edge_local_index);
132 const unsigned int num_edge_dofs = reference_element_data.NumDofs1D;
133
134 if (num_edge_dofs == 0)
135 return Eigen::MatrixXd(0, 0);
136
137 const Eigen::MatrixXd edge_dofs_coordinates = dof_coordinates.block(0, cell1DStartingLocalIdex, 3, num_edge_dofs);
138
139 return edge_dofs_coordinates;
140 }
141
144 const unsigned int face_local_index) const
145 {
146 const auto &dof_coordinates = local_space.Dofs;
147
148 const unsigned int cell2DStartingLocalIdex = local_space.Dof2DsIndex.at(face_local_index);
149 const unsigned int num_face_dofs = reference_element_data.NumDofs2D;
150
151 return (num_face_dofs == 0) ? Eigen::MatrixXd(0, 0) : dof_coordinates.block(0, cell2DStartingLocalIdex, 3, num_face_dofs);
152 }
153
155 const Eigen::VectorXd &pointsCurvilinearCoordinates) const
156 {
157 Eigen::MatrixXd points = Eigen::MatrixXd(3, pointsCurvilinearCoordinates.size());
158 points.row(0) = pointsCurvilinearCoordinates;
160 return reference_element.EvaluateBasisFunctions(points, reference_element_data.EdgeReferenceElement_Data);
161 }
162};
163} // namespace PCC
164} // namespace FEM
165} // namespace Polydim
166
167#endif
static Eigen::MatrixXd FInv(const MapParallelepipedData &mapData, const Eigen::MatrixXd &x)
Definition MapParallelepiped.hpp:94
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:28
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 Eigen::MatrixXd &points) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:61
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
Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_LocalSpace_Data CreateLocalSpace(const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_Polyhedron_Geometry &polyhedron) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.cpp:23
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
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 Eigen::MatrixXd &points) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:81
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
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 Eigen::MatrixXd &points2D) const
Definition FEM_Hexahedron_PCC_3D_LocalSpace.hpp:113
Factory that builds the reference element data for a 1D PCC finite element.
Definition FEM_PCC_1D_ReferenceElement.hpp:67
Eigen::MatrixXd EvaluateBasisFunctions(const Eigen::MatrixXd &points, const Polydim::FEM::PCC::FEM_PCC_1D_ReferenceElement_Data &reference_element_data) const
Definition FEM_PCC_1D_ReferenceElement.hpp:199
Definition FEM_Quadrilateral_PCC_2D_LocalSpace.hpp:28
Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_Quadrilateral_PCC_2D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Quadrilateral_PCC_2D_LocalSpace_Data &local_space) const
Definition FEM_Quadrilateral_PCC_2D_LocalSpace.hpp:55
Definition FEM_MCC_2D_LocalSpace.cpp:17
Definition QuadratureData.hpp:22
Definition FEM_PCC_3D_LocalSpace_Data.hpp:58
std::array< unsigned int, 13 > Dof1DsIndex
Definition FEM_PCC_3D_LocalSpace_Data.hpp:69
std::array< unsigned int, 7 > Dof2DsIndex
Definition FEM_PCC_3D_LocalSpace_Data.hpp:70
Gedim::MapParallelepiped::MapParallelepipedData MapDataParallelepiped
Definition FEM_PCC_3D_LocalSpace_Data.hpp:59
Eigen::MatrixXd Dofs
Definition FEM_PCC_3D_LocalSpace_Data.hpp:63
Polydim::FEM::PCC::HexahedronType hexahedron_type
Definition FEM_PCC_3D_LocalSpace_Data.hpp:75
std::array< Polydim::FEM::PCC::FEM_Quadrilateral_PCC_2D_LocalSpace_Data, 6 > Boundary_LocalSpace_Data
Definition FEM_PCC_3D_LocalSpace_Data.hpp:73
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:27
Eigen::MatrixXd ReferenceBasisFunctionValues
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:44
std::vector< Eigen::MatrixXd > ReferenceBasisFunctionDerivativeValues
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:45
Polydim::FEM::PCC::FEM_PCC_1D_ReferenceElement_Data EdgeReferenceElement_Data
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:47
unsigned int NumDofs1D
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:31
Polydim::FEM::PCC::FEM_Quadrilateral_PCC_2D_ReferenceElement_Data BoundaryReferenceElement_Data
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:48
unsigned int NumDofs2D
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:32
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:52
Eigen::MatrixXd EvaluateBasisFunctions(const Eigen::MatrixXd &points, const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data) const
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:263
std::vector< Eigen::MatrixXd > EvaluateBasisFunctionDerivatives(const Eigen::MatrixXd &points, const Polydim::FEM::PCC::FEM_Hexahedron_PCC_3D_ReferenceElement_Data &reference_element_data) const
Definition FEM_Hexahedron_PCC_3D_ReferenceElement.hpp:295
Definition FEM_PCC_3D_LocalSpace_Data.hpp:41