PolyFEM
Loading...
Searching...
No Matches
Laplacian.hpp
Go to the documentation of this file.
1#pragma once
2
5
6// local assembler for laplace equation
7namespace polyfem
8{
9 namespace assembler
10 {
12 {
13 public:
15
16 std::string name() const override { return "Laplacian"; }
17 std::map<std::string, ParamFunc> parameters() const override { return std::map<std::string, ParamFunc>(); }
18
22 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1> assemble(const LinearAssemblerData &data) const override;
23
27 VectorNd compute_rhs(const AutodiffHessianPt &pt) const override;
28
30 const Eigen::MatrixXd &mat,
31 Eigen::MatrixXd &stress,
32 Eigen::MatrixXd &result) const override;
33
34 void compute_stiffness_value(const double t,
36 const Eigen::MatrixXd &local_pts,
37 const Eigen::MatrixXd &displacement,
38 Eigen::MatrixXd &tensor) const override;
39
41 Eigen::Matrix<AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1> kernel(const int dim, const AutodiffGradPt &rvect, const AutodiffScalarGrad &r) const override;
42 };
43 } // namespace assembler
44} // namespace polyfem
ElementAssemblyValues vals
Definition Assembler.cpp:22
stores per element basis values at given quadrature points and geometric mapping
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > kernel(const int dim, const AutodiffGradPt &rvect, const AutodiffScalarGrad &r) const override
kernel of the pde, used in kernel problem
Definition Laplacian.cpp:36
std::map< std::string, ParamFunc > parameters() const override
Definition Laplacian.hpp:17
void compute_stress_grad_multiply_mat(const OptAssemblerData &data, const Eigen::MatrixXd &mat, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override
Definition Laplacian.cpp:50
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 9, 1 > assemble(const LinearAssemblerData &data) const override
computes local stiffness matrix (1x1) for bases i,j where i,j is passed in through data ie integral o...
Definition Laplacian.cpp:13
void compute_stiffness_value(const double t, const assembler::ElementAssemblyValues &vals, const Eigen::MatrixXd &local_pts, const Eigen::MatrixXd &displacement, Eigen::MatrixXd &tensor) const override
Definition Laplacian.cpp:59
VectorNd compute_rhs(const AutodiffHessianPt &pt) const override
uses autodiff to compute the rhs for a fabricated solution in this case it just return pt....
Definition Laplacian.cpp:28
std::string name() const override
Definition Laplacian.hpp:16
assemble matrix based on the local assembler local assembler is eg Laplace, LinearElasticity etc
void assemble(const bool is_volume, const int n_basis, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const AssemblyValsCache &cache, const double t, StiffnessMatrix &stiffness, const bool is_mass=false) const override
assembles the stiffness matrix for the given basis the bilinear form (local assembler) is encoded by ...
Eigen::Matrix< AutodiffScalarHessian, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffHessianPt
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > VectorNd
Definition Types.hpp:11
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffGradPt
Automatic differentiation scalar with first-order derivatives.
Definition autodiff.h:112