22 typedef std::function<Eigen::Vector2d(
const Eigen::Vector2d &)>
FunctionType;
29 const Eigen::MatrixXd &
_rotor,
48 return m_ddr_core.
mesh();
54 return m_ddr_core.
degree();
67 return *m_cell_operators[
iT];
73 return * m_cell_operators[
T.global_index()];
110 return m_ddr_core.
edgeBases(E.global_index());
140 template<
typename LeftOperatorFillerType,
typename RightOperatorFillerType>
154 const Eigen::VectorXd &
v,
159 LocalOperators _compute_cell_rotor_potential(
size_t iT);
160 double _compute_squared_l2_norm(
size_t iT,
const Eigen::VectorXd &
vT)
const;
161 double _compute_squared_gradient_l2_norm(
164 const Eigen::VectorXd &
vT
169 std::ostream & m_output;
175 std::vector<std::unique_ptr<LocalOperators> > m_cell_operators;
183 template<
typename LeftOperatorFillerType,
typename RightOperatorFillerType>
203 = [&
T, &
weight](
const Eigen::Vector2d &
x)->
double {
214 double hT =
T.diam();
216 size_t offset_PT =
T.n_vertices() + 2 *
T.n_edges();
222 for (
size_t iV = 0;
iV <
T.n_vertices();
iV++) {
223 const Vertex &
V = *
T.vertex(
iV);
237 for (
size_t iE = 0;
iE <
T.n_edges();
iE++) {
238 const Edge & E = *
T.edge(
iE);
Construct all polynomial spaces for the DDR sequence.
Definition ddrcore.hpp:63
Base class for global DOF spaces. Provides functions to manipulate global DOFs (the local version bei...
Definition globaldofspace.hpp:16
Discrete H1 space: local operators, L2 product and global interpolator.
Definition xgrad.hpp:17
Discrete HRotRot space: local operators, L2 product and global interpolator.
Definition xrotrot.hpp:20
for i
Definition convergence_analysis.m:48
Create grid points x
Definition generate_cartesian_mesh.m:22
Eigen::Vector2d VectorRd
Definition basis.hpp:55
double scalar_product(const double &x, const double &y)
Scalar product between two reals.
Definition basis.cpp:163
Eigen::MatrixXd compute_gram_matrix(const boost::multi_array< VectorRd, 2 > &B1, const boost::multi_array< double, 2 > &B2, const QuadratureRule &qr)
Compute the Gram-like matrix given a family of vector-valued and one of scalar-valued functions by te...
Definition basis.cpp:239
Eigen::MatrixXd compute_weighted_gram_matrix(const FType< VectorRd > &f, const BasisQuad< VectorRd > &B1, const BasisQuad< double > &B2, const QuadratureRule &qr, size_t n_rows, size_t n_cols)
Computes the Gram-like matrix of integrals (f dot phi_i, phi_j)
Definition basis.cpp:368
static boost::multi_array< typename detail::basis_evaluation_traits< BasisType, BasisFunction >::ReturnValue, 2 > compute(const BasisType &basis, const QuadratureRule &quad)
Generic basis evaluation.
Definition basis.hpp:2425
size_t localOffset(const Edge &E, const Vertex &V) const
Returns the local offset of the vertex V with respect to the edge E.
Definition localdofspace.hpp:143
size_t dimensionCell(const Cell &T) const
Returns the dimension of the local space on the cell T (including faces, edges and vertices)
Definition localdofspace.hpp:112
Eigen::MatrixXd computeGradientL2Product(size_t iT, const XGrad *x_grad, const double &penalty_factor=1., const IntegralWeight &weight=IntegralWeight(1.)) const
Compute the matrix of the (weighted) gradient-gradient L2-product.
Definition xrotrot.cpp:277
const Mesh & mesh() const
Return a const reference to the mesh.
Definition ddrcore.hpp:116
Eigen::MatrixXd computeGradientPotentialL2Product(size_t iT, const XGrad *x_grad, const double &penalty_factor=1., const IntegralWeight &weight=IntegralWeight(1.)) const
Compute the matrix of the (weighted) L2-product as 'computeL2Product', with application of the discre...
Definition xrotrot.cpp:256
const DDRCore::EdgeBases & edgeBases(size_t iE) const
Return edge bases for the edge of index iE.
Definition xrotrot.hpp:102
const size_t & degree() const
Return the polynomial degree.
Definition ddrcore.hpp:122
Eigen::MatrixXd cellRotor(size_t iT) const
Return cell rotor for cell of index iT.
Definition xrotrot.hpp:77
const Mesh & mesh() const
Return the mesh.
Definition xrotrot.hpp:46
double computeL2Norm(const Eigen::VectorXd &v) const
Compute the L2-norm of a vector of the space.
Definition xrotrot.cpp:320
Eigen::MatrixXd computeL2ProductWithOperatorFillers(size_t iT, const double &penalty_factor, const IntegralWeight &weight, LeftOperatorFillerType fillLeftOp, RightOperatorFillerType fillRightOp) const
Compute the matrix of the L2 product given operators filling functions.
Definition xrotrot.hpp:184
double computeGradientL2Norm(const Eigen::VectorXd &v, const XGrad *x_grad) const
Compute the L2-norm of the discrete gradient of a vector in XGrad.
Definition xrotrot.cpp:339
const LocalOperators & cellOperators(const Cell &T) const
Return cell operators for cell T.
Definition xrotrot.hpp:71
const CellBases & cellBases(size_t iT) const
Return cell bases for element iT.
Definition ddrcore.hpp:128
const LocalOperators & cellOperators(size_t iT) const
Return cell operators for the cell of index iT.
Definition xrotrot.hpp:65
const size_t & degree() const
Return the polynomial degree.
Definition xrotrot.hpp:52
std::function< double(const Eigen::Vector2d &)> RotType
Definition xrotrot.hpp:23
Eigen::MatrixXd computeL2Product(size_t iT, const double &penalty_factor=1., const IntegralWeight &weight=IntegralWeight(1.)) const
Compute the matrix of the (weighted) L2-product for the cell of index iT.
Definition xrotrot.cpp:237
const DDRCore::EdgeBases & edgeBases(const Edge &E) const
Return edge bases for edge E.
Definition xrotrot.hpp:108
LocalOperators(const Eigen::MatrixXd &_rotor, const Eigen::MatrixXd &_potential)
Definition xrotrot.hpp:28
const DDRCore::CellBases & cellBases(const Cell &T) const
Return cell bases for cell T.
Definition xrotrot.hpp:96
Eigen::MatrixXd cellRotor(const Cell &T) const
Return cell rotor for cell T.
Definition xrotrot.hpp:84
std::function< Eigen::Vector2d(const Eigen::Vector2d &)> FunctionType
Definition xrotrot.hpp:22
const DDRCore::CellBases & cellBases(size_t iT) const
Return cell bases for the cell of index iT.
Definition xrotrot.hpp:90
Eigen::VectorXd interpolate(const FunctionType &v, const RotType &rot_v, const int deg_quad=-1) const
Interpolator of a continuous function.
Definition xrotrot.cpp:55
const EdgeBases & edgeBases(size_t iE) const
Return edge bases for edge iE.
Definition ddrcore.hpp:136
Eigen::MatrixXd potential
Definition xrotrot.hpp:39
Eigen::MatrixXd rotor
Definition xrotrot.hpp:38
std::unique_ptr< PolyBasisCellType > Polyk
Definition ddrcore.hpp:86
bool use_threads
Definition HHO_DiffAdvecReac.hpp:45
Cell * cell(std::size_t index) const
get a constant pointer to a cell using its global index
Definition Mesh2D.hpp:178
std::vector< QuadratureNode > QuadratureRule
Definition quadraturerule.hpp:55
std::unordered_map< VectorZd, double, VecHash > MonomialCellIntegralsType
Type for list of integrals of monomials.
Definition GMpoly_cell.hpp:53
MonomialCellIntegralsType IntegrateCellMonomials(const Cell &T, const size_t maxdeg)
Compute all integrals on a cell of monomials up to a total degree, using vertex values.
Definition GMpoly_cell.cpp:7
Eigen::MatrixXd GramMatrix(const Cell &T, const MonomialScalarBasisCell &basis1, const MonomialScalarBasisCell &basis2, MonomialCellIntegralsType mono_int_map={})
Computes the Gram Matrix of a pair of local scalar monomial bases.
Definition GMpoly_cell.cpp:86
QuadratureRule generate_quadrature_rule(const Cell &T, const int doe, const bool force_split)
Generate quadrature rule on mesh element.
Definition quadraturerule.cpp:10
depending on the Matrix Market format indicated by or array(dense array storage). The data will be duplicated % as appropriate if symmetry is indicated in the header. % % Optionally
if(strcmp(field, 'real')) % real valued entries T
Definition mmread.m:93
cols
Definition mmread.m:87
Definition mhd-solutions.hpp:9
static auto v
Definition ddrcore-test.hpp:32
Structure to store element bases.
Definition ddrcore.hpp:81
Structure to store edge bases.
Definition ddrcore.hpp:103
Structure for weights (scalar, at the moment) in integral.
Definition integralweight.hpp:33
Basis dimensions for various polynomial spaces on edges/faces/elements (when relevant): Pk,...
Definition polynomialspacedimension.hpp:55
A structure to store the local operators (scalar rotor and potential)
Definition xrotrot.hpp:27
Evaluate a basis at quadrature nodes. 'BasisFunction' (=Function, Gradient, Curl, Divergence,...
Definition basis.hpp:2421