10 namespace StVenantKirchhoff
21 template <
int dim,
typename number>
24 dealii::Vector<number>& result,
const dealii::FEValuesBase<dim>& fe,
25 const dealii::VectorSlice<
const std::vector<std::vector<dealii::Tensor<1, dim>>>>& input,
26 double lambda = 0.,
double mu = 1.)
28 const unsigned int nq = fe.n_quadrature_points;
29 const unsigned int n_dofs = fe.dofs_per_cell;
35 for (
unsigned int k = 0; k < nq; ++k)
37 const double dx = fe.JxW(k);
39 dealii::Tensor<2, dim> F;
41 dealii::Tensor<2, dim> E;
42 for (
unsigned int d1 = 0; d1 < dim; ++d1)
45 for (
unsigned int d2 = 0; d2 < dim; ++d2)
47 F[d1][d2] += input[d1][k][d2];
48 E[d1][d2] = .5 * (input[d1][k][d2] + input[d2][k][d1]);
49 for (
unsigned int dd = 0; dd < dim; ++dd)
50 E[d1][d2] += .5 * input[dd][k][d1] * input[dd][k][d2];
55 for (
unsigned int dd = 0; dd < dim; ++dd)
57 for (
unsigned int dd = 0; dd < dim; ++dd)
58 E[dd][dd] += lambda / (2. * mu) * trace;
63 for (
unsigned int i = 0; i < n_dofs; ++i)
65 for (
unsigned int d1 = 0; d1 < dim; ++d1)
66 for (
unsigned int d2 = 0; d2 < dim; ++d2)
68 double dv = fe.shape_grad_component(i, k, d1)[d2];
72 for (
unsigned int dd = 0; dd < dim; ++dd)
73 stress += 2. * mu * F[d1][dd] * E[dd][d2];
75 result(i) += dx * stress * dv;
Definition: elasticity/eigen.h:25
void cell_residual(dealii::Vector< number > &result, const dealii::FEValuesBase< dim > &fe, const dealii::VectorSlice< const std::vector< std::vector< dealii::Tensor< 1, dim >>>> &input, double lambda=0., double mu=1.)
Definition: elasticity/integrators.h:23