PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
LocalSpace_DF_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_DF_PCC_2D_H
13#define __LocalSpace_DF_PCC_2D_H
14
16#include "DOFsManager.hpp"
18#include "IArray.hpp"
23#include <memory>
24
25namespace Polydim
26{
27namespace PDETools
28{
29
39namespace LocalSpace_DF_PCC_2D
40{
42enum struct MethodTypes
43{
44 TAYLOR_HOOD = 0,
45 VEM_DF_PCC_FULL = 1,
47};
48
55{
56 public:
58 unsigned int Order;
59 unsigned int Dimension = 2;
60
62 std::unique_ptr<Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Velocity_ReferenceElement> VEM_Velocity_ReferenceElement;
64 std::unique_ptr<Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Pressure_ReferenceElement> VEM_Pressure_ReferenceElement;
66 std::unique_ptr<Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Velocity_LocalSpace> VEM_Velocity_LocalSpace;
67 std::unique_ptr<Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Pressure_LocalSpace> VEM_Pressure_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
88
103
113 const unsigned int method_order);
114
125std::vector<Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo> SetMeshDOFsInfo(
127 const Gedim::MeshMatricesDAO &mesh,
128 const std::array<Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo::BoundaryMap, 2> &boundary_info);
129
141LocalSpace_Data CreateLocalSpace(const double &geometric_tolerance_1D,
142 const double &geometric_tolerance_2D,
143 const Gedim::MeshUtilities::MeshGeometricData2D &mesh_geometric_data,
144 const unsigned int cell2D_index,
146
153std::vector<Eigen::MatrixXd> VelocityBasisFunctionsValues(
157
165std::vector<Eigen::MatrixXd> VelocityBasisFunctionsValues(
166 const ReferenceElement_Data &reference_element_data,
167 const LocalSpace_Data &local_space_data,
168 const Eigen::MatrixXd &points,
170
178
185Eigen::MatrixXd PressureBasisFunctionsValues(const ReferenceElement_Data &reference_element_data,
186 const LocalSpace_Data &local_space_data,
187 const Eigen::MatrixXd &points);
188
196std::vector<Eigen::MatrixXd> VelocityBasisFunctionsDerivativeValues(
200
209std::vector<Eigen::MatrixXd> VelocityBasisFunctionsDerivativeValues(
212 const Eigen::MatrixXd &points,
214
225
233
241Eigen::MatrixXd VelocityBasisFunctionsValuesOnEdge(const unsigned int &edge_local_index,
244 const Eigen::MatrixXd &pointsCurvilinearCoordinates);
245
256Eigen::MatrixXd VelocityStabilizationMatrix(
260
269 const unsigned int edge_local_index);
270
278
287
304void export_velocity_dofs(const Gedim::GeometryUtilities &geometry_utilities,
305 const Gedim::MeshMatricesDAO &mesh,
306 const Gedim::MeshUtilities::MeshGeometricData2D &mesh_geometric_data,
307 const std::vector<Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo> &mesh_dofs_info,
308 const std::vector<DOFs::DOFsManager::DOFsData> &dofs_data,
310 const Gedim::IArray &right_hand_side,
311 const Gedim::IArray &solution,
312 const Gedim::IArray &solution_strongs,
313 const std::string &file_path);
314
315} // namespace LocalSpace_DF_PCC_2D
316} // namespace PDETools
317} // namespace Polydim
318
319#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 DF_PCC local space.
Definition LocalSpace_DF_PCC_2D.hpp:79
Polydim::VEM::DF_PCC::VEM_DF_PCC_2D_Polygon_Geometry VEM_Geometry
Definition LocalSpace_DF_PCC_2D.hpp:81
Polydim::VEM::DF_PCC::VEM_DF_PCC_2D_Pressure_LocalSpace_Data VEM_Pressure_LocalSpace_Data
Definition LocalSpace_DF_PCC_2D.hpp:83
Polydim::FEM::PCC::FEM_PCC_2D_Polygon_Geometry FEM_Geometry
Definition LocalSpace_DF_PCC_2D.hpp:85
Polydim::VEM::DF_PCC::VEM_DF_PCC_2D_Velocity_LocalSpace_Data VEM_Velocity_LocalSpace_Data
Definition LocalSpace_DF_PCC_2D.hpp:82
Polydim::FEM::PCC::FEM_PCC_2D_LocalSpace_Data FEM_LocalSpace_Data
Definition LocalSpace_DF_PCC_2D.hpp:86
unsigned int NumBoundaryQuadraturePoints
Definition LocalSpace_DF_PCC_2D.hpp:96
Polydim::VEM::DF_PCC::VEM_DF_PCC_PerformanceAnalysis_Data vem_analysis_data
Definition LocalSpace_DF_PCC_2D.hpp:98
unsigned int NumInternalQuadraturePoints
Definition LocalSpace_DF_PCC_2D.hpp:97
Per-cell performance metrics for the 2D DF_PCC local space.
Definition LocalSpace_DF_PCC_2D.hpp:91
Polydim::PDETools::LocalSpace_DF_PCC_2D::Performance_Data::Cell2D_Performance performance_data
Definition LocalSpace_DF_PCC_2D.hpp:101
Method-specific reference-element data for the 2D DF_PCC local space.
Definition LocalSpace_DF_PCC_2D.hpp:55
std::unique_ptr< Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Pressure_LocalSpace > VEM_Pressure_LocalSpace
Definition LocalSpace_DF_PCC_2D.hpp:67
std::unique_ptr< Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Velocity_LocalSpace > VEM_Velocity_LocalSpace
Definition LocalSpace_DF_PCC_2D.hpp:66
unsigned int Dimension
Definition LocalSpace_DF_PCC_2D.hpp:59
std::unique_ptr< Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Pressure_ReferenceElement > VEM_Pressure_ReferenceElement
Definition LocalSpace_DF_PCC_2D.hpp:64
std::unique_ptr< Polydim::FEM::PCC::FEM_PCC_2D_ReferenceElement > FEM_ReferenceElement
Definition LocalSpace_DF_PCC_2D.hpp:69
unsigned int Order
Definition LocalSpace_DF_PCC_2D.hpp:58
Polydim::VEM::DF_PCC::VEM_DF_PCC_2D_Pressure_ReferenceElement_Data VEM_Pressure_ReferenceElement_Data
Definition LocalSpace_DF_PCC_2D.hpp:65
std::unique_ptr< Polydim::VEM::DF_PCC::I_VEM_DF_PCC_2D_Velocity_ReferenceElement > VEM_Velocity_ReferenceElement
Definition LocalSpace_DF_PCC_2D.hpp:62
Polydim::FEM::PCC::FEM_PCC_2D_ReferenceElement_Data FEM_ReferenceElement_Data
Definition LocalSpace_DF_PCC_2D.hpp:70
Polydim::VEM::DF_PCC::VEM_DF_PCC_2D_Velocity_ReferenceElement_Data VEM_Velocity_ReferenceElement_Data
Definition LocalSpace_DF_PCC_2D.hpp:63
Polydim::PDETools::LocalSpace_DF_PCC_2D::MethodTypes Method_Type
Definition LocalSpace_DF_PCC_2D.hpp:57
std::unique_ptr< Polydim::FEM::PCC::FEM_PCC_2D_LocalSpace > FEM_LocalSpace
Definition LocalSpace_DF_PCC_2D.hpp:71
Polydim::VEM::DF_PCC::VEM_DF_PCC_2D_LocalSpace_Types VEM_Type
Definition LocalSpace_DF_PCC_2D.hpp:61
std::vector< Eigen::MatrixXd > VelocityBasisFunctionsValues(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const Polydim::VEM::DF_PCC::ProjectionTypes &projectionType)
Evaluate the (vector) velocity basis functions at the internal quadrature points.
Definition LocalSpace_DF_PCC_2D.cpp:111
std::vector< PDETools::DOFs::DOFsManager::MeshDOFsInfo > SetMeshDOFsInfo(const ReferenceElement_Data &reference_element_data, const Gedim::MeshMatricesDAO &mesh, const std::array< std::map< unsigned int, Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo::BoundaryInfo >, 2 > &boundary_info)
Definition LocalSpace_DF_PCC_2D.cpp:342
Eigen::MatrixXd VelocityBasisFunctionsValuesOnEdge(const unsigned int &edge_local_index, const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const Eigen::MatrixXd &pointsCurvilinearCoordinates)
Evaluate the velocity basis functions on a given edge.
Definition LocalSpace_DF_PCC_2D.cpp:199
unsigned int VelocitySize(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Number of local velocity degrees of freedom of the cell.
Definition LocalSpace_DF_PCC_2D.cpp:274
std::vector< Eigen::MatrixXd > VelocityBasisFunctionsDerivativeValues(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const VEM::DF_PCC::ProjectionTypes &projectionType)
Evaluate the velocity basis-function derivatives at the internal quadrature points.
Definition LocalSpace_DF_PCC_2D.cpp:220
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_DF_PCC_2D.cpp:461
ReferenceElement_Data CreateReferenceElement(const MethodTypes &method_type, const unsigned int method_order)
Create the velocity/pressure reference elements for the chosen method and order.
Definition LocalSpace_DF_PCC_2D.cpp:24
Eigen::MatrixXd PressureBasisFunctionsValues(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Evaluate the (scalar) pressure basis functions at the internal quadrature points.
Definition LocalSpace_DF_PCC_2D.cpp:150
Eigen::MatrixXd VelocityStabilizationMatrix(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const VEM::DF_PCC::ProjectionTypes &projectionType)
Compute the (VEM) velocity stabilization matrix of the local space.
Definition LocalSpace_DF_PCC_2D.cpp:288
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 coupled velocity/pressure local space on a given cell.
Definition LocalSpace_DF_PCC_2D.cpp:70
MethodTypes
Discretization method for the 2D DF_PCC velocity/pressure pair.
Definition LocalSpace_DF_PCC_2D.hpp:43
@ VEM_DF_PCC_REDUCED
Divergence-free VEM, reduced velocity space. .
@ TAYLOR_HOOD
Taylor–Hood finite element velocity/pressure pair.
@ VEM_DF_PCC_FULL
Divergence-free VEM, full velocity space. .
Gedim::Quadrature::QuadratureData InternalQuadrature(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Internal quadrature rule of the cell.
Definition LocalSpace_DF_PCC_2D.cpp:259
void export_velocity_dofs(const Gedim::GeometryUtilities &geometry_utilities, const Gedim::MeshMatricesDAO &mesh, const Gedim::MeshUtilities::MeshGeometricData2D &mesh_geometric_data, const std::vector< Polydim::PDETools::DOFs::DOFsManager::MeshDOFsInfo > &mesh_dofs_info, const std::vector< Polydim::PDETools::DOFs::DOFsManager::DOFsData > &dofs_data, const Polydim::PDETools::Assembler_Utilities::count_dofs_data &count_dofs, const Gedim::IArray &right_hand_side, const Gedim::IArray &solution, const Gedim::IArray &solution_strongs, const std::string &file_path)
Definition LocalSpace_DF_PCC_2D.cpp:491
Eigen::MatrixXd VelocityEdgeDofsCoordinates(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data, const unsigned int edge_local_index)
Coordinates of the velocity DOFs associated with a given edge.
Definition LocalSpace_DF_PCC_2D.cpp:305
Eigen::MatrixXd VelocityBasisFunctionsDivergenceValues(const ReferenceElement_Data &reference_element_data, const LocalSpace_Data &local_space_data)
Evaluate the velocity divergence at the internal quadrature points.
Definition LocalSpace_DF_PCC_2D.cpp:183
VEM_DF_PCC_2D_LocalSpace_Types
Definition VEM_DF_PCC_2D_Creator.hpp:30
ProjectionTypes
Definition VEM_DF_PCC_Utilities.hpp:28
Definition FEM_MCC_2D_LocalSpace.cpp:17
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
Definition Assembler_Utilities.hpp:33
Definition VEM_DF_PCC_2D_LocalSpace_Data.hpp:26
Definition VEM_DF_PCC_2D_LocalSpace_Data.hpp:108
Definition I_VEM_DF_PCC_2D_ReferenceElement.hpp:25
Definition VEM_DF_PCC_2D_LocalSpace_Data.hpp:42
Definition I_VEM_DF_PCC_2D_ReferenceElement.hpp:43
Definition VEM_DF_PCC_PerformanceAnalysis.hpp:28