Hi Alex, Well, the one thing that I can clearly identify as being problematic is that the normal vector does not transform with the deformation gradient (directly), but rather with its cofactor. This is what Nanson’s formula for the transformation of surface areas tell us. We actually have a function that does this transformation, namely Physics::Transformations::nansons_formula() <https://dealii.org/current/doxygen/deal.II/namespacePhysics_1_1Transformations.html#aa82925b742c3708f625a48a7abc440bc> . Maybe you could try to use that and see if you get the result that you’re looking for.
Best, Jean-Paul > On 4. May 2021, at 12:36, Alex Cumberworth <alexandercumberwo...@gmail.com> > wrote: > > Hello, > > I would like to calculate traction/stress vectors for the deformed > configuration. I have solved for a non-linear elasticity problem and am > dealing with the Green-Lagrange strain tensor and the second Piola-Kirchoff > stress tensor. I thought the simplest way to get the traction vectors would > be to first calculate them in the material reference frame (by calculating > the stress tensor and applying it to normal vectors in the material > reference), and then using a pushforward operation (by applying the > deformation gradient) to produce the stress vectors in the spatial reference > frame (and also dividing by the determinant of the deformation vector to take > care of the change in area). > > However, the results do not appear as expected. To understand what was going > on, I first decided to apply the pushforward operation to the normal vectors. > I used the following code to carry this out. > > template <int dim> > class SpatialNormalVectorPostprocess: public DataPostprocessorVector<dim> { > public: > SpatialNormalVectorPostprocess(); > virtual void evaluate_vector_field( > const DataPostprocessorInputs::Vector<dim>& input_data, > std::vector<Vector<double>>& computed_quantities) const; > }; > > template <int dim> > SpatialNormalVectorPostprocess<dim>::SpatialNormalVectorPostprocess(): > DataPostprocessorVector<dim>( > "spatial_normal", > update_gradients | update_normal_vectors) {} > > template <int dim> > void SpatialNormalVectorPostprocess<dim>::evaluate_vector_field( > const DataPostprocessorInputs::Vector<dim>& input_data, > std::vector<Vector<double>>& computed_quantities) const { > > for (unsigned int i {0}; i != input_data.normals.size(); i++) { > Tensor<2, dim, double> grad_u {}; > Tensor<2, dim, double> identity_tensor {}; > for (unsigned int d {0}; d != dim; d++) { > grad_u[d] = input_data.solution_gradients[i][d]; > identity_tensor[d][d] = 1; > } > const Tensor<2, dim, double> deformation_grad { > grad_u + identity_tensor}; > const Tensor<1, dim, double> material_normal_vector { > input_data.normals[i]}; > const Tensor<1, dim, double> spatial_normal_vector_t { > deformation_grad * material_normal_vector}; > Vector<double> spatial_normal_vector(dim); > for (unsigned int d {0}; d != dim; d++) { > spatial_normal_vector[d] = spatial_normal_vector_t[d]; > } > computed_quantities[i] = spatial_normal_vector; > } > } > > However, as seen below, the resulting vectors are not normal to the surfaces: > <ring_push-forward-spatial-normal-vector.png> > > Contrast this with if I instead update the mesh and directly output the > normal vectors: > <ring_mesh-move-spatial-normal-vector.png> > > Any input would be greatly appreciated. > > Best wishes, > Alex > > -- > The deal.II project is located at http://www.dealii.org/ > <http://www.dealii.org/> > For mailing list/forum options, see > https://groups.google.com/d/forum/dealii?hl=en > <https://groups.google.com/d/forum/dealii?hl=en> > --- > You received this message because you are subscribed to the Google Groups > "deal.II User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to dealii+unsubscr...@googlegroups.com > <mailto:dealii+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/2e3fcd85-f799-419b-b66b-097513328f46n%40googlegroups.com > > <https://groups.google.com/d/msgid/dealii/2e3fcd85-f799-419b-b66b-097513328f46n%40googlegroups.com?utm_medium=email&utm_source=footer>. > <ring_mesh-move-spatial-normal-vector.png><ring_push-forward-spatial-normal-vector.png> -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/46B64689-DE75-4FCE-9FA8-59157848FBAA%40gmail.com.