PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
ZFEM_PCC_PerformanceAnalysis.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 __ZFEM_PCC_PerformanceAnalysis_HPP
13#define __ZFEM_PCC_PerformanceAnalysis_HPP
14
15#include "Eigen/Eigen"
16#include <vector>
17
18namespace Polydim
19{
20namespace ZFEM
21{
22namespace PCC
23{
25{
26 Eigen::VectorXd ConsistencyError;
27 std::vector<Eigen::VectorXd> DerivativesConsistencyError;
28};
29
31{
32 template <typename ZFEM_Monomials_Type, typename ZFEM_Monomials_Data_Type, typename ZFEM_LocalSpace_Type, typename ZFEM_LocalSpaceData_Type>
33 ZFEM_PCC_PerformanceAnalysis_Data Compute2D(const ZFEM_Monomials_Type &monomials,
34 const ZFEM_Monomials_Data_Type &monomials_data,
35 const ZFEM_LocalSpace_Type &,
36 const ZFEM_LocalSpaceData_Type &ZFEM_local_space_data) const
37 {
38 const Eigen::MatrixXd VanderInternal = monomials.Vander(monomials_data,
39 ZFEM_local_space_data.InternalQuadrature.Points,
40 ZFEM_local_space_data.KernelIncenter,
41 ZFEM_local_space_data.Diameter);
42
43 const auto VanderInternalDerivatives =
44 monomials.VanderDerivatives(monomials_data, VanderInternal, ZFEM_local_space_data.Diameter);
45
47 result.ConsistencyError = (ZFEM_local_space_data.ZFEM_basis_functions_values * ZFEM_local_space_data.Dmatrix - VanderInternal)
48 .array()
49 .square()
50 .matrix()
51 .transpose() *
52 ZFEM_local_space_data.InternalQuadrature.Weights;
53
54 result.DerivativesConsistencyError.resize(ZFEM_local_space_data.Dimension);
55 for (unsigned int d = 0; d < ZFEM_local_space_data.Dimension; d++)
57 (ZFEM_local_space_data.ZFEM_basis_functions_derivative_values[d] * ZFEM_local_space_data.Dmatrix -
58 VanderInternalDerivatives[d])
59 .array()
60 .square()
61 .matrix()
62 .transpose() *
63 ZFEM_local_space_data.InternalQuadrature.Weights;
64
65 return result;
66 }
67};
68
69} // namespace PCC
70} // namespace ZFEM
71} // namespace Polydim
72
73#endif
Definition FEM_MCC_2D_LocalSpace.cpp:17
Definition ZFEM_PCC_PerformanceAnalysis.hpp:25
std::vector< Eigen::VectorXd > DerivativesConsistencyError
Definition ZFEM_PCC_PerformanceAnalysis.hpp:27
Eigen::VectorXd ConsistencyError
Definition ZFEM_PCC_PerformanceAnalysis.hpp:26
Definition ZFEM_PCC_PerformanceAnalysis.hpp:31
ZFEM_PCC_PerformanceAnalysis_Data Compute2D(const ZFEM_Monomials_Type &monomials, const ZFEM_Monomials_Data_Type &monomials_data, const ZFEM_LocalSpace_Type &, const ZFEM_LocalSpaceData_Type &ZFEM_local_space_data) const
Definition ZFEM_PCC_PerformanceAnalysis.hpp:33