]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix compilation on systems without std-c++11.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Aug 2011 13:34:29 +0000 (13:34 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 2 Aug 2011 13:34:29 +0000 (13:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@23992 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/symmetric_tensor.h

index 4029965e0b6678e023a4bb856538ad40edc57dd0..d75ad3846b7edb11e940c4a3ab8883178a9ce9c1 100644 (file)
@@ -20,20 +20,27 @@ DEAL_II_NAMESPACE_OPEN
 
 template <int rank, int dim, typename Number=double> class SymmetricTensor;
 
-template <int dim, typename Number=double> SymmetricTensor<2,dim,Number>
+template <int dim> SymmetricTensor<2,dim>
 unit_symmetric_tensor ();
-template <int dim, typename Number=double> SymmetricTensor<4,dim,Number>
+template <int dim> SymmetricTensor<4,dim>
 deviator_tensor ();
-template <int dim, typename Number=double> SymmetricTensor<4,dim,Number>
+template <int dim> SymmetricTensor<4,dim>
 identity_tensor ();
-template <int dim, typename Number=double> SymmetricTensor<4,dim,Number>
+
+template <int dim, typename Number> SymmetricTensor<2,dim,Number>
+unit_symmetric_tensor ();
+template <int dim, typename Number> SymmetricTensor<4,dim,Number>
+deviator_tensor ();
+template <int dim, typename Number> SymmetricTensor<4,dim,Number>
+identity_tensor ();
+template <int dim, typename Number> SymmetricTensor<4,dim,Number>
 invert (const SymmetricTensor<4,dim,Number> &);
-template <int dim2, typename Number=double> Number
+template <int dim2, typename Number> Number
 trace (const SymmetricTensor<2,dim2,Number> &);
 
-template <int dim, typename Number=double> SymmetricTensor<2,dim,Number>
+template <int dim, typename Number> SymmetricTensor<2,dim,Number>
 deviator (const SymmetricTensor<2,dim,Number> &);
-template <int dim, typename Number=double> Number
+template <int dim, typename Number> 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 <int dim>
+inline
+SymmetricTensor<2,dim>
+unit_symmetric_tensor ()
+{
+  return unit_symmetric_tensor<dim,double>();
+}
+
+
 
 /**
  * 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 <tt>t</tt> returns the deviator <tt>dev t</tt>. It is the operator
+ * representation of the linear deviator operator.
+ *
+ * For every tensor <tt>t</tt>, there holds the identity
+ * <tt>deviator(t)==deviator_tensor&lt;dim&gt;()*t</tt>, up to numerical
+ * round-off. The reason this operator representation is provided is that one
+ * sometimes needs to invert operators like <tt>identity_tensor&lt;dim&gt;() +
+ * delta_t*deviator_tensor&lt;dim&gt;()</tt> or similar.
+ *
+ * @relates SymmetricTensor
+ * @author Wolfgang Bangerth, 2005
+ */
+template <int dim>
+inline
+SymmetricTensor<4,dim>
+deviator_tensor ()
+{
+  return deviator_tensor<dim,double>();
+}
+
+
+
 /**
  * Return the tensor of rank 4 that, when multiplied by a symmetric rank 2
  * tensor <tt>t</tt> returns the deviator <tt>dev t</tt>. 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 <tt>t</tt> returns the deviator <tt>dev t</tt>. 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 <tt>dim=2</tt>, the identity tensor has all zero entries
+ * except for <tt>id[0][0][0][0]=id[1][1][1][1]=1</tt> and
+ * <tt>id[0][1][0][1]=id[0][1][1][0]=id[1][0][0][1]=id[1][0][1][0]=1/2</tt>. To
+ * see why this factor of 1/2 is necessary, consider computing <tt>A=Id
+ * . B</tt>. For the element <tt>a_01</tt> we have <tt>a_01=id_0100 b_00 +
+ * id_0111 b_11 + id_0101 b_01 + id_0110 b_10</tt>. On the other hand, we need
+ * to have <tt>a_01=b_01</tt>, and symmetry implies <tt>b_01=b_10</tt>,
+ * leading to <tt>a_01=(id_0101+id_0110) b_01</tt>, or, again by symmetry,
+ * <tt>id_0101=id_0110=1/2</tt>. Similar considerations hold for the
+ * three-dimensional case.
+ *
+ * @relates SymmetricTensor
+ * @author Wolfgang Bangerth, 2005
+ */
+template <int dim>
+inline
+SymmetricTensor<4,dim>
+identity_tensor ()
+{
+  return identity_tensor<dim,double>();
+}
+
+
+
 /**
  * Invert a symmetric rank-4 tensor. Since symmetric rank-4 tensors are
  * mappings from and to symmetric rank-2 tensors, they can have an

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.