From: kronbichler Date: Tue, 2 Aug 2011 13:34:29 +0000 (+0000) Subject: Fix compilation on systems without std-c++11. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81413ea64d79823c266ebedd4cd5baabbbdafa13;p=dealii-svn.git Fix compilation on systems without std-c++11. git-svn-id: https://svn.dealii.org/trunk@23992 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/symmetric_tensor.h b/deal.II/include/deal.II/base/symmetric_tensor.h index 4029965e0b..d75ad3846b 100644 --- a/deal.II/include/deal.II/base/symmetric_tensor.h +++ b/deal.II/include/deal.II/base/symmetric_tensor.h @@ -20,20 +20,27 @@ DEAL_II_NAMESPACE_OPEN template class SymmetricTensor; -template SymmetricTensor<2,dim,Number> +template SymmetricTensor<2,dim> unit_symmetric_tensor (); -template SymmetricTensor<4,dim,Number> +template SymmetricTensor<4,dim> deviator_tensor (); -template SymmetricTensor<4,dim,Number> +template SymmetricTensor<4,dim> identity_tensor (); -template SymmetricTensor<4,dim,Number> + +template SymmetricTensor<2,dim,Number> +unit_symmetric_tensor (); +template SymmetricTensor<4,dim,Number> +deviator_tensor (); +template SymmetricTensor<4,dim,Number> +identity_tensor (); +template SymmetricTensor<4,dim,Number> invert (const SymmetricTensor<4,dim,Number> &); -template Number +template Number trace (const SymmetricTensor<2,dim2,Number> &); -template SymmetricTensor<2,dim,Number> +template SymmetricTensor<2,dim,Number> deviator (const SymmetricTensor<2,dim,Number> &); -template Number +template Number determinant (const SymmetricTensor<2,dim,Number> &); @@ -2295,6 +2302,21 @@ unit_symmetric_tensor () +/** + * Return a unit symmetric tensor of rank 2 for double tensor. + * + * @relates SymmetricTensor + * @author Wolfgang Bangerth, 2005 + */ +template +inline +SymmetricTensor<2,dim> +unit_symmetric_tensor () +{ + return unit_symmetric_tensor(); +} + + /** * Return the tensor of rank 4 that, when multiplied by a symmetric rank 2 @@ -2337,6 +2359,30 @@ deviator_tensor () +/** + * Return the tensor of rank 4 that, when multiplied by a symmetric rank 2 + * tensor t returns the deviator dev t. It is the operator + * representation of the linear deviator operator. + * + * For every tensor t, there holds the identity + * deviator(t)==deviator_tensor<dim>()*t, up to numerical + * round-off. The reason this operator representation is provided is that one + * sometimes needs to invert operators like identity_tensor<dim>() + + * delta_t*deviator_tensor<dim>() or similar. + * + * @relates SymmetricTensor + * @author Wolfgang Bangerth, 2005 + */ +template +inline +SymmetricTensor<4,dim> +deviator_tensor () +{ + return deviator_tensor(); +} + + + /** * Return the tensor of rank 4 that, when multiplied by a symmetric rank 2 * tensor t returns the deviator dev t. It is the operator @@ -2384,6 +2430,37 @@ identity_tensor () +/** + * Return the tensor of rank 4 that, when multiplied by a symmetric rank 2 + * tensor t returns the deviator dev t. It is the operator + * representation of the linear deviator operator. + * + * Note that this tensor, even though it is the identity, has a somewhat funny + * form, and in particular does not only consist of zeros and ones. For + * example, for dim=2, the identity tensor has all zero entries + * except for id[0][0][0][0]=id[1][1][1][1]=1 and + * id[0][1][0][1]=id[0][1][1][0]=id[1][0][0][1]=id[1][0][1][0]=1/2. To + * see why this factor of 1/2 is necessary, consider computing A=Id + * . B. For the element a_01 we have a_01=id_0100 b_00 + + * id_0111 b_11 + id_0101 b_01 + id_0110 b_10. On the other hand, we need + * to have a_01=b_01, and symmetry implies b_01=b_10, + * leading to a_01=(id_0101+id_0110) b_01, or, again by symmetry, + * id_0101=id_0110=1/2. Similar considerations hold for the + * three-dimensional case. + * + * @relates SymmetricTensor + * @author Wolfgang Bangerth, 2005 + */ +template +inline +SymmetricTensor<4,dim> +identity_tensor () +{ + return identity_tensor(); +} + + + /** * Invert a symmetric rank-4 tensor. Since symmetric rank-4 tensors are * mappings from and to symmetric rank-2 tensors, they can have an