27 typedef std::function<Eigen::Vector3d(
const Eigen::Vector3d &)>
vector;
28 std::variant<scalar,vector>
func;
29 int dqr[4] = {-1,-1,-1,-1};
39 inline int degree()
const {
return _r;}
42 Eigen::VectorXd
interpolate(
const DDR_function_type &,
size_t k)
const;
45 const Eigen::MatrixXd &
full_diff(
size_t k,
size_t d,
size_t i_cell)
const;
47 Eigen::MatrixXd
compose_diff(
size_t k,
size_t d,
size_t i_cell)
const;
49 const Eigen::MatrixXd &
potential(
size_t k,
size_t d,
size_t i_cell)
const;
57 Eigen::Matrix<
double,-1,1,0,3,1>
evaluate_basis(Eigen::Vector3d
const &x,
size_t k,
size_t d,
size_t i_cell, Eigen::VectorXd
const &
b)
const;
86 struct DDR_Operators {
88 std::array<Eigen::MatrixXd,4>
diff;
89 std::array<Eigen::MatrixXd,4>
P;
97 std::unique_ptr<DDR_PEC> _ddr, _ddr_po;
98 std::array<GlobalDOFSpace,3+1> _dofspace;
99 std::array<std::vector<DDR_Operators>,4> _ops;
Definition ddr_spaces.hpp:19
Base class for global DOF spaces. Provides functions to manipulate global DOFs (the local version bei...
Definition globaldofspace.hpp:16
Class to describe a mesh.
Definition MeshND.hpp:17
@ Matrix
Definition basis.hpp:67
bool use_threads
Definition HHO_DiffAdvecReac.hpp:47
std::variant< scalar, vector > func
Definition ddr_spaces.hpp:28
int dqr[4]
Definition ddr_spaces.hpp:29
Eigen::MatrixXd computeL2Product(size_t k, size_t i_cell, const double penalty_factor=0.1) const
Computes the L2 product for discrete k-forms on the highest dimensional cell with index i_cell.
Definition ddr_spaces.cpp:328
Eigen::Matrix< double,-1,-1, 0, 3, 3 > get_exterior_trace(size_t k, size_t d, size_t i_cell) const
Trace of a k form from the global space to the mesh element of dimension d with index i_cell.
Definition ddr_spaces.cpp:318
Eigen::Matrix< double,-1,-1, 0, 3, 3 > get_hodge_star(size_t k, size_t d, size_t i_cell) const
Gets the continuous Hodge star on k forms on the mesh element of dimension d with index i.
Definition ddr_spaces.cpp:303
Eigen::MatrixXd discrete_inv_hodge_star(size_t k, size_t d, size_t i_cell) const
e.g. discrete_inv_hodge_star(d-k, d, i_cell) * potential(k, d, i_cell) is the potential P^k in PL(r,...
Definition ddr_spaces.cpp:313
Eigen::MatrixXd discrete_hodge_star(size_t k, size_t d, size_t i_cell) const
Takes a k form on the polynomial k basis to a d-k form on the d-k basis (deals with scaling) on the m...
Definition ddr_spaces.cpp:308
std::array< Eigen::MatrixXd, 4 > diff
Definition ddr_spaces.hpp:88
const Eigen::MatrixXd & full_diff(size_t k, size_t d, size_t i_cell) const
Returns \star d in PL(r,d-k-1,d), the Hodge star of the full discrete exterior derivative of a discre...
Definition ddr_spaces.cpp:285
std::array< Eigen::MatrixXd, 4 > full_diff
Definition ddr_spaces.hpp:87
DDR_PEC::Kronecker get_mass(size_t k, size_t d, size_t i_cell) const
Returns the mass matrix for the k-forms on the mesh element of dimension d with index i_cell.
Definition ddr_spaces.cpp:323
GlobalDOFSpace const & dofspace(size_t k) const
Returns the dofspace associated to discrete k-forms.
Definition ddr_spaces.hpp:52
const Eigen::MatrixXd & potential(size_t k, size_t d, size_t i_cell) const
Returns \star P^k in PL(r,d-k,d), the Hodge star of the potential of a discrete k-form on the mesh el...
Definition ddr_spaces.cpp:290
Eigen::MatrixXd compose_diff(size_t k, size_t d, size_t i_cell) const
Returns \star \ul{d}^k in PLtrimmed(r,d-k-1,d) on the cell (including its boundary),...
Definition ddr_spaces.cpp:238
Eigen::KroneckerProduct< Eigen::MatrixXd, Eigen::MatrixXd > Kronecker
Definition ddr_pec.hpp:21
std::function< Eigen::Vector3d(const Eigen::Vector3d &)> vector
Definition ddr_spaces.hpp:27
std::function< double(const Eigen::Vector3d &)> scalar
Definition ddr_spaces.hpp:26
std::array< Eigen::MatrixXd, 4 > P
Definition ddr_spaces.hpp:89
Eigen::Matrix< double,-1, 1, 0, 3, 1 > evaluate_basis(Eigen::Vector3d const &x, size_t k, size_t d, size_t i_cell, Eigen::VectorXd const &b) const
Evaluate at point x, the sum of the coefficients b times the basis of PL(r,k,d) in the cell with inde...
Definition ddr_spaces.cpp:295
std::vector< VectorRd > computeVertexValues(size_t k, const Eigen::VectorXd &u) const
Computes the averaged vertex values of a discrete k-form u using the potential.
Definition ddr_spaces.cpp:415
const Mesh & mesh() const
Return the mesh.
Definition ddr_spaces.hpp:33
int degree() const
Return the polynomial degree.
Definition ddr_spaces.hpp:39
Eigen::VectorXd interpolate(const DDR_function_type &, size_t k) const
Returns the interpolate of the given function as a k-form.
Definition ddr_spaces.cpp:177
Definition ddr-magnetostatics.hpp:41
Definition ddr_spaces.hpp:25