7 bool delta(
int i,
int j)
9 return (i == j) ? true :
false;
19 assert(gradi.rows() == data.
da.size());
20 for (
int k = 0; k < gradi.rows(); ++k)
23 res += gradi.row(k).dot(gradj.row(k)) * data.
da(k);
25 return Eigen::Matrix<double, 1, 1>::Constant(res);
30 Eigen::Matrix<double, 1, 1> result;
31 assert(pt.size() == 1);
32 result(0) = pt(0).getHessian().trace();
38 Eigen::Matrix<AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1> res(1);
41 res(0) = -1. / (2 * M_PI) * log(r);
43 res(0) = 1. / (4 * M_PI * r);
51 const Eigen::MatrixXd &mat,
52 Eigen::MatrixXd &stress,
53 Eigen::MatrixXd &result)
const
61 const Eigen::MatrixXd &local_pts,
62 const Eigen::MatrixXd &displacement,
63 Eigen::MatrixXd &tensor)
const
65 const int dim = local_pts.cols();
66 tensor.resize(local_pts.rows(), dim * dim);
67 assert(displacement.cols() == 1);
69 for (
long p = 0; p < local_pts.rows(); ++p)
71 for (
int i = 0, idx = 0; i < dim; i++)
72 for (
int j = 0; j < dim; j++)
74 tensor(p, idx) = delta(i, j);
ElementAssemblyValues vals
stores per element basis values at given quadrature points and geometric mapping
std::vector< AssemblyValues > basis_values
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
void compute_stress_grad_multiply_mat(const OptAssemblerData &data, const Eigen::MatrixXd &mat, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override
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...
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
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....
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 int i
first local order
const int j
second local order
const Eigen::MatrixXd & grad_u_i
Eigen::Matrix< AutodiffScalarHessian, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffHessianPt
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffGradPt
Automatic differentiation scalar with first-order derivatives.