]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implement the second invariant of a tensor. Implement functions
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2005 17:04:34 +0000 (17:04 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 23 May 2005 17:04:34 +0000 (17:04 +0000)
first_invariant and third_invariant that just link to trace() and determinant().

git-svn-id: https://svn.dealii.org/trunk@10699 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 72dce592e5f37a1092537111c015ff46a769fe6a..57a843aa5f8401e36c70439a83d4db7ef0744d60 100644 (file)
@@ -1792,6 +1792,9 @@ SymmetricTensor<4,3>::norm () const
  * For the present case of one-dimensional tensors, the determinant
  * equals the only element and is therefore equivalent to the trace.
  *
+ * For greater notational simplicity, there is also a <tt>third_invariant</tt>
+ * function that returns the determinant of a tensor.
+ *
  * @relates SymmetricTensor
  * @author Wolfgang Bangerth, 2005
  */
@@ -1807,6 +1810,9 @@ double determinant (const SymmetricTensor<2,1> &t)
  * Compute the determinant of a tensor or rank 2. The determinant is
  * also commonly referred to as the third invariant of rank-2 tensors.
  *
+ * For greater notational simplicity, there is also a <tt>third_invariant</tt>
+ * function that returns the determinant of a tensor.
+ *
  * @relates SymmetricTensor
  * @author Wolfgang Bangerth, 2005
  */
@@ -1823,6 +1829,9 @@ double determinant (const SymmetricTensor<2,2> &t)
  * Compute the determinant of a tensor or rank 2. The determinant is
  * also commonly referred to as the third invariant of rank-2 tensors.
  *
+ * For greater notational simplicity, there is also a <tt>third_invariant</tt>
+ * function that returns the determinant of a tensor.
+ *
  * @relates SymmetricTensor
  * @author Wolfgang Bangerth, 2005
  */
@@ -1841,6 +1850,24 @@ double determinant (const SymmetricTensor<2,3> &t)
 
 
 
+/**
+ * Compute the determinant of a tensor or rank 2. This function therefore
+ * computes the same value as the <tt>determinant()</tt> functions and is only
+ * provided for greater notational simplicity (since there are also functions
+ * <tt>first_invariant</tt> and <tt>second_invariant</tt>).
+ *
+ * @relates SymmetricTensor
+ * @author Wolfgang Bangerth, 2005
+ */
+template <int dim>
+inline
+double third_invariant (const SymmetricTensor<2,dim> &t)
+{
+  return determinant (t);
+}
+
+
+
 /**
  * Compute and return the trace of a tensor of rank 2, i.e. the sum of
  * its diagonal entries. The trace is the first invariant of a rank-2
@@ -1859,6 +1886,38 @@ double trace (const SymmetricTensor<2,dim> &d)
 }
 
 
+/**
+ * Compute the trace of a tensor or rank 2. This function therefore
+ * computes the same value as the <tt>trace()</tt> functions and is only
+ * provided for greater notational simplicity (since there are also functions
+ * <tt>second_invariant</tt> and <tt>third_invariant</tt>).
+ *
+ * @relates SymmetricTensor
+ * @author Wolfgang Bangerth, 2005
+ */
+template <int dim>
+inline
+double first_invariant (const SymmetricTensor<2,dim> &t)
+{
+  return trace (t);
+}
+
+
+/**
+ * Compute the second invariant a tensor or rank 2. The second invariant is
+ * defined as <tt>I2 = 1/2[ (trace sigma)^2 - trace (sigma^2) ]</tt>.
+ *
+ * @relates SymmetricTensor
+ * @author Wolfgang Bangerth, 2005
+ */
+template <int dim>
+inline
+double second_invariant (const SymmetricTensor<2,dim> &t)
+{
+  return (trace(t)*trace(t) - t*t) / 2;
+}
+
+
 
 /**
  * Return the transpose of the given symmetric tensor. Since we are working

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.