12#include <boost/math/constants/constants.hpp>
14#include <Eigen/Sparse>
15#include <unsupported/Eigen/SparseExtra>
43 energy(std::sqrt( std::pow(norm_displacement, 2) ) )
68 std::ostream & output = std::cout
98 inline const std::vector<std::pair<size_t,size_t>> &
locUKN()
const {
162 const Eigen::VectorXd &
v
166 template<
typename outValue,
typename Fct>
167 std::function<outValue(
const Eigen::Vector2d &)>
contractPara(
const Fct &F)
const
169 std::function<outValue(
const Eigen::Vector2d &)> f = [
this, &F](
const Eigen::Vector2d &
x)->outValue {
return F(
x);};
175 std::pair<Eigen::MatrixXd, Eigen::VectorXd>
176 _compute_local_contribution(
185 void _assemble_local_contribution(
187 const std::pair<Eigen::MatrixXd, Eigen::VectorXd> & lsT,
188 std::list<Eigen::Triplet<double> > & A1,
189 Eigen::VectorXd & b1,
190 std::list<Eigen::Triplet<double> > & A2
195 std::ostream & m_output;
200 Eigen::VectorXd m_bdryValues;
204 std::vector<std::pair<size_t,size_t>> m_locUKN;
205 Eigen::VectorXi m_DOFtoUKN;
212 static const double PI = boost::math::constants::pi<double>();
227 return VectorRd::Zero();
240 return pow(
x(0), 5) + pow(
x(1), 5);
246 grad(0) = 5.0 * pow(
x(0), 4);
247 grad(1) = 5.0 * pow(
x(1), 4);
253 return 120. * (
x(0) +
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
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:136
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:146
double & stabilizationParameter()
Returns the stabilization parameter.
Definition bgg-klplate.hpp:156
const std::vector< std::pair< size_t, size_t > > & locUKN() const
Returns the location of the unknowns among the DOFs.
Definition bgg-klplate.hpp:98
KLNorms computeNorms(const Eigen::VectorXd &v) const
Compute the discrete norms: displacement,and energy.
Definition bgg-klplate.cpp:467
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:103
const SystemMatrixType & bdryMatrix() const
Returns the Matrix for BC.
Definition bgg-klplate.hpp:141
size_t nb_bdryDOFs() const
Returns the nb of DOFs for BC.
Definition bgg-klplate.hpp:85
static KirchhoffLove::SolutionDisplacementType constant_u
Definition bgg-klplate.hpp:221
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:167
static KirchhoffLove::GradientDisplacementType polynomial_grad_u
Definition bgg-klplate.hpp:244
const XHess & xHess() const
Returns the space XHess.
Definition bgg-klplate.hpp:115
void assembleLinearSystem(const ForcingTermType &f, const SolutionDisplacementType &u, const GradientDisplacementType &grad_u)
Assemble the global system
Definition bgg-klplate.cpp:292
Eigen::SparseMatrix< double > SystemMatrixType
Definition bgg-klplate.hpp:54
static const double PI
Definition bgg-klplate.hpp:212
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:121
const Eigen::VectorXd & systemVector() const
Returns the linear system right-hand side vector.
Definition bgg-klplate.hpp:131
SystemMatrixType & systemMatrix()
Returns the linear system matrix.
Definition bgg-klplate.hpp:126
static KirchhoffLove::ForcingTermType constant_f
Definition bgg-klplate.hpp:231
static KirchhoffLove::ForcingTermType polynomial_f
Definition bgg-klplate.hpp:252
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:92
KLNorms(double norm_displacement)
Constructor.
Definition bgg-klplate.hpp:41
const VSXGrad & vsxGrad() const
Returns the space VSXGrad.
Definition bgg-klplate.hpp:109
static KirchhoffLove::GradientDisplacementType constant_grad_u
Definition bgg-klplate.hpp:226
double energy
Total energy.
Definition bgg-klplate.hpp:48
const double & stabilizationParameter() const
Returns the stabilization parameter.
Definition bgg-klplate.hpp:151
static KirchhoffLove::SolutionDisplacementType polynomial_u
Definition bgg-klplate.hpp:239
size_t dimensionSpace() const
Returns the dimension of the rotation + displacement space (with BC)
Definition bgg-klplate.hpp:79
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