PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
FEM_Tetrahedron_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_Tetrahedron_PCC_3D_LocalSpace_HPP
13#define __FEM_Tetrahedron_PCC_3D_LocalSpace_HPP
14
18#include "MapTetrahedron.hpp"
19
20namespace Polydim
21{
22namespace FEM
23{
24namespace PCC
25{
26
28{
29 private:
30 Eigen::MatrixXd MapValues(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data &local_space,
31 const Eigen::MatrixXd &referenceValues) const;
32
33 std::vector<Eigen::MatrixXd> MapDerivativeValues(const Polydim::FEM::PCC::FEM_Tetrahedron_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 std::array<Gedim::Quadrature::QuadratureData, 4> BoundaryQuadrature(
39 const std::array<FEM_Triangle_PCC_2D_LocalSpace_Data, 4> &faces_local_space_data,
41
42 public:
46
49 {
50 return MapValues(local_space, reference_element_data.ReferenceBasisFunctionValues);
51 }
52
53 inline std::vector<Eigen::MatrixXd> ComputeBasisFunctionsDerivativeValues(
56 {
57 return MapDerivativeValues(local_space, reference_element_data.ReferenceBasisFunctionDerivativeValues);
58 }
59
62 const Eigen::MatrixXd &points) const
63 {
64 const Eigen::MatrixXd referencePoints = Gedim::MapTetrahedron::FInv(local_space.MapData, points);
65
67
68 return MapValues(local_space, reference_element.EvaluateBasisFunctions(referencePoints, reference_element_data));
69 }
70
71 inline std::vector<Eigen::MatrixXd> ComputeBasisFunctionsDerivativeValues(
74 const Eigen::MatrixXd &points) const
75 {
76 const Eigen::MatrixXd referencePoints = Gedim::MapTetrahedron::FInv(local_space.MapData, points);
77
79
80 return MapDerivativeValues(local_space, reference_element.EvaluateBasisFunctionDerivatives(referencePoints, reference_element_data));
81 }
82
85 const unsigned int edge_local_index) const
86 {
87 const auto &dof_coordinates = local_space.Dofs;
88
89 const unsigned int cell1DStartingLocalIdex = local_space.Dof1DsIndex.at(edge_local_index);
90 const unsigned int num_edge_dofs = reference_element_data.NumDofs1D;
91
92 if (num_edge_dofs == 0)
93 return Eigen::MatrixXd(0, 0);
94
95 const Eigen::MatrixXd edge_dofs_coordinates = dof_coordinates.block(0, cell1DStartingLocalIdex, 3, num_edge_dofs);
96
97 return edge_dofs_coordinates;
98 }
99
102 const unsigned int face_local_index) const
103 {
104 const auto &dof_coordinates = local_space.Dofs;
105
106 const unsigned int cell2DStartingLocalIdex = local_space.Dof2DsIndex.at(face_local_index);
107 const unsigned int num_face_dofs = reference_element_data.NumDofs2D;
108
109 return (num_face_dofs == 0) ? Eigen::MatrixXd(0, 0) : dof_coordinates.block(0, cell2DStartingLocalIdex, 3, num_face_dofs);
110 }
111
114 const unsigned int face_index) const
115 {
117
118 return face_local_space.ComputeBasisFunctionsValues(reference_element_data.BoundaryReferenceElement_Data,
119 local_space.Boundary_LocalSpace_Data[face_index]);
120 }
121
124 const unsigned int face_index,
125 const Eigen::MatrixXd &points2D) const
126 {
128
129 return face_local_space.ComputeBasisFunctionsValues(reference_element_data.BoundaryReferenceElement_Data,
130 local_space.Boundary_LocalSpace_Data[face_index],
131 points2D);
132 }
133
135 const Eigen::VectorXd &pointsCurvilinearCoordinates) const
136 {
137 Eigen::MatrixXd points = Eigen::MatrixXd(3, pointsCurvilinearCoordinates.size());
138 points.row(0) = pointsCurvilinearCoordinates;
140 return reference_element.EvaluateBasisFunctions(points, reference_element_data.EdgeReferenceElement_Data);
141 }
142};
143} // namespace PCC
144} // namespace FEM
145} // namespace Polydim
146
147#endif
static Eigen::MatrixXd FInv(const MapTetrahedronData &mapData, const Eigen::MatrixXd &x)
Definition MapTetrahedron.hpp:88
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_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 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 Eigen::MatrixXd &points2D) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:122
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 Eigen::MatrixXd &points) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:71
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
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 Eigen::MatrixXd &points) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.hpp:60
Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_LocalSpace_Data CreateLocalSpace(const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_PCC_3D_Polyhedron_Geometry &polyhedron) const
Definition FEM_Tetrahedron_PCC_3D_LocalSpace.cpp:24
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:54
Eigen::MatrixXd EvaluateBasisFunctions(const Eigen::MatrixXd &points, const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data) const
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:331
std::vector< Eigen::MatrixXd > EvaluateBasisFunctionDerivatives(const Eigen::MatrixXd &points, const Polydim::FEM::PCC::FEM_Tetrahedron_PCC_3D_ReferenceElement_Data &reference_element_data) const
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:362
Definition FEM_Triangle_PCC_2D_LocalSpace.hpp:27
Eigen::MatrixXd ComputeBasisFunctionsValues(const Polydim::FEM::PCC::FEM_Triangle_PCC_2D_ReferenceElement_Data &reference_element_data, const Polydim::FEM::PCC::FEM_Triangle_PCC_2D_LocalSpace_Data &local_space) const
Definition FEM_Triangle_PCC_2D_LocalSpace.hpp:55
Definition FEM_MCC_2D_LocalSpace.cpp:17
Definition MapTetrahedron.hpp:24
Definition QuadratureData.hpp:22
Definition FEM_PCC_3D_LocalSpace_Data.hpp:41
Definition FEM_PCC_3D_LocalSpace_Data.hpp:79
Eigen::MatrixXd Dofs
Definition FEM_PCC_3D_LocalSpace_Data.hpp:83
Gedim::MapTetrahedron::MapTetrahedronData MapData
Definition FEM_PCC_3D_LocalSpace_Data.hpp:80
std::array< unsigned int, 7 > Dof1DsIndex
Definition FEM_PCC_3D_LocalSpace_Data.hpp:91
std::array< unsigned int, 5 > Dof2DsIndex
Definition FEM_PCC_3D_LocalSpace_Data.hpp:92
std::array< Polydim::FEM::PCC::FEM_Triangle_PCC_2D_LocalSpace_Data, 4 > Boundary_LocalSpace_Data
Definition FEM_PCC_3D_LocalSpace_Data.hpp:95
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:28
Polydim::FEM::PCC::FEM_Triangle_PCC_2D_ReferenceElement_Data BoundaryReferenceElement_Data
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:50
unsigned int NumDofs1D
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:32
std::vector< Eigen::MatrixXd > ReferenceBasisFunctionDerivativeValues
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:47
unsigned int NumDofs2D
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:33
Polydim::FEM::PCC::FEM_PCC_1D_ReferenceElement_Data EdgeReferenceElement_Data
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:49
Eigen::MatrixXd ReferenceBasisFunctionValues
Definition FEM_Tetrahedron_PCC_3D_ReferenceElement.hpp:46