12#include <boost/math/constants/constants.hpp>
14#include <Eigen/Sparse>
15#include <unsupported/Eigen/SparseExtra>
53 std::ostream & output = std::cout
137 return m_dof_to_unknown(
i);
151 std::pair<Eigen::MatrixXd, Eigen::VectorXd>
152 _compute_local_contribution(
158 void _assemble_local_contribution(
160 const std::pair<Eigen::MatrixXd, Eigen::VectorXd> & lsT,
161 std::list<Eigen::Triplet<double> > & triplets_A,
162 Eigen::VectorXd & rsh_b,
163 std::list<Eigen::Triplet<double> > & triplets_boundary_A
170 std::ostream & m_output;
180 std::vector<std::pair<size_t, size_t>> m_unknowns_stride;
181 Eigen::VectorXi m_dof_to_unknown;
192 static const double PI = boost::math::constants::pi<double>();
202 u_x << -(x(1) - 0.5), (x(0) - 0.5);
213 return VectorRd::Zero();
234 u_x << -pow(x(1) - 0.5, 2), pow(x(0) - 0.5, 2);
240 return 2. * ( x(0) + x(1) - 1 );
246 rotrot_u_x << 2., -2.;
268 u_x << -pow(x(1) - 0.5, 3), pow(x(0) - 0.5, 3);
274 return 3. * ( pow(x(0) - 0.5, 2) + pow(x(1) - 0.5, 2) );
280 rotrot_u_x << 6. * (x(1) - 0.5), -6. * (x(0) - 0.5);
302 u_x << -pow(x(1) - 0.5, 4), pow(x(0) - 0.5, 4);
308 return 4. * ( pow(x(0)- 0.5, 3) + pow(x(1) - 0.5, 3) );
314 rotrot_u_x << 12. * pow(x(1) - 0.5, 2),
315 -12. * pow(x(0) - 0.5 , 2);
323 return x(0) * (1. - x(0)) * x(1) * (1. - x(1));
329 f_x << -24. + (1. - 2. * x(0)) * x(1) * (1. - x(1)),
330 24. + x(0) * (1. - x(0)) * (1. - 2. * x(1));
340 u_x << -sin(
PI * (x(0) + x(1))), sin(
PI * (x(0) + x(1)));
346 return 2. *
PI * cos(
PI * (x(0) + x(1)));
352 rotrot_u_x << -sin(
PI * (x(0) + x(1))), sin(
PI * (x(0) + x(1)));
353 return pow(
PI, 2) * rotrot_u_x;
358 return 4. * pow(
PI, 3) * cos(
PI * (x(0) + x(1)));
363 return sin(
PI * x(0)) * sin(
PI * x(1));
369 f_x << -4. * pow(
PI, 4) * sin(
PI * (x(0) + x(1))) +
PI * cos(
PI * x(0)) * sin(
PI * x(1)),
370 4. * pow(
PI, 4) * sin(
PI * (x(0) + x(1))) +
PI * sin(
PI * x(0)) * cos(
PI * x(1));
The BoundaryConditions class provides definition of boundary conditions.
Definition BoundaryConditions.hpp:45
const size_t n_dir_vertices() const
Returns the number of Dirichlet vertices.
Definition BoundaryConditions.hpp:75
const size_t n_dir_edges() const
Returns the number of Dirichlet edges.
Definition BoundaryConditions.hpp:70
Construct all polynomial spaces for the DDR sequence.
Definition ddrcore.hpp:63
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
Discrete H1 space: local operators, L2 product and global interpolator.
Definition xrot.hpp:18
Compute max and min eigenvalues of all matrices for i
Definition compute_eigs.m:5
Eigen::Vector2d VectorRd
Definition basis.hpp:55
size_t numLocalDofsVertex() const
Returns the number of local vertex DOFs.
Definition localdofspace.hpp:39
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
size_t dimension() const
Returns the dimension of the global space (all DOFs for all geometric entities)
Definition localdofspace.hpp:61
size_t numLocalDofsEdge() const
Returns the number of local edge DOFs.
Definition localdofspace.hpp:45
static KirchhoffLove::DeflectionType trigonometric_u
Definition ddr-klplate.hpp:197
static const double PI
Definition ddr-klplate.hpp:187
static KirchhoffLove::DeflectionType quartic_u
Definition ddr-klplate.hpp:270
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 QuadRot::RotRotType cubic_rotrot_u
Definition ddr-quadrot.hpp:278
static QuadRot::PotentialType linear_u
Definition ddr-quadrot.hpp:200
static QuadRot::RotRotType quadratic_rotrot_u
Definition ddr-quadrot.hpp:244
static QuadRot::ForcingTermType trigonometric_f
Definition ddr-quadrot.hpp:367
static QuadRot::RotorType quadratic_rot_u
Definition ddr-quadrot.hpp:239
static QuadRot::RotRotType linear_rotrot_u
Definition ddr-quadrot.hpp:212
static QuadRot::RotorType trigonometric_rot_u
Definition ddr-quadrot.hpp:345
static QuadRot::ForcingTermType quartic_f
Definition ddr-quadrot.hpp:327
static QuadRot::RotorType trigonometric_rotrotrot_u
Definition ddr-quadrot.hpp:357
static QuadRot::LagrangeMultiplierType quadratic_p
Definition ddr-quadrot.hpp:251
static QuadRot::LagrangeMultiplierType quartic_p
Definition ddr-quadrot.hpp:322
static QuadRot::RotorType linear_rot_u
Definition ddr-quadrot.hpp:207
static QuadRot::RotRotType quartic_rotrot_u
Definition ddr-quadrot.hpp:312
static QuadRot::LagrangeMultiplierType linear_p
Definition ddr-quadrot.hpp:217
static QuadRot::RotRotType trigonometric_rotrot_u
Definition ddr-quadrot.hpp:350
static QuadRot::RotorType quartic_rot_u
Definition ddr-quadrot.hpp:307
static QuadRot::ForcingTermType linear_f
Definition ddr-quadrot.hpp:222
static QuadRot::ForcingTermType cubic_f
Definition ddr-quadrot.hpp:290
static QuadRot::PotentialType cubic_u
Definition ddr-quadrot.hpp:266
static QuadRot::LagrangeMultiplierType trigonometric_p
Definition ddr-quadrot.hpp:362
static QuadRot::PotentialType quadratic_u
Definition ddr-quadrot.hpp:232
static QuadRot::ForcingTermType quadratic_f
Definition ddr-quadrot.hpp:256
static QuadRot::LagrangeMultiplierType cubic_p
Definition ddr-quadrot.hpp:285
static QuadRot::RotorType cubic_rot_u
Definition ddr-quadrot.hpp:273
Definition ddr-quadrot.hpp:38
int dofToUnknown(size_t i) const
DOF-to-unknown mapping.
Definition ddr-quadrot.hpp:135
const SystemMatrixType & systemMatrix() const
Returns the linear system matrix.
Definition ddr-quadrot.hpp:85
Eigen::VectorXd assembleLinearSystem(const ForcingTermType &f, const PotentialType &u, const RotorType &rot_u, const LagrangeMultiplierType &p)
Definition ddr-quadrot.cpp:486
const XGrad & xGrad() const
Returns the space XGrad.
Definition ddr-quadrot.hpp:57
Eigen::VectorXd & systemVector()
Returns the linear system right-hand side vector.
Definition ddr-quadrot.hpp:100
const Eigen::VectorXd & systemVector() const
Returns the linear system right-hand side vector.
Definition ddr-quadrot.hpp:95
double & stabilizationParameter()
Returns the stabilization parameter.
Definition ddr-quadrot.hpp:80
const double & stabilizationParameter() const
Returns the stabilization parameter.
Definition ddr-quadrot.hpp:75
std::function< double(const VectorRd &)> RotorType
Definition ddr-quadrot.hpp:42
std::vector< size_t > globalDOFIndices(const Cell &T) const
Create the vector of DOF indices for the cell T, which combines the DOFs for the spaces XRotRot and X...
Definition ddr-quadrot.cpp:541
size_t dimensionLocalSpace(size_t iT) const
Returns the dimension of the local potential + Lagrange multiplier space on the element of index iT.
Definition ddr-quadrot.hpp:108
SystemMatrixType & systemMatrix()
Returns the linear system matrix.
Definition ddr-quadrot.hpp:90
const XRot & xRot() const
Returns the space XGrad.
Definition ddr-quadrot.hpp:69
std::function< VectorRd(const VectorRd &)> PotentialType
Definition ddr-quadrot.hpp:41
size_t dimensionLinearSystem() const
Returns the dimension of the linear system.
Definition ddr-quadrot.hpp:129
std::function< double(const VectorRd &)> LagrangeMultiplierType
Definition ddr-quadrot.hpp:44
std::function< VectorRd(const VectorRd &)> RotRotType
Definition ddr-quadrot.hpp:43
std::function< VectorRd(const VectorRd &)> ForcingTermType
Definition ddr-quadrot.hpp:45
size_t numBoundaryDofs() const
Returns the number of boundary DOFs.
Definition ddr-quadrot.hpp:120
const XRotRot & xRotRot() const
Returns the space XRotRot.
Definition ddr-quadrot.hpp:63
size_t dimensionSpace() const
Returns the dimension of the potential + Lagrange multiplier space.
Definition ddr-quadrot.hpp:114
Eigen::SparseMatrix< double > SystemMatrixType
Definition ddr-quadrot.hpp:39