Skip to content

Commit ff0c142

Browse files
committed
make the codes neater
1 parent 69857a4 commit ff0c142

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/utilities.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3309,10 +3309,12 @@ namespace aspect
33093309
double consistent_second_invariant_of_deviatoric_tensor(const SymmetricTensor<2,dim> &t)
33103310
{
33113311
if (dim == 2)
3312-
return -( Utilities::fixed_power<2,double>(t[0][0]) // t11^2
3313-
+ Utilities::fixed_power<2,double>(t[1][1]) // t22^2
3314-
+ Utilities::fixed_power<2,double>(t[0][0] + t[1][1]) // t33^2
3315-
+ Utilities::fixed_power<2,double>(t[0][1]) * 2.0 // 2*t12^2
3312+
// Under plane strain assumption, t is not a 2D tensor, but a "slice" of
3313+
// a 3D tensor. Therefore, t[2][2] is generally not zero, but equals to
3314+
// -(t[0][0] + t[1][1]).
3315+
return -( t[0][0] * t[0][0] + t[1][1] * t[1][1]
3316+
+ (t[0][0] + t[1][1]) * (t[0][0] + t[1][1])
3317+
+ t[0][1] * t[0][1] * 2.0
33163318
) * 0.5;
33173319
else
33183320
return second_invariant(t);

0 commit comments

Comments
 (0)