12#include <boost/math/constants/constants.hpp>
14#include <Eigen/Sparse>
15#include <unsupported/Eigen/SparseExtra>
68 std::ostream & output = std::cout
99 inline const std::vector<std::pair<size_t,size_t>> &
locUKN()
const {
163 const Eigen::VectorXd &
v
167 template<
typename outValue,
typename Fct>
168 std::function<outValue(
const Eigen::Vector2d &)>
contractPara(
const Fct &F)
const
170 std::function<outValue(
const Eigen::Vector2d &)> f = [
this, &F](
const Eigen::Vector2d &
x)->outValue {
return F(
x);};
176 std::pair<Eigen::MatrixXd, Eigen::VectorXd>
177 _compute_local_contribution(
187 void _assemble_local_contribution(
189 const std::pair<Eigen::MatrixXd, Eigen::VectorXd> & lsT,
190 std::list<Eigen::Triplet<double> > & A1,
191 Eigen::VectorXd & b1,
192 std::list<Eigen::Triplet<double> > & A2
197 std::ostream & m_output;
202 Eigen::VectorXd m_bdryValues;
206 std::vector<std::pair<size_t,size_t>> m_locUKN;
207 Eigen::VectorXi m_DOFtoUKN;
214 static const double PI = boost::math::constants::pi<double>();
229 return VectorRd::Zero();
242 return pow(
x(0), 5) + pow(
x(1), 5);
248 grad(0) = 5.0 * pow(
x(0), 4);
249 grad(1) = 5.0 * pow(
x(1), 4);
255 return 120. * (
x(0) +
x(1));
263 return std::sin(M_PI *
x(0)) * std::sin(M_PI *
x(1));
269 grad(0) = M_PI * std::cos(M_PI *
x(0)) * std::sin(M_PI *
x(1));
270 grad(1) = M_PI * std::sin(M_PI *
x(0)) * std::cos(M_PI *
x(1));
276 double u = std::sin(M_PI *
x(0)) * std::sin(M_PI *
x(1));
277 return 4.0 * std::pow(M_PI, 4) * u;
304 const double rayon = 1e-2;
307 if ((
x - center).squaredNorm() < rayon*rayon) {
308 return 1.0 / (M_PI*rayon*rayon);
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
Construct all polynomial spaces for the DDR sequence.
Definition serendipity_problem.hpp:20
Vector version of sXgrad, the arbitrary order space with nodal primal unknowns.
Definition vsxgrad.hpp:32
Discrete H2 space: local operators, L2 product and global interpolator.
Definition xhess.hpp:21
Create grid points x
Definition generate_cartesian_mesh.m:22
Eigen::VectorXd & systemVector()
Returns the linear system right-hand side vector.
Definition bgg-klplate.hpp:137
std::function< Eigen::Vector2d(const Eigen::Vector2d &)> GradientDisplacementType
Definition bgg-klplate.hpp:57
const Eigen::VectorXd & bdryValues() const
Returns the boundary values.
Definition bgg-klplate.hpp:147
double & stabilizationParameter()
Returns the stabilization parameter.
Definition bgg-klplate.hpp:157
const std::vector< std::pair< size_t, size_t > > & locUKN() const
Returns the location of the unknowns among the DOFs.
Definition bgg-klplate.hpp:99
KLNorms computeNorms(const Eigen::VectorXd &v) const
Compute the discrete norms: displacement,and energy.
Definition bgg-klplate.cpp:500
std::vector< size_t > globalDOFIndices(const Cell &T) const
Create the vector of DOF indices for cell T, which combines the DOFs for the spaces VSXgrad and Xhess...
Definition bgg-klplate.hpp:104
const SystemMatrixType & bdryMatrix() const
Returns the Matrix for BC.
Definition bgg-klplate.hpp:142
static KirchhoffLove::GradientDisplacementType dirac_grad_u
Definition bgg-klplate.hpp:289
size_t nb_bdryDOFs() const
Returns the nb of DOFs for BC.
Definition bgg-klplate.hpp:86
static KirchhoffLove::SolutionDisplacementType constant_u
Definition bgg-klplate.hpp:223
void assembleLinearSystem(const ForcingTermType &f, const SolutionDisplacementType &u, const GradientDisplacementType &grad_u, size_t iT_dirac)
Assemble the global system
Definition bgg-klplate.cpp:312
std::function< outValue(const Eigen::Vector2d &)> contractPara(const Fct &F) const
Takes a function dependent on KLParameter and a position x, and returns a function depending only on ...
Definition bgg-klplate.hpp:168
static KirchhoffLove::GradientDisplacementType polynomial_grad_u
Definition bgg-klplate.hpp:246
const XHess & xHess() const
Returns the space XHess.
Definition bgg-klplate.hpp:116
static KirchhoffLove::SolutionDisplacementType trigo_u
Definition bgg-klplate.hpp:262
Eigen::SparseMatrix< double > SystemMatrixType
Definition bgg-klplate.hpp:54
static const double PI
Definition bgg-klplate.hpp:214
std::function< double(const Eigen::Vector2d &)> ForcingTermType
Definition bgg-klplate.hpp:55
const SystemMatrixType & systemMatrix() const
Returns the linear system matrix.
Definition bgg-klplate.hpp:122
const Eigen::VectorXd & systemVector() const
Returns the linear system right-hand side vector.
Definition bgg-klplate.hpp:132
SystemMatrixType & systemMatrix()
Returns the linear system matrix.
Definition bgg-klplate.hpp:127
static KirchhoffLove::ForcingTermType constant_f
Definition bgg-klplate.hpp:233
static KirchhoffLove::ForcingTermType polynomial_f
Definition bgg-klplate.hpp:254
std::function< double(const Eigen::Vector2d &)> SolutionDisplacementType
Definition bgg-klplate.hpp:56
double displacement
Norm of displacement.
Definition bgg-klplate.hpp:47
size_t sizeSystem() const
Returns the size of the system without BC.
Definition bgg-klplate.hpp:93
KLNorms(double norm_displacement)
Constructor.
Definition bgg-klplate.hpp:41
const VSXGrad & vsxGrad() const
Returns the space VSXGrad.
Definition bgg-klplate.hpp:110
static KirchhoffLove::GradientDisplacementType constant_grad_u
Definition bgg-klplate.hpp:228
static KirchhoffLove::ForcingTermType dirac_f
Definition bgg-klplate.hpp:303
double energy
Total energy.
Definition bgg-klplate.hpp:48
const double & stabilizationParameter() const
Returns the stabilization parameter.
Definition bgg-klplate.hpp:152
static KirchhoffLove::SolutionDisplacementType polynomial_u
Definition bgg-klplate.hpp:241
static KirchhoffLove::GradientDisplacementType trigo_grad_u
Definition bgg-klplate.hpp:267
static KirchhoffLove::SolutionDisplacementType dirac_u
Definition bgg-klplate.hpp:284
size_t dimensionSpace() const
Returns the dimension of the rotation + displacement space (with BC)
Definition bgg-klplate.hpp:80
static KirchhoffLove::ForcingTermType trigo_f
Definition bgg-klplate.hpp:275
Eigen::Vector2d VectorRd
Definition basis.hpp:55
std::vector< size_t > globalDOFIndices(const Cell &T) const
Definition globaldofspace.cpp:98
size_t numLocalDofsVertex() const
Returns the number of local vertex DOFs.
Definition localdofspace.hpp:39
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
bool use_threads
Definition HHO_DiffAdvecReac.hpp:45
if(strcmp(field, 'real')) % real valued entries T
Definition mmread.m:93
Definition bgg-klplate.hpp:30
static auto v
Definition ddrcore-test.hpp:32
Structure to store component norms (displacement total energy)
Definition bgg-klplate.hpp:39
Assemble a RM problem.
Definition bgg-klplate.hpp:53