11#include <boost/math/constants/constants.hpp>
13#include <Eigen/Sparse>
14#include <unsupported/Eigen/SparseExtra>
52 std::ostream & output = std::cout
64 return m_platescore.
mesh().
n_cells() * m_nloc_sc_sigma;
138 const Eigen::VectorXd &
v
146 std::ostream & m_output;
151 const size_t m_nloc_sc_sigma;
155 Eigen::VectorXd m_sc_b;
160 std::pair<Eigen::MatrixXd, Eigen::VectorXd>
161 _compute_local_contribution(
172 void _assemble_local_contribution(
174 const std::pair<Eigen::MatrixXd, Eigen::VectorXd> & lsT,
175 std::list<Eigen::Triplet<double> > & Ah_sys,
176 Eigen::VectorXd & bh_sys,
177 std::list<Eigen::Triplet<double> > & Ah_sc,
178 Eigen::VectorXd & bh_sc
187 static const double PI = boost::math::constants::pi<double>();
198 return sin(
PI*x(0))*sin(
PI*x(1));
209 M.row(0) << -sin(
PI*x(0))*sin(
PI*x(1)), cos(
PI*x(0))*cos(
PI*x(1));
210 M.row(1) << cos(
PI*x(0))*cos(
PI*x(1)), -sin(
PI*x(0))*sin(
PI*x(1));
212 return pow(
PI, 2) * M;
218 M.row(0) << -cos(
PI*x(0))*sin(
PI*x(1)), -sin(
PI*x(0))*cos(
PI*x(1));
219 M.row(1) << -sin(
PI*x(0))*cos(
PI*x(1)), -cos(
PI*x(0))*sin(
PI*x(1));
221 return pow(
PI, 3) * M;
228 M.row(0) << -sin(
PI*x(0))*cos(
PI*x(1)), -cos(
PI*x(0))*sin(
PI*x(1));
229 M.row(1) << -cos(
PI*x(0))*sin(
PI*x(1)), -sin(
PI*x(0))*cos(
PI*x(1));
231 return pow(
PI, 3) * M;
248 Eigen::Vector2d tE = E.tangent();
249 Eigen::Vector2d nE = E.normal();
253 Eigen::Vector2d div_hess {
258 return (dtE_hess*nE).dot(tE) + div_hess.dot(nE);
263 return 4.*pow(
PI, 4)*sin(
PI*x(0))*sin(
PI*x(1));
271 return pow(x(0),2)*pow(1.-x(0),2) + pow(x(1),2)*pow(1.-x(1),2);
276 return VectorRd(pow(x(0), 2)*(2*x(0) - 2) + 2*x(0)*pow(1 - x(0), 2), pow(x(1), 2)*(2*x(1) - 2) + 2*x(1)*pow(1 - x(1), 2));
284 2.*(pow(x(0),2)+4.*x(0)*(x(0)-1.)+pow(1.-x(0),2)), 0.,
285 0., 2.*(pow(x(1),2)+4.*x(1)*(x(1)-1.)+pow(1.-x(1),2));
293 M.row(0) << 24*x(0) - 12, 0;
304 M.row(1) << 0., 24*x(1) - 12;
323 Eigen::Vector2d tE = E.tangent();
324 Eigen::Vector2d nE = E.normal();
328 Eigen::Vector2d div_hess {
333 return (dtE_hess*nE).dot(tE) + div_hess.dot(nE);
347 return pow(x(0),2)*pow(1.-x(0),2)*pow(x(1),2)*pow(1.-x(1),2);
352 return VectorRd(pow(x(0), 2)*pow(x(1), 2)*pow(1 - x(1), 2)*(2*x(0) - 2) + 2*x(0)*pow(x(1), 2)*pow(1 - x(0), 2)*pow(1 - x(1), 2), pow(x(0), 2)*pow(x(1), 2)*pow(1 - x(0), 2)*(2*x(1) - 2) + 2*pow(x(0), 2)*x(1)*pow(1 - x(0), 2)*pow(1 - x(1), 2));
358 M.row(0) << 2*pow(x(1), 2)*pow(x(1) - 1, 2)*(pow(x(0), 2) + 4*x(0)*(x(0) - 1) + pow(x(0) - 1, 2)), 4*x(0)*x(1)*(x(0) - 1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1));
359 M.row(1) << 4*x(0)*x(1)*(x(0) - 1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)), 2*pow(x(0), 2)*pow(x(0) - 1, 2)*(pow(x(1), 2) + 4*x(1)*(x(1) - 1) + pow(x(1) - 1, 2));
366 M.row(0) << 2*pow(x(1), 2)*(12*x(0) - 6)*pow(x(1) - 1, 2), 4*x(0)*x(1)*(x(0) - 1)*(x(1) - 1)*(4*x(1) - 2) + 4*x(0)*x(1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)) + 4*x(1)*(x(0) - 1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1));
367 M.row(1) << 4*x(0)*x(1)*(x(0) - 1)*(x(1) - 1)*(4*x(1) - 2) + 4*x(0)*x(1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)) + 4*x(1)*(x(0) - 1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)), 2*pow(x(0), 2)*(2*x(0) - 2)*(pow(x(1), 2) + 4*x(1)*(x(1) - 1) + pow(x(1) - 1, 2)) + 4*x(0)*pow(x(0) - 1, 2)*(pow(x(1), 2) + 4*x(1)*(x(1) - 1) + pow(x(1) - 1, 2));
376 M.row(0) << 2*pow(x(1), 2)*(2*x(1) - 2)*(pow(x(0), 2) + 4*x(0)*(x(0) - 1) + pow(x(0) - 1, 2)) + 4*x(1)*pow(x(1) - 1, 2)*(pow(x(0), 2) + 4*x(0)*(x(0) - 1) + pow(x(0) - 1, 2)), 4*x(0)*x(1)*(x(0) - 1)*(4*x(0) - 2)*(x(1) - 1) + 4*x(0)*x(1)*(x(0) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)) + 4*x(0)*(x(0) - 1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1));
377 M.row(1) << 4*x(0)*x(1)*(x(0) - 1)*(4*x(0) - 2)*(x(1) - 1) + 4*x(0)*x(1)*(x(0) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)) + 4*x(0)*(x(0) - 1)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)), 2*pow(x(0), 2)*pow(x(0) - 1, 2)*(12*x(1) - 6);
396 Eigen::Vector2d tE = E.tangent();
397 Eigen::Vector2d nE = E.normal();
401 Eigen::Vector2d div_hess {
406 return (dtE_hess*nE).dot(tE) + div_hess.dot(nE);
411 return 24*pow(x(0), 2)*pow(x(0) - 1, 2) + 32*x(0)*x(1)*(x(0) - 1)*(x(1) - 1) + 8*x(0)*x(1)*(x(0) - 1)*(4*x(1) - 2) + 8*x(0)*x(1)*(4*x(0) - 2)*(x(1) - 1) + 8*x(0)*x(1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)) + 8*x(0)*(x(0) - 1)*(x(1) - 1)*(4*x(1) - 2) + 8*x(0)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)) + 24*pow(x(1), 2)*pow(x(1) - 1, 2) + 8*x(1)*(x(0) - 1)*(4*x(0) - 2)*(x(1) - 1) + 8*x(1)*(x(0) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1)) + 2*(4*x(0) - 4)*(x(1) - 1)*(x(0)*x(1) + x(0)*(x(1) - 1) + x(1)*(x(0) - 1) + (x(0) - 1)*(x(1) - 1));
Base class for global DOF spaces. Provides functions to manipulate global DOFs (the local version bei...
Definition globaldofspace.hpp:16
Construct all polynomial spaces for the plates sequence.
Definition platescore.hpp:25
Discrete Hdivdiv space.
Definition xdivdiv.hpp:20
Eigen::Vector2d VectorRd
Definition basis.hpp:55
size_t dimension() const
Returns the dimension of the global space (all DOFs for all geometric entities)
Definition localdofspace.hpp:61
static KirchhoffLove::DeflectionType trigonometric_u
Definition ddr-klplate.hpp:197
static KirchhoffLove::ForcingTermType trigonometric_divdiv_hess_u
Definition ddr-klplate.hpp:262
static KirchhoffLove::GradientDeflectionType trigonometric_grad_Delta_u
Definition ddr-klplate.hpp:235
Eigen::VectorXd & systemVector()
Returns the linear system right-hand side vector.
Definition ddr-klplate.hpp:99
XDivDiv::ConstitutiveLawType ConstitutiveLawType
Definition ddr-klplate.hpp:45
double & stabilizationParameter()
Returns the stabilization parameter.
Definition ddr-klplate.hpp:119
const SystemMatrixType & scMatrix() const
Returns the static condensation recovery operator.
Definition ddr-klplate.hpp:104
static KirchhoffLove::MomentTensorType trigonometric_hess_u
Definition ddr-klplate.hpp:207
static KirchhoffLove::MomentTensorType quartic_dx_hess_u
Definition ddr-klplate.hpp:291
static KirchhoffLove::MomentTensorType quartic_dy_hess_u
Definition ddr-klplate.hpp:301
static KirchhoffLove::DeflectionType biquartic_u
Definition ddr-klplate.hpp:346
double computeNorm(const Eigen::VectorXd &v) const
Compute the discrete norm.
Definition ddr-klplate.cpp:512
const GlobalDOFSpace polykm2Th() const
Returns the space .
Definition ddr-klplate.hpp:79
static KirchhoffLove::ForcingTermType biquartic_divdiv_hess_u
Definition ddr-klplate.hpp:410
static KirchhoffLove::MomentTensorType biquartic_dx_hess_u
Definition ddr-klplate.hpp:364
static KirchhoffLove::MomentTensorType biquartic_dy_hess_u
Definition ddr-klplate.hpp:374
static KirchhoffLove::MomentTensorEdgeDerivativeType quartic_hess_u_DE
Definition ddr-klplate.hpp:321
std::function< Eigen::Vector2d(const Eigen::Vector2d &)> GradientDeflectionType
Definition ddr-klplate.hpp:41
Eigen::SparseMatrix< double > SystemMatrixType
Definition ddr-klplate.hpp:37
static const double PI
Definition ddr-klplate.hpp:187
size_t nbSCDOFs() const
Returns the number of statically condensed DOFs (here, the cell moments DOFs)
Definition ddr-klplate.hpp:62
std::function< double(const Eigen::Vector2d &)> ForcingTermType
Definition ddr-klplate.hpp:39
const SystemMatrixType & systemMatrix() const
Returns the linear system matrix.
Definition ddr-klplate.hpp:84
const Eigen::VectorXd & systemVector() const
Returns the linear system right-hand side vector.
Definition ddr-klplate.hpp:94
SystemMatrixType & systemMatrix()
Returns the linear system matrix.
Definition ddr-klplate.hpp:89
std::function< Eigen::Matrix2d(const Eigen::Vector2d &)> MomentTensorType
Definition ddr-klplate.hpp:42
const XDivDiv & xDivDiv() const
Returns the space XDivDiv.
Definition ddr-klplate.hpp:74
Eigen::VectorXd interpolateDeflection(const DeflectionType &u, int deg_quad=-1) const
Interpolate deflection.
Definition ddr-klplate.cpp:483
static KirchhoffLove::MomentTensorType quartic_hess_u
Definition ddr-klplate.hpp:280
static KirchhoffLove::MomentTensorType biquartic_hess_u
Definition ddr-klplate.hpp:356
static KirchhoffLove::GradientDeflectionType quartic_grad_u
Definition ddr-klplate.hpp:275
size_t sizeSystem() const
Returns the size of the statically condensed system.
Definition ddr-klplate.hpp:68
static KirchhoffLove::DeflectionType quartic_u
Definition ddr-klplate.hpp:270
std::function< double(const Eigen::Vector2d &, const Edge &)> MomentTensorEdgeDerivativeType
Definition ddr-klplate.hpp:43
static KirchhoffLove::GradientDeflectionType biquartic_grad_Delta_u
Definition ddr-klplate.hpp:383
static KirchhoffLove::ForcingTermType quartic_divdiv_hess_u
Definition ddr-klplate.hpp:338
static KirchhoffLove::GradientDeflectionType quartic_grad_Delta_u
Definition ddr-klplate.hpp:310
static KirchhoffLove::GradientDeflectionType biquartic_grad_u
Definition ddr-klplate.hpp:351
const double & stabilizationParameter() const
Returns the stabilization parameter.
Definition ddr-klplate.hpp:114
void assembleLinearSystem(const ForcingTermType &f, const DeflectionType &u, const GradientDeflectionType &grad_u)
Assemble the global system.
Definition ddr-klplate.cpp:446
static KirchhoffLove::MomentTensorEdgeDerivativeType trigonometric_hess_u_DE
Definition ddr-klplate.hpp:246
static KirchhoffLove::MomentTensorEdgeDerivativeType biquartic_hess_u_DE
Definition ddr-klplate.hpp:394
std::function< double(const Eigen::Vector2d &)> DeflectionType
Definition ddr-klplate.hpp:40
static KirchhoffLove::MomentTensorType trigonometric_dy_hess_u
Definition ddr-klplate.hpp:226
Eigen::VectorXd & scVector()
Returns the static condensation rhs.
Definition ddr-klplate.hpp:109
static KirchhoffLove::GradientDeflectionType trigonometric_grad_u
Definition ddr-klplate.hpp:202
static KirchhoffLove::MomentTensorType trigonometric_dx_hess_u
Definition ddr-klplate.hpp:216
size_t dimensionSpace() const
Returns the dimension of the moment + deflection space.
Definition ddr-klplate.hpp:56
bool use_threads
Definition HHO_DiffAdvecReac.hpp:47
std::size_t n_cells() const
number of cells in the mesh.
Definition Mesh2D.hpp:63
const Mesh & mesh() const
Return a const reference to the mesh.
Definition platescore.hpp:66
std::function< Eigen::Matrix2d(const Eigen::Matrix2d &)> ConstitutiveLawType
Definition xdivdiv.hpp:24
Definition ddr-klplate.hpp:27
static auto v
Definition ddrcore-test.hpp:32
Assemble a Kirchhoff-Love plate problem.
Definition ddr-klplate.hpp:36
Structure to store information for, and perform, local static condensation.
Definition local_static_condensation.hpp:25