PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
LocalSpace_PCC_2D.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 __LocalSpace_PCC_2D_H
13#define __LocalSpace_PCC_2D_H
14
15#include "DOFsManager.hpp"
17#include "IArray.hpp"
20#include "MeshUtilities.hpp"
21#include "QuadratureData.hpp"
26
27namespace Polydim
28{
29namespace PDETools
30{
31
41namespace LocalSpace_PCC_2D
42{
44enum struct MethodTypes
45{
46 FEM_PCC = 0,
47 VEM_PCC = 1,
48 VEM_PCC_Inertia = 2,
49 VEM_PCC_Ortho = 3,
50 ZFEM_PCC = 4,
51};
52
59{
60 public:
62 unsigned int Order;
63
64 std::unique_ptr<Polydim::VEM::PCC::I_VEM_PCC_2D_ReferenceElement> VEM_ReferenceElement;
67 std::unique_ptr<Polydim::VEM::PCC::I_VEM_PCC_2D_LocalSpace> VEM_LocalSpace;
68
69 std::unique_ptr<Polydim::FEM::PCC::FEM_PCC_2D_ReferenceElement> FEM_ReferenceElement;
71 std::unique_ptr<Polydim::FEM::PCC::FEM_PCC_2D_LocalSpace> FEM_LocalSpace;
72
73 std::unique_ptr<Polydim::ZFEM::PCC::I_ZFEM_PCC_2D_ReferenceElement> ZFEM_ReferenceElement;
75 std::unique_ptr<ZFEM::PCC::I_ZFEM_PCC_2D_LocalSpace> ZFEM_LocalSpace;
76};
77
94
110
120 const unsigned int method_order);
121
131
143 const Gedim::MeshMatricesDAO &mesh,
144 const std::map<unsigned int, Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo::BoundaryInfo> &boundary_info);
145
158LocalSpace_Data CreateLocalSpace(const double &geometric_tolerance_1D,
159 const double &geometric_tolerance_2D,
160 const Gedim::MeshUtilities::MeshGeometricData2D &mesh_geometric_data,
161 const unsigned int cell2D_index,
163
173
181Eigen::MatrixXd BasisFunctionsValues(const ReferenceElement_Data &reference_element_data,
182 const LocalSpace_Data &local_space_data,
183 const Eigen::MatrixXd &points,
185
193Eigen::MatrixXd BasisFunctionsValuesOnEdge(const unsigned int &edge_local_index,
196 const Eigen::MatrixXd &pointsCurvilinearCoordinates);
197
205std::vector<Eigen::MatrixXd> BasisFunctionsDerivativeValues(
209
218std::vector<Eigen::MatrixXd> BasisFunctionsDerivativeValues(
221 const Eigen::MatrixXd &points,
223
231Eigen::MatrixXd BasisFunctionsLaplacianValues(
235
247Eigen::MatrixXd StabilizationMatrix(const Polydim::PDETools::LocalSpace_PCC_2D::ReferenceElement_Data &reference_element_data,
250
257Eigen::MatrixXd EdgeDofsCoordinates(const Polydim::PDETools::LocalSpace_PCC_2D::ReferenceElement_Data &reference_element_data,
259 const unsigned int edge_local_index);
260
268
279Eigen::VectorXd InternalDofs(const ReferenceElement_Data &reference_element_data,
281 const Eigen::VectorXd &values_at_dofs,
282 const Gedim::Quadrature::QuadratureData &internal_dofs_coordinates);
283
291
297unsigned int Size(const Polydim::PDETools::LocalSpace_PCC_2D::ReferenceElement_Data &reference_element_data,
299
308
323void export_dofs(const Gedim::GeometryUtilities &geometry_utilities,
324 const Gedim::MeshMatricesDAO &mesh,
325 const Gedim::MeshUtilities::MeshGeometricData2D &mesh_geometric_data,
328 const Gedim::IArray &right_hand_side,
329 const Gedim::IArray &solution,
330 const Gedim::IArray &solution_strongs,
331 const std::string &file_path);
332
333} // namespace LocalSpace_PCC_2D
334} // namespace PDETools
335} // namespace Polydim
336
337#endif
The GeometryUtilities class intersects 3D segments.
Definition GeometryUtilities.hpp:37
Interface used for column double Array.
Definition IArray.hpp:23
Definition IMeshDAO.hpp:1068
Per-cell local-space data for the 2D PCC local space.
Definition LocalSpace_PCC_2D.hpp:83
Polydim::FEM::PCC::FEM_PCC_2D_LocalSpace_Data FEM_LocalSpace_Data
Definition LocalSpace_PCC_2D.hpp:89
Polydim::VEM::PCC::VEM_PCC_2D_LocalSpace_Data VEM_LocalSpace_Data
Definition LocalSpace_PCC_2D.hpp:86
Polydim::ZFEM::PCC::ZFEM_PCC_2D_LocalSpace_Data ZFEM_LocalSpace_Data
Definition LocalSpace_PCC_2D.hpp:92
Polydim::VEM::PCC::VEM_PCC_2D_Polygon_Geometry VEM_Geometry
Definition LocalSpace_PCC_2D.hpp:85
Polydim::FEM::PCC::FEM_PCC_2D_Polygon_Geometry FEM_Geometry
Definition LocalSpace_PCC_2D.hpp:88
Polydim::ZFEM::PCC::ZFEM_PCC_2D_Polygon_Geometry ZFEM_Geometry
Definition LocalSpace_PCC_2D.hpp:91
Polydim::VEM::PCC::VEM_PCC_PerformanceAnalysis_Data vem_analysis_data
Definition LocalSpace_PCC_2D.hpp:104
ZFEM::PCC::ZFEM_PCC_PerformanceAnalysis_Data zfem_analysis_data
Definition LocalSpace_PCC_2D.hpp:105
unsigned int NumInternalQuadraturePoints
Definition LocalSpace_PCC_2D.hpp:103
unsigned int NumBoundaryQuadraturePoints
Definition LocalSpace_PCC_2D.hpp:102
Performance metrics collected on a single 2D cell.
Definition LocalSpace_PCC_2D.hpp:97
Polydim::PDETools::LocalSpace_PCC_2D::Performance_Data::Cell2D_Performance performance_data
Definition LocalSpace_PCC_2D.hpp:108
Method-specific reference-element data for the 2D PCC local space.
Definition LocalSpace_PCC_2D.hpp:59
Polydim::VEM::PCC::VEM_PCC_2D_LocalSpace_Types VEM_Type
Definition LocalSpace_PCC_2D.hpp:66
Polydim::VEM::PCC::VEM_PCC_2D_ReferenceElement_Data VEM_ReferenceElement_Data
Definition LocalSpace_PCC_2D.hpp:65
Polydim::PDETools::LocalSpace_PCC_2D::MethodTypes Method_Type
Selected discretization method.
Definition LocalSpace_PCC_2D.hpp:61
std::unique_ptr< Polydim::FEM::PCC::FEM_PCC_2D_LocalSpace > FEM_LocalSpace
Definition LocalSpace_PCC_2D.hpp:71
Polydim::FEM::PCC::FEM_PCC_2D_ReferenceElement_Data FEM_ReferenceElement_Data
Definition LocalSpace_PCC_2D.hpp:70
unsigned int Order
Polynomial order of the space.
Definition LocalSpace_PCC_2D.hpp:62
std::unique_ptr< Polydim::VEM::PCC::I_VEM_PCC_2D_ReferenceElement > VEM_ReferenceElement
Definition LocalSpace_PCC_2D.hpp:64
Polydim::ZFEM::PCC::ZFEM_PCC_2D_ReferenceElement_Data ZFEM_ReferenceElement_Data
Definition LocalSpace_PCC_2D.hpp:74
std::unique_ptr< Polydim::FEM::PCC::FEM_PCC_2D_ReferenceElement > FEM_ReferenceElement
Definition LocalSpace_PCC_2D.hpp:69
std::unique_ptr< ZFEM::PCC::I_ZFEM_PCC_2D_LocalSpace > ZFEM_LocalSpace
Definition LocalSpace_PCC_2D.hpp:75
std::unique_ptr< Polydim::ZFEM::PCC::I_ZFEM_PCC_2D_ReferenceElement > ZFEM_ReferenceElement
Definition LocalSpace_PCC_2D.hpp:73
std::unique_ptr< Polydim::VEM::PCC::I_VEM_PCC_2D_LocalSpace > VEM_LocalSpace
Definition LocalSpace_PCC_2D.hpp:67
Definition VEM_PCC_2D_LocalSpace_Data.hpp:44
Definition VEM_PCC_2D_LocalSpace_Data.hpp:27
Gedim::Quadrature::QuadratureData InternalQuadrature(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Internal quadrature rule of the cell.
Definition LocalSpace_PCC_2D.cpp:318
void export_dofs(const Gedim::GeometryUtilities &geometry_utilities, const Gedim::MeshMatricesDAO &mesh, const Gedim::MeshUtilities::MeshGeometricData2D &mesh_geometric_data, const Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo &mesh_dofs_info, const Polydim::PDETools::DOFs::DOFsManager::DOFsData &dofs_data, const Gedim::IArray &right_hand_side, const Gedim::IArray &solution, const Gedim::IArray &solution_strongs, const std::string &file_path)
Export the DOFs and solution fields to file for visualization.
Definition LocalSpace_PCC_2D.cpp:664
Eigen::MatrixXd BasisFunctionsValuesOnEdge(const unsigned int &edge_local_index, const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const Eigen::MatrixXd &pointsCurvilinearCoordinates)
Evaluate the basis functions on a given edge.
Definition LocalSpace_PCC_2D.cpp:239
ReferenceElement_Data CreateReferenceElement(const MethodTypes &method_type, const unsigned int method_order)
Create the reference element for the chosen method and order.
Definition LocalSpace_PCC_2D.cpp:26
Eigen::MatrixXd EdgeDofsCoordinates(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const unsigned int edge_local_index)
Coordinates of the DOFs associated with a given edge.
Definition LocalSpace_PCC_2D.cpp:384
Performance_Data ComputePerformance(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Compute the per-cell performance metrics of the local space.
Definition LocalSpace_PCC_2D.cpp:615
Eigen::MatrixXd BasisFunctionsLaplacianValues(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const Polydim::VEM::PCC::ProjectionTypes &projectionType)
Evaluate the basis-function Laplacians at the internal quadrature points.
Definition LocalSpace_PCC_2D.cpp:218
LocalSpace_Data CreateLocalSpace(const double &geometric_tolerance_1D, const double &geometric_tolerance_2D, const Gedim::MeshUtilities::MeshGeometricData2D &mesh_geometric_data, const unsigned int cell2D_index, const ReferenceElement_Data &reference_element_data)
Build the local space on a given cell.
Definition LocalSpace_PCC_2D.cpp:102
Gedim::Quadrature::QuadratureData InternalDofsCoordinates(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Coordinates (and weights) of the internal DOFs of the cell.
Definition LocalSpace_PCC_2D.cpp:448
Eigen::MatrixXd BasisFunctionsValues(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const Polydim::VEM::PCC::ProjectionTypes &projectionType)
Evaluate the basis functions at the internal quadrature points.
Definition LocalSpace_PCC_2D.cpp:170
Eigen::VectorXd InternalDofs(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const Eigen::VectorXd &values_at_dofs, const Gedim::Quadrature::QuadratureData &internal_dofs_coordinates)
Compute the internal DOF values of a function.
Definition LocalSpace_PCC_2D.cpp:483
std::vector< Eigen::MatrixXd > BasisFunctionsDerivativeValues(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const VEM::PCC::ProjectionTypes &projectionType)
Evaluate the basis-function derivatives at the internal quadrature points.
Definition LocalSpace_PCC_2D.cpp:269
Gedim::MeshUtilities::MeshGeometricData2DConfig MeshGeometricDataConfigiguration(const ReferenceElement_Data &reference_element_data)
Geometric-data configuration required by the selected method.
Definition LocalSpace_PCC_2D.cpp:79
unsigned int Size(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Number of local degrees of freedom of the cell.
Definition LocalSpace_PCC_2D.cpp:339
Eigen::MatrixXd StabilizationMatrix(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const VEM::PCC::ProjectionTypes &projectionType)
Compute the (VEM) stabilization matrix of the local space.
Definition LocalSpace_PCC_2D.cpp:359
MethodTypes
Discretization method for the 2D PCC local space.
Definition LocalSpace_PCC_2D.hpp:45
@ VEM_PCC_Inertia
VEM with an inertia-based (principal-axes) monomial basis. .
@ VEM_PCC_Ortho
VEM with an -orthonormalized monomial basis. .
@ VEM_PCC
Virtual Element Method (standard monomial basis). .
@ ZFEM_PCC
Zipped Finite Element Method. .
PDETools::DOFs::DOFsManager::MeshDOFsInfo SetMeshDOFsInfo(const ReferenceElement_Data &reference_element_data, const Gedim::MeshMatricesDAO &mesh, const std::map< unsigned int, Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo::BoundaryInfo > &boundary_info)
Build the degrees-of-freedom layout over the mesh.
Definition LocalSpace_PCC_2D.cpp:510
ProjectionTypes
Definition VEM_PCC_Utilities.hpp:28
VEM_PCC_2D_LocalSpace_Types
Definition VEM_PCC_2D_Creator.hpp:31
Definition FEM_MCC_2D_LocalSpace.cpp:17
Definition MeshUtilities.hpp:167
Definition MeshUtilities.hpp:149
Definition QuadratureData.hpp:22
Definition FEM_PCC_2D_LocalSpace_Data.hpp:83
Definition FEM_PCC_2D_LocalSpace_Data.hpp:38
Definition FEM_PCC_2D_ReferenceElement.hpp:27
Full DOF numbering produced for a mesh: local/global indices and aggregate counts.
Definition DOFsManager.hpp:116
Definition I_VEM_PCC_2D_ReferenceElement.hpp:26
Definition VEM_PCC_PerformanceAnalysis.hpp:28
Definition ZFEM_PCC_2D_LocalSpace_Data.hpp:43
Definition ZFEM_PCC_2D_LocalSpace_Data.hpp:26
Reference-element data for the 2D primal conforming ZFEM (Zipped FEM) space.
Definition I_ZFEM_PCC_2D_ReferenceElement.hpp:36
Definition ZFEM_PCC_PerformanceAnalysis.hpp:25