From bdbd885c7bf4a09456e947ea3304af5d3e6a22b9 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 23 May 2005 17:04:34 +0000 Subject: [PATCH] Implement the second invariant of a tensor. Implement functions 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 | 59 ++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/deal.II/base/include/base/symmetric_tensor.h b/deal.II/base/include/base/symmetric_tensor.h index 72dce592e5..57a843aa5f 100644 --- a/deal.II/base/include/base/symmetric_tensor.h +++ b/deal.II/base/include/base/symmetric_tensor.h @@ -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 third_invariant + * 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 third_invariant + * 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 third_invariant + * 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 determinant() functions and is only + * provided for greater notational simplicity (since there are also functions + * first_invariant and second_invariant). + * + * @relates SymmetricTensor + * @author Wolfgang Bangerth, 2005 + */ +template +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 trace() functions and is only + * provided for greater notational simplicity (since there are also functions + * second_invariant and third_invariant). + * + * @relates SymmetricTensor + * @author Wolfgang Bangerth, 2005 + */ +template +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 I2 = 1/2[ (trace sigma)^2 - trace (sigma^2) ]. + * + * @relates SymmetricTensor + * @author Wolfgang Bangerth, 2005 + */ +template +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 -- 2.39.5