From 875a722a2d9be3baed5065f8b66811992b9421d7 Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 20 Feb 2012 09:33:54 +0000 Subject: [PATCH] Work around one problem. git-svn-id: https://svn.dealii.org/trunk@25119 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-44/step-44.cc | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/deal.II/examples/step-44/step-44.cc b/deal.II/examples/step-44/step-44.cc index 4a880e65ca..d74de466e7 100644 --- a/deal.II/examples/step-44/step-44.cc +++ b/deal.II/examples/step-44/step-44.cc @@ -915,13 +915,34 @@ namespace Step44 // + \textrm{Grad}\ \mathbf{u}$ and // then let the material model // associated with this quadrature - // point update itself. + // point update itself. When computing + // the deformation gradient, we have to + // take care with which data types we + // compare the sum $\mathbf{I} + + // \textrm{Grad}\ \mathbf{u}$: Since + // $I$ has data type SymmetricTensor, + // just writing I + + // Grad_u_n would convert the + // second argument to a symmetric + // tensor, perform the sum, and then + // cast the result to a Tensor (i.e., + // the type of a possibly non-symmetric + // tensor). However, since + // Grad_u_n is + // nonsymmetric in general, the + // conversion to SymmetricTensor will + // fail. We can avoid this back and + // forth by converting $I$ to Tensor + // first, and then performing the + // addition as between non-symmetric + // tensors: void update_values (const Tensor<2, dim> & Grad_u_n, const double p_tilde, const double J_tilde) { - const Tensor<2, dim> F = AdditionalTools::StandardTensors::I + - Grad_u_n; + const Tensor<2, dim> F + = (Tensor<2, dim>(AdditionalTools::StandardTensors::I) + + Grad_u_n); material->update_material_data(F, p_tilde, J_tilde); // The material has been updated so -- 2.39.5