5#include <unsupported/Eigen/KroneckerProduct>
33 typedef std::function<Eigen::Vector2d(
const Eigen::Vector2d &)>
FunctionType;
38 const Eigen::MatrixXd & _rot,
39 const Eigen::MatrixXd & _potential
73 std::unique_ptr<Poly2BasisEdgeType>
Polyk2;
84 return m_sxgrad.
mesh();
105 const int doe_cell = -1
166 * Eigen::KroneckerProduct(m_sxgrad.
edgeGradient(iE), Eigen::Matrix2d::Identity());
181 * Eigen::KroneckerProduct(m_sxgrad.
edgePotential(iE), Eigen::Matrix2d::Identity());
198 Eigen::MatrixXd GradPermutedBasis
212 * Eigen::KroneckerProduct(GradPermutedBasis, Eigen::Matrix2d::Identity());
251 * Eigen::KroneckerProduct(m_sxgrad.
cellPotential(iT), Eigen::Matrix2d::Identity());
269 double hTm2 = std::pow(
mesh().cell(iT)->diam(), -2);
270 return hTm2 * Eigen::KroneckerProduct(m_sxgrad.
computeStabilisation(iT, weight), Eigen::Matrix2d::Identity());
275 const std::vector<Eigen::VectorXd> & list_dofs,
276 const std::string typegrad=
"full"
281 const Eigen::VectorXd & u
290 assert( m_cell_bases[iT] );
291 return *m_cell_bases[iT].get();
304 assert( m_edge_bases[iE] );
305 return *m_edge_bases[iE].get();
317 return *m_cell_operators[iT];
323 return *m_cell_operators[
T.global_index()];
328 EdgeBases _compute_edge_bases(
size_t iE);
329 CellBases _compute_cell_bases(
size_t iT);
337 std::vector<std::unique_ptr<CellBases> > m_cell_bases;
339 std::vector<std::unique_ptr<EdgeBases> > m_edge_bases;
342 std::ostream & m_output;
344 LocalOperators _compute_cell_operators(
size_t iT);
348 std::vector<std::unique_ptr<LocalOperators> > m_cell_operators;
Construct all polynomial spaces for the DDR sequence.
Definition ddrcore.hpp:63
Matrix family obtained from a scalar family.
Definition basis.hpp:721
Discrete Serendipity Hgrad space: local operators, L2 product and global interpolator.
Definition sxgrad.hpp:20
Construct all polynomial spaces for the DDR sequence.
Definition serendipity_problem.hpp:20
Vector family obtained by tensorization of a scalar family.
Definition basis.hpp:561
Vector version of sXgrad, the arbitrary order space with nodal primal unknowns.
Definition vsxgrad.hpp:30
Base class for global DOF spaces.
Definition variabledofspace.hpp:17
Eigen::MatrixXd PermuteTensorization(const size_t a, const size_t b)
Returns the matrix giving the permutation of the tensorization of a family of size a with a family of...
Definition basis.cpp:224
constexpr int dimspace
Dimension, and generic types for vector in correct dimension (makes it easier to translate a code bet...
Definition basis.hpp:53
const Eigen::MatrixXd cellPotential(size_t iT) const
Return the potential operator (expressed on Polykpo3) on the cell of index iT.
Definition vsxgrad.hpp:246
const size_t & degree() const
Return the polynomial degree.
Definition sxgrad.hpp:55
std::function< Eigen::Vector2d(const Eigen::Vector2d &)> FunctionType
Definition vsxgrad.hpp:33
const Mesh & mesh() const
Return the mesh.
Definition sxgrad.hpp:49
std::unique_ptr< PolyBasisEdgeType > Polykmo
Definition ddrcore.hpp:109
std::unique_ptr< Poly2x2BasisCellType > Polykpo2x2
Definition vsxgrad.hpp:66
const Eigen::MatrixXd edgeGradient(size_t iE) const
Return the gradient operator (expressed on Polyk3) on the edge of index iE.
Definition vsxgrad.hpp:161
std::unique_ptr< Poly2BasisEdgeType > Polyk2
Definition vsxgrad.hpp:73
const Eigen::MatrixXd cellDivergence(const Cell &T) const
Return the divergence operator (expressed on the ancester of Polyk3x3, which should be m_sxgrad....
Definition vsxgrad.hpp:240
const Eigen::MatrixXd cellDivergence(size_t iT) const
Return the divergence operator (expressed on the ancester of Polyk3x3, which should be m_sxgrad....
Definition vsxgrad.hpp:234
MatrixFamily< DDRCore::PolyBasisCellType, dimspace > Poly2x2BasisCellType
Definition vsxgrad.hpp:55
auto Polyk2(size_t iT) const -> const Poly2BasisCellType &
Definition vsxgrad.hpp:154
const SXGrad & sXgrad() const
Return the underlying sXgrad space.
Definition vsxgrad.hpp:88
std::unique_ptr< Poly2BasisEdgeType > Polykmo2
Definition vsxgrad.hpp:72
std::vector< double > computeH1norms(const std::vector< Eigen::VectorXd > &list_dofs, const std::string typegrad="full") const
Compute the H^1 discrete norm, with full or symmetric gradient.
Definition vsxgrad.cpp:237
const Eigen::MatrixXd cellSymGradient(const Cell &T) const
Return the symmetric gradient operator (expressed on Polyk3x3) on cell T.
Definition vsxgrad.hpp:228
std::unique_ptr< Poly2BasisCellType > Polykmo2
Definition ddrcore.hpp:91
std::unique_ptr< Poly2BasisCellType > Polykmo2
Definition vsxgrad.hpp:64
std::unique_ptr< Poly2BasisCellType > Polykptwo2
Definition vsxgrad.hpp:65
Eigen::VectorXd interpolate(const FunctionType &q, const int doe_cell=-1) const
Interpolator of a continuous function.
Definition vsxgrad.cpp:79
const LocalOperators & cellOperators(size_t iT) const
Return cell operators for the cell of index iT.
Definition vsxgrad.hpp:315
std::unique_ptr< PolyBasisEdgeType > Polykpo
Definition ddrcore.hpp:107
Eigen::MatrixXd potential
Definition vsxgrad.hpp:48
TensorizedVectorFamily< DDRCore::PolyBasisCellType, dimspace > Poly2BasisCellType
Definition vsxgrad.hpp:54
Family< MonomialScalarBasisCell > PolyBasisCellType
Definition vsxgrad.hpp:53
const EdgeBases & edgeBases(size_t iE) const
Return edge bases for the edge of index iE.
Definition vsxgrad.hpp:302
std::unique_ptr< PolyBasisCellType > Polykpo
Definition ddrcore.hpp:85
const Eigen::MatrixXd edgeGradient(const Edge &E) const
Return the gradient operator (expressed on Polyk3) on edge E.
Definition vsxgrad.hpp:170
TensorizedVectorFamily< DDRCore::PolyBasisEdgeType, dimspace > Poly2BasisEdgeType
Definition vsxgrad.hpp:59
std::vector< VectorRd > computeVertexValues(const Eigen::VectorXd &u) const
Computes the values of the potential reconstruction at the mesh vertices.
Definition vsxgrad.cpp:281
auto PolykpoE(size_t iE) const -> const PolyBasisEdgeType &
Definition vsxgrad.hpp:125
auto PolykptwoE(size_t iE) const -> const PolyBasisEdgeType &
Definition vsxgrad.hpp:129
const Eigen::MatrixXd cellPotential(const Cell &T) const
Return the potential operator on cell T.
Definition vsxgrad.hpp:255
auto PolykE(size_t iE) const -> const PolyBasisEdgeType &
Definition vsxgrad.hpp:122
std::unique_ptr< Poly2BasisEdgeType > Polykptwo2
Definition vsxgrad.hpp:75
const Eigen::MatrixXd edgePotential(size_t iE) const
Return the potential operator on the edge of index iE.
Definition sxgrad.hpp:134
Family< MonomialScalarBasisEdge > PolyBasisEdgeType
Definition vsxgrad.hpp:58
Eigen::MatrixXd rot
Definition vsxgrad.hpp:47
const EdgeBases & edgeBases(const Edge &E) const
Return edge bases for edge E.
Definition vsxgrad.hpp:309
const DDRCore::CellBases & cellBases(size_t iT) const
Return cell bases for the cell of index iT.
Definition sxgrad.hpp:208
const Mesh & mesh() const
Return the mesh.
Definition vsxgrad.hpp:82
const Eigen::MatrixXd edgePotential(size_t iE) const
Return the potential operator (expressed on Polykpo3) on the edge of index iE.
Definition vsxgrad.hpp:176
const Eigen::MatrixXd edgePotential(const Edge &E) const
Return the potential operator (expressed on Polykpo3) on edge E.
Definition vsxgrad.hpp:185
const CellBases & cellBases(const Cell &T) const
Return vector/matrix cell bases for cell T.
Definition vsxgrad.hpp:295
const Eigen::MatrixXd cellGradient(size_t iT) const
Return the gradient operator (expressed on Polyk3x3) on the cell of index iT.
Definition vsxgrad.hpp:192
std::unique_ptr< PolyBasisCellType > Polykmo
Definition ddrcore.hpp:87
std::unique_ptr< PolyBasisCellType > Polykmtwo
Definition ddrcore.hpp:88
const Eigen::MatrixXd cellGradient(const Cell &T) const
Return the gradient operator (expressed on Polyk3x3) on cell T.
Definition vsxgrad.hpp:216
std::unique_ptr< Poly2BasisEdgeType > Polykpo2
Definition vsxgrad.hpp:74
auto Polykmo(size_t iT) const -> const PolyBasisCellType &
Definition vsxgrad.hpp:139
Eigen::MatrixXd _permute_bases(size_t iT)
Definition vsxgrad.cpp:128
Eigen::MatrixXd computeStabilisation(const size_t iT, const IntegralWeight &weight=IntegralWeight(1.)) const
Compute the H^1-stabilisation (based on the L^2 stabilisation implemented in SXgrad)
Definition vsxgrad.hpp:263
auto Polykpo(size_t iT) const -> const PolyBasisCellType &
Definition vsxgrad.hpp:134
const size_t & degree() const
Return the polynomial degree.
Definition vsxgrad.hpp:94
const Eigen::MatrixXd cellSymGradient(size_t iT) const
Return the symmetric gradient operator (expressed on Polyk3x3) on the cell of index iT.
Definition vsxgrad.hpp:222
Eigen::MatrixXd computeStabilisation(const size_t iT, const IntegralWeight &weight=IntegralWeight(1.)) const
Computes only the stabilisation matrix of the (weighted) L2-product for the cell of index iT.
Definition sxgrad.hpp:186
const Eigen::MatrixXd cellGradient(size_t iT) const
Return the full gradient operator on the cell of index iT.
Definition sxgrad.hpp:146
const LocalOperators & cellOperators(const Cell &T) const
Return cell operators for cell T.
Definition vsxgrad.hpp:321
const CellBases & cellBases(size_t iT) const
Return vector/matrix cell bases for the face of index iT.
Definition vsxgrad.hpp:288
auto Polykptwo(size_t iT) const -> const PolyBasisCellType &
Definition vsxgrad.hpp:149
const DDRCore::EdgeBases & edgeBases(size_t iE) const
Return edge bases for the edge of index iE.
Definition sxgrad.hpp:221
const Eigen::MatrixXd cellPotential(size_t iT) const
Return the potential operator on the cell of index iT.
Definition sxgrad.hpp:158
LocalOperators(const Eigen::MatrixXd &_rot, const Eigen::MatrixXd &_potential)
Definition vsxgrad.hpp:37
std::unique_ptr< PolyBasisEdgeType > Polyk
Definition ddrcore.hpp:108
std::unique_ptr< PolyBasisCellType > Polyk
Definition ddrcore.hpp:86
const Eigen::MatrixXd edgeGradient(size_t iE) const
Return the full gradient operator on the edge of index iE.
Definition sxgrad.hpp:122
auto Polyk(size_t iT) const -> const PolyBasisCellType &
Definition vsxgrad.hpp:144
bool use_threads
Definition HHO_DiffAdvecReac.hpp:47
if(strcmp(field, 'real')) % real valued entries T
Definition mmread.m:93
Definition ddr-klplate.hpp:27
static auto q
Definition ddrcore-test.hpp:14
Structure for weights (scalar, at the moment) in integral.
Definition integralweight.hpp:33
Definition vsxgrad.hpp:63
Definition vsxgrad.hpp:71
Definition vsxgrad.hpp:36