34 template<
size_t dimension>
39 bool use_threads =
true,
40 std::array<int,dimension>
const * dqr_p =
nullptr,
41 std::ostream & output = std::cout
46 double getTopScaling(
size_t i_cell )
const {
return _listScales[i_cell];}
49 Eigen::MatrixXd
get_mass(
size_t k ,
size_t d ,
size_t i_cell )
const;
52 Eigen::MatrixXd
get_trace(
size_t k ,
size_t d ,
size_t i_cell ,
size_t j_bd )
const;
55 Eigen::MatrixXd
get_starTrace(
size_t k ,
size_t d ,
size_t i_cell ,
size_t j_bd )
const;
60 const Eigen::MatrixXd &
get_diff(
size_t l ,
size_t d )
const {
return _list_diff[_cmp_ind(l,d)];}
63 const Eigen::MatrixXd &
get_Koszul(
size_t l ,
size_t d )
const {
return _list_Koszul[_cmp_ind(l,d)];}
66 const Eigen::MatrixXd &
get_diff_as_degr(
size_t l ,
size_t d )
const {
return _list_diff_as_degr[_cmp_ind(l,d)];}
69 const Eigen::MatrixXd &
get_trimmed(
size_t l ,
size_t d )
const {
return _list_trimmed[_cmp_ind(l,d)];}
72 const Eigen::MatrixXd &
get_reduced_Koszul_m1(
size_t l ,
size_t d )
const {
return _list_reduced_Koszul_m1[_cmp_ind(l,d)];}
75 template<
size_t d,
size_t l>
void _fill_lists();
76 inline int _cmp_ind(
size_t l,
size_t d)
const {
return _dim_table[d-1]+l;}
79 std::array<size_t,dimension+1> _dim_table;
80 std::vector<Eigen::MatrixXd> _list_diff,
84 _list_reduced_Koszul_m1;
85 std::vector<double> _listScales;
86 template<
size_t _dimension,
size_t _d>
87 class dCellVariableList {
89 std::vector<dCell_mass<_dimension,_d>> _mass;
90 std::vector<dCell_traces<_dimension,_d>> _traces;
91 dCellVariableList<_dimension,_d-1> _dCVL;
93 template<
size_t d> std::vector<dCell_mass<_dimension,d>> & mass() {
94 if constexpr(d==_d)
return _mass;
95 else return _dCVL.template mass<d>();
97 template<
size_t d> std::vector<dCell_mass<_dimension,d>> mass()
const {
98 if constexpr(d==_d)
return _mass;
99 else return _dCVL.template mass<d>();
101 template<
size_t d> std::vector<dCell_traces<_dimension,d>> & traces() {
102 if constexpr(d==_d)
return _traces;
103 else return _dCVL.template traces<d>();
105 template<
size_t d> std::vector<dCell_traces<_dimension,d>> traces()
const {
106 if constexpr(d==_d)
return _traces;
107 else return _dCVL.template traces<d>();
111 template<
size_t _dimension>
112 class dCellVariableList<_dimension,1> {
114 std::vector<dCell_mass<_dimension,1>> _mass;
115 std::vector<dCell_traces<_dimension,1>> _traces;
117 template<
size_t d> std::vector<dCell_mass<_dimension,d>> & mass() {
118 static_assert(d == 1);
121 template<
size_t d> std::vector<dCell_mass<_dimension,d>> mass()
const {
122 static_assert(d == 1);
125 template<
size_t d> std::vector<dCell_traces<_dimension,d>> & traces() {
126 static_assert(d == 1);
129 template<
size_t d> std::vector<dCell_traces<_dimension,d>> traces()
const {
130 static_assert(d == 1);
135 dCellVariableList<dimension,dimension> _dCellList;
Main data structure for the mesh.
Definition: mesh.hpp:54
Implement the discrete spaces of DDR-PEC.
Definition: pec.hpp:35
const Eigen::MatrixXd & get_diff_as_degr(size_t l, size_t d) const
Return the image of the differential operator.
Definition: pec.hpp:66
Eigen::MatrixXd get_starTrace(size_t k, size_t d, size_t i_cell, size_t j_bd) const
Return the Hodge dual of the trace for the Hodge dual of -forms on the i-th d-cell onto its j-th (d-1...
Definition: pec.cpp:195
const Eigen::MatrixXd & get_reduced_Koszul_m1(size_t l, size_t d) const
Return the image of the Koszul operator.
Definition: pec.hpp:72
Eigen::MatrixXd get_trace(size_t k, size_t d, size_t i_cell, size_t j_bd) const
Return the trace for the k-forms on the i-th d-cell onto its j-th (d-1)-neighbour.
Definition: pec.cpp:176
const Eigen::MatrixXd & get_trimmed(size_t l, size_t d) const
Return the image of the trimmed polynomial basis.
Definition: pec.hpp:69
PEC(Mesh< dimension > const &mesh, int r, bool use_threads=true, std::array< int, dimension > const *dqr_p=nullptr, std::ostream &output=std::cout)
Definition: pec.cpp:30
Eigen::MatrixXd get_mass(size_t k, size_t d, size_t i_cell) const
Return the mass matrix for the k-forms on the i-th d-cell in the basis PL(r,k,d)
Definition: pec.cpp:158
const Eigen::MatrixXd & get_Koszul(size_t l, size_t d) const
Return the image of the Koszul operator.
Definition: pec.hpp:63
const Eigen::MatrixXd & get_diff(size_t l, size_t d) const
Return the image of the differential operator.
Definition: pec.hpp:60
double getTopScaling(size_t i_cell) const
Return the characteristic scale of a top dimensional cell .
Definition: pec.hpp:46
Compute the mass matrices and traces operator of a cell.
Definition: maxwell.hpp:21