local contributions to the matrix in the following elegant way (the variable
<code>stress_strain_tensor</code>, corresponding to the tensor $C$, has
previously been initialized with the result of the first function above):
- @verbatim
+ @code
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
for (unsigned int q_point=0; q_point<n_q_points;
*
fe_values.JxW (q_point));
}
- @endverbatim
+ @endcode
It is worth noting the expressive power of this piece of code, and to
compare it with the complications we had to go through in previous examples
for the elasticity problem. (To be fair, the SymmetricTensor class
<code>local_quadrature_points_data</code> that allows to access the stress
$\sigma^{n-1}_q$ in each quadrature point. With this the code for the right
hand side looks as this, again rather elegant:
- @verbatim
+ @code
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
const unsigned int
fe_values.JxW (q_point);
}
}
- @endverbatim
+ @endcode
Note that in the multiplication $\mathbf{f}(\mathbf{x}_q) \cdot \varphi_i(\mathbf{x}_q)$, we have made use of the fact that for the chosen finite element, only
one vector component (namely <code>component_i</code>) of $\varphi_i$ is
nonzero, and that we therefore also have to consider only one component of
The program text will reveal more about how to implement this situation, and
the results section will show what displacement pattern comes out of this
simulation.
-
-
-