PolyFEM
Loading...
Searching...
No Matches
Bilaplacian.cpp
Go to the documentation of this file.
1#include "Bilaplacian.hpp"
2
3namespace polyfem::assembler
4{
5 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1>
7 {
8 const Eigen::MatrixXd &gradi = data.psi_vals.basis_values[data.i].grad_t_m;
9 const Eigen::MatrixXd &gradj = data.phi_vals.basis_values[data.j].grad_t_m;
10
11 // return ((psii.array() * phij.array()).rowwise().sum().array() * da.array()).colwise().sum();
12 double res = 0;
13 for (int k = 0; k < gradi.rows(); ++k)
14 {
15 res += gradi.row(k).dot(gradj.row(k)) * data.da(k);
16 }
17 return Eigen::Matrix<double, 1, 1>::Constant(res);
18 }
19
20 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
22 {
23 const double tmp = (data.vals.basis_values[data.i].val.array() * data.vals.basis_values[data.j].val.array() * data.da.array()).sum();
24 return Eigen::Matrix<double, 1, 1>::Constant(tmp);
25 }
26
27} // namespace polyfem::assembler
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 9, 1 > assemble(const LinearAssemblerData &data) const override
local assembly function that defines the bilinear form (LHS) computes and returns a single local stif...
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > assemble(const MixedAssemblerData &data) const override
const ElementAssemblyValues & vals
stores the evaluation for that element
const QuadratureVector & da
contains both the quadrature weight and the change of metric in the integral
const QuadratureVector & da
contains both the quadrature weight and the change of metric in the integral
const ElementAssemblyValues & phi_vals
stores the evaluation for that element
const ElementAssemblyValues & psi_vals
stores the evaluation for that element
Used for test only.