17 #ifndef __deal2__symmetric_tensor_h
18 #define __deal2__symmetric_tensor_h
21 #include <deal.II/base/tensor.h>
22 #include <deal.II/base/table_indices.h>
36 template <
int dim2,
typename Number> Number
41 template <
int dim,
typename Number> Number
53 namespace SymmetricTensorAccessors
68 const unsigned int new_index,
69 const unsigned int position)
94 const unsigned int new_index,
95 const unsigned int position)
135 template <
int rank1,
int rank2,
int dim,
typename Number>
138 typedef ::SymmetricTensor<rank1+rank2-4,dim,Number>
type;
156 template <
int dim,
typename Number>
183 template <
int rank,
int dim,
typename Number>
190 template <
int dim,
typename Number>
198 static const unsigned int
199 n_independent_components = (dim*dim + dim)/2;
214 template <
int dim,
typename Number>
224 static const unsigned int
225 n_rank2_components = (dim*dim + dim)/2;
231 static const unsigned int
232 n_independent_components = (n_rank2_components *
255 template <
int rank,
int dim,
bool constness,
typename Number>
266 template <
int rank,
int dim,
typename Number>
269 typedef const ::SymmetricTensor<rank,dim,Number>
tensor_type;
271 typedef Number reference;
283 template <
int rank,
int dim,
typename Number>
286 typedef ::SymmetricTensor<rank,dim,Number>
tensor_type;
288 typedef Number &reference;
327 template <
int rank,
int dim,
bool constness,
int P,
typename Number>
416 template <
int,
int,
bool,
int,
typename>
418 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG
419 friend class ::SymmetricTensor<rank,dim,Number>;
420 friend class Accessor<rank,dim,constness,P+1,Number>;
436 template <
int rank,
int dim,
bool constness,
typename Number>
530 template <
int,
int,
bool,
int,
typename>
532 # ifndef DEAL_II_TEMPL_SPEC_FRIEND_BUG
533 friend class ::SymmetricTensor<rank,dim,Number>;
608 template <
int rank,
int dim,
typename Number>
935 Number
norm ()
const;
999 template <
class Archive>
1000 void serialize(Archive &ar,
const unsigned int version);
1031 template <
int dim2,
typename Number2>
1034 template <
int dim2,
typename Number2>
1037 template <
int dim2,
typename Number2>
1041 template <
int dim2,
typename Number2>
1044 template <
int dim2,
typename Number2>
1047 template <
int dim2,
typename Number2>
1050 template <
int dim2,
typename Number2>
1062 namespace SymmetricTensorAccessors
1064 template <
int rank,
int dim,
bool constness,
int P,
typename Number>
1070 previous_indices (previous_indices)
1075 template <
int rank,
int dim,
bool constness,
int P,
typename Number>
1076 Accessor<rank,dim,constness,P-1,Number>
1077 Accessor<rank,dim,constness,P,Number>::operator[] (
const unsigned int i)
1079 return Accessor<rank,dim,constness,P-1,Number> (tensor,
1080 merge (previous_indices, i, rank-P));
1085 template <
int rank,
int dim,
bool constness,
typename Number>
1086 Accessor<rank,dim,constness,1,Number>::
1087 Accessor (tensor_type &tensor,
1091 previous_indices (previous_indices)
1096 template <
int rank,
int dim,
bool constness,
typename Number>
1097 typename Accessor<rank,dim,constness,1,Number>::reference
1098 Accessor<rank,dim,constness,1,Number>::operator[] (
const unsigned int i)
1100 return tensor(merge (previous_indices, i, rank-1));
1109 template <
int rank,
int dim,
typename Number>
1116 template <
int rank,
int dim,
typename Number>
1151 template <
int rank,
int dim,
typename Number>
1160 template <
int rank,
int dim,
typename Number>
1171 template <
int rank,
int dim,
typename Number>
1190 template <
typename Number>
1195 const Number t[1][1] = {{data[0]}};
1199 template <
typename Number>
1204 const Number t[2][2] = {{data[0], data[2]},
1210 template <
typename Number>
1215 const Number t[3][3] = {{data[0], data[3], data[4]},
1216 {data[3], data[1], data[5]},
1217 {data[4], data[5], data[2]}
1225 template <
int rank,
int dim,
typename Number>
1231 return internal::conversion(data);
1236 template <
int rank,
int dim,
typename Number>
1242 return data == t.data;
1247 template <
int rank,
int dim,
typename Number>
1250 SymmetricTensor<rank,dim,Number>::operator !=
1253 return data != t.data;
1258 template <
int rank,
int dim,
typename Number>
1261 SymmetricTensor<rank,dim,Number>::operator +=
1270 template <
int rank,
int dim,
typename Number>
1273 SymmetricTensor<rank,dim,Number>::operator -=
1282 template <
int rank,
int dim,
typename Number>
1293 template <
int rank,
int dim,
typename Number>
1304 template <
int rank,
int dim,
typename Number>
1316 template <
int rank,
int dim,
typename Number>
1328 template <
int rank,
int dim,
typename Number>
1340 template <
int rank,
int dim,
typename Number>
1350 template <
int rank,
int dim,
typename Number>
1364 template <
int dim,
typename Number>
1366 typename SymmetricTensorAccessors::double_contraction_result<2,2,dim,Number>::type
1373 return data[0] * sdata[0];
1375 return (data[0] * sdata[0] +
1376 data[1] * sdata[1] +
1377 2*data[2] * sdata[2]);
1379 return (data[0] * sdata[0] +
1380 data[1] * sdata[1] +
1381 data[2] * sdata[2] +
1382 2*data[3] * sdata[3] +
1383 2*data[4] * sdata[4] +
1384 2*data[5] * sdata[5]);
1387 for (
unsigned int d=0; d<dim; ++d)
1388 sum += data[d] * sdata[d];
1389 for (
unsigned int d=dim; d<(dim*(dim+1)/2); ++d)
1390 sum += Number(2.) * data[d] * sdata[d];
1397 template <
int dim,
typename Number>
1399 typename SymmetricTensorAccessors::double_contraction_result<4,2,dim,Number>::type
1407 tmp[0] = data[0][0] * sdata[0];
1410 for (
unsigned int i=0; i<3; ++i)
1411 tmp[i] = (data[i][0] * sdata[0] +
1412 data[i][1] * sdata[1] +
1413 2 * data[i][2] * sdata[2]);
1416 for (
unsigned int i=0; i<6; ++i)
1417 tmp[i] = (data[i][0] * sdata[0] +
1418 data[i][1] * sdata[1] +
1419 data[i][2] * sdata[2] +
1420 2 * data[i][3] * sdata[3] +
1421 2 * data[i][4] * sdata[4] +
1422 2 * data[i][5] * sdata[5]);
1432 template <
int dim,
typename Number>
1442 tmp[0] = data[0] * sdata[0][0];
1445 for (
unsigned int i=0; i<3; ++i)
1446 tmp[i] = (data[0] * sdata[0][i] +
1447 data[1] * sdata[1][i] +
1448 2 * data[2] * sdata[2][i]);
1451 for (
unsigned int i=0; i<6; ++i)
1452 tmp[i] = (data[0] * sdata[0][i] +
1453 data[1] * sdata[1][i] +
1454 data[2] * sdata[2][i] +
1455 2 * data[3] * sdata[3][i] +
1456 2 * data[4] * sdata[4][i] +
1457 2 * data[5] * sdata[5][i]);
1467 template <
int dim,
typename Number>
1477 tmp[0][0] = data[0][0] * sdata[0][0];
1480 for (
unsigned int i=0; i<3; ++i)
1481 for (
unsigned int j=0; j<3; ++j)
1482 tmp[i][j] = (data[i][0] * sdata[0][j] +
1483 data[i][1] * sdata[1][j] +
1484 2*data[i][2] * sdata[2][j]);
1487 for (
unsigned int i=0; i<6; ++i)
1488 for (
unsigned int j=0; j<6; ++j)
1489 tmp[i][j] = (data[i][0] * sdata[0][j] +
1490 data[i][1] * sdata[1][j] +
1491 data[i][2] * sdata[2][j] +
1492 2*data[i][3] * sdata[3][j] +
1493 2*data[i][4] * sdata[4][j] +
1494 2*data[i][5] * sdata[5][j]);
1506 template <
int rank,
int dim,
typename Number>
1515 return internal::perform_double_contraction<dim,Number> (data, s.
data);
1520 template <
int rank,
int dim,
typename Number>
1527 tmp.
data = internal::perform_double_contraction<dim,Number> (data,s.
data);
1543 template <
int dim,
typename Number>
1558 if (indices[0] == indices[1])
1559 return data[indices[0]];
1564 Assert (((indices[0]==1) && (indices[1]==0)) ||
1565 ((indices[0]==0) && (indices[1]==1)),
1573 if (indices[0] == indices[1])
1574 return data[indices[0]];
1581 sorted_indices.sort ();
1583 if ((sorted_indices[0]==0) && (sorted_indices[1]==1))
1585 else if ((sorted_indices[0]==0) && (sorted_indices[1]==2))
1587 else if ((sorted_indices[0]==1) && (sorted_indices[1]==2))
1594 static Number dummy_but_referenceable = Number();
1595 return dummy_but_referenceable;
1600 template <
int dim,
typename Number>
1615 if (indices[0] == indices[1])
1616 return data[indices[0]];
1621 Assert (((indices[0]==1) && (indices[1]==0)) ||
1622 ((indices[0]==0) && (indices[1]==1)),
1630 if (indices[0] == indices[1])
1631 return data[indices[0]];
1638 sorted_indices.sort ();
1640 if ((sorted_indices[0]==0) && (sorted_indices[1]==1))
1642 else if ((sorted_indices[0]==0) && (sorted_indices[1]==2))
1644 else if ((sorted_indices[0]==1) && (sorted_indices[1]==2))
1651 static Number dummy_but_referenceable = 0;
1652 return dummy_but_referenceable;
1657 template <
int dim,
typename Number>
1679 unsigned int base_index[2] ;
1680 if ((indices[0] == 0) && (indices[1] == 0))
1682 else if ((indices[0] == 1) && (indices[1] == 1))
1687 if ((indices[2] == 0) && (indices[3] == 0))
1689 else if ((indices[2] == 1) && (indices[3] == 1))
1694 return data[base_index[0]][base_index[1]];
1708 unsigned int base_index[2] ;
1709 if ((indices[0] == 0) && (indices[1] == 0))
1711 else if ((indices[0] == 1) && (indices[1] == 1))
1713 else if ((indices[0] == 2) && (indices[1] == 2))
1715 else if (((indices[0] == 0) && (indices[1] == 1)) ||
1716 ((indices[0] == 1) && (indices[1] == 0)))
1718 else if (((indices[0] == 0) && (indices[1] == 2)) ||
1719 ((indices[0] == 2) && (indices[1] == 0)))
1723 Assert (((indices[0] == 1) && (indices[1] == 2)) ||
1724 ((indices[0] == 2) && (indices[1] == 1)),
1729 if ((indices[2] == 0) && (indices[3] == 0))
1731 else if ((indices[2] == 1) && (indices[3] == 1))
1733 else if ((indices[2] == 2) && (indices[3] == 2))
1735 else if (((indices[2] == 0) && (indices[3] == 1)) ||
1736 ((indices[2] == 1) && (indices[3] == 0)))
1738 else if (((indices[2] == 0) && (indices[3] == 2)) ||
1739 ((indices[2] == 2) && (indices[3] == 0)))
1743 Assert (((indices[2] == 1) && (indices[3] == 2)) ||
1744 ((indices[2] == 2) && (indices[3] == 1)),
1749 return data[base_index[0]][base_index[1]];
1756 static Number dummy;
1761 template <
int dim,
typename Number>
1783 unsigned int base_index[2] ;
1784 if ((indices[0] == 0) && (indices[1] == 0))
1786 else if ((indices[0] == 1) && (indices[1] == 1))
1791 if ((indices[2] == 0) && (indices[3] == 0))
1793 else if ((indices[2] == 1) && (indices[3] == 1))
1798 return data[base_index[0]][base_index[1]];
1812 unsigned int base_index[2] ;
1813 if ((indices[0] == 0) && (indices[1] == 0))
1815 else if ((indices[0] == 1) && (indices[1] == 1))
1817 else if ((indices[0] == 2) && (indices[1] == 2))
1819 else if (((indices[0] == 0) && (indices[1] == 1)) ||
1820 ((indices[0] == 1) && (indices[1] == 0)))
1822 else if (((indices[0] == 0) && (indices[1] == 2)) ||
1823 ((indices[0] == 2) && (indices[1] == 0)))
1827 Assert (((indices[0] == 1) && (indices[1] == 2)) ||
1828 ((indices[0] == 2) && (indices[1] == 1)),
1833 if ((indices[2] == 0) && (indices[3] == 0))
1835 else if ((indices[2] == 1) && (indices[3] == 1))
1837 else if ((indices[2] == 2) && (indices[3] == 2))
1839 else if (((indices[2] == 0) && (indices[3] == 1)) ||
1840 ((indices[2] == 1) && (indices[3] == 0)))
1842 else if (((indices[2] == 0) && (indices[3] == 2)) ||
1843 ((indices[2] == 2) && (indices[3] == 0)))
1847 Assert (((indices[2] == 1) && (indices[3] == 2)) ||
1848 ((indices[2] == 2) && (indices[3] == 1)),
1853 return data[base_index[0]][base_index[1]];
1860 static Number dummy;
1868 template <
int rank,
int dim,
typename Number>
1873 for (
unsigned int r=0; r<rank; ++r)
1875 return internal::symmetric_tensor_access<dim,Number> (indices, data);
1880 template <
int rank,
int dim,
typename Number>
1886 for (
unsigned int r=0; r<rank; ++r)
1888 return internal::symmetric_tensor_access<dim,Number> (indices, data);
1893 template <
int rank,
int dim,
typename Number>
1904 template <
int rank,
int dim,
typename Number>
1915 template <
int rank,
int dim,
typename Number>
1920 return data[component_to_unrolled_index(indices)];
1925 template <
int rank,
int dim,
typename Number>
1930 return data[component_to_unrolled_index(indices)];
1935 template <
int rank,
int dim,
typename Number>
1946 template <
int rank,
int dim,
typename Number>
1959 template <
int dim,
typename Number>
1964 Number return_value;
1968 return_value = std::fabs(data[0]);
1971 return_value = std::sqrt(data[0]*data[0] + data[1]*data[1] +
1975 return_value = std::sqrt(data[0]*data[0] + data[1]*data[1] +
1976 data[2]*data[2] + 2*data[3]*data[3] +
1977 2*data[4]*data[4] + 2*data[5]*data[5]);
1981 for (
unsigned int d=0; d<dim; ++d)
1982 return_value += data[d] * data[d];
1983 for (
unsigned int d=dim; d<(dim*dim+dim)/2; ++d)
1984 return_value += 2 * data[d] * data[d];
1985 return_value = std::sqrt(return_value);
1987 return return_value;
1992 template <
int dim,
typename Number>
1997 Number return_value;
1998 const unsigned int n_independent_components = data.dimension;
2003 return_value = std::fabs (data[0][0]);
2007 for (
unsigned int i=0; i<dim; ++i)
2008 for (
unsigned int j=0; j<dim; ++j)
2009 return_value += data[i][j] * data[i][j];
2010 for (
unsigned int i=0; i<dim; ++i)
2011 for (
unsigned int j=dim; j<n_independent_components; ++j)
2012 return_value += 2 * data[i][j] * data[i][j];
2013 for (
unsigned int i=dim; i<n_independent_components; ++i)
2014 for (
unsigned int j=0; j<dim; ++j)
2015 return_value += 2 * data[i][j] * data[i][j];
2016 for (
unsigned int i=dim; i<n_independent_components; ++i)
2017 for (
unsigned int j=dim; j<n_independent_components; ++j)
2018 return_value += 4 * data[i][j] * data[i][j];
2019 return_value = std::sqrt(return_value);
2022 return return_value;
2029 template <
int rank,
int dim,
typename Number>
2034 return internal::compute_norm<dim,Number> (data);
2039 template <
int rank,
int dim,
typename Number>
2055 static const unsigned int table[2][2] = {{0, 2},
2058 return table[indices[0]][indices[1]];
2062 static const unsigned int table[3][3] = {{0, 3, 4},
2066 return table[indices[0]][indices[1]];
2070 static const unsigned int table[4][4] = {{0, 4, 5, 6},
2075 return table[indices[0]][indices[1]];
2085 template <
int rank,
int dim,
typename Number>
2089 (
const unsigned int i)
2128 template <
int rank,
int dim,
typename Number>
2129 template <
class Archive>
2155 template <
int dim,
typename Number>
2191 template <
int dim,
typename Number>
2208 template <
int dim,
typename Number>
2212 for (
unsigned int i=0; i<dim; ++i)
2227 template <
int dim,
typename Number>
2242 template <
typename Number>
2258 template <
typename Number>
2262 return t[0][0]*t[1][1] - t[0][1]*t[0][1];
2274 template <
typename Number>
2278 return (t[0][0]*t[1][1] + t[1][1]*t[2][2] + t[2][2]*t[0][0]
2279 - t[0][1]*t[0][1] - t[0][2]*t[0][2] - t[1][2]*t[1][2]);
2294 template <
int rank,
int dim,
typename Number>
2313 template <
int dim,
typename Number>
2321 const Number tr =
trace(t) / dim;
2322 for (
unsigned int i=0; i<dim; ++i)
2336 template <
int dim,
typename Number>
2339 unit_symmetric_tensor ()
2354 for (
unsigned int d=0; d<dim; ++d)
2371 unit_symmetric_tensor ()
2373 return unit_symmetric_tensor<dim,double>();
2392 template <
int dim,
typename Number>
2400 for (
unsigned int i=0; i<dim; ++i)
2401 for (
unsigned int j=0; j<dim; ++j)
2402 tmp.
data[i][j] = (i==j ? 1 : 0) - 1./dim;
2409 for (
unsigned int i=dim;
2410 i<internal::SymmetricTensorAccessors::StorageType<4,dim,Number>::n_rank2_components;
2412 tmp.
data[i][i] = 0.5;
2438 return deviator_tensor<dim,double>();
2465 template <
int dim,
typename Number>
2473 for (
unsigned int i=0; i<dim; ++i)
2481 for (
unsigned int i=dim;
2482 i<internal::SymmetricTensorAccessors::StorageType<4,dim,Number>::n_rank2_components;
2484 tmp.
data[i][i] = 0.5;
2517 return identity_tensor<dim,double>();
2535 template <
int dim,
typename Number>
2581 const Number t4 = t.
data[0][0]*t.
data[1][1],
2587 t07 = 1.0/(t4*t.
data[2][2]-t6*t.
data[2][1]-
2589 t01*t.
data[1][2]-t04*t.
data[1][1]);
2595 tmp.
data[1][2] = -(t6-t00)*t07;
2598 tmp.
data[2][2] = (t4-t8)*t07;
2602 tmp.
data[2][0] /= 2;
2603 tmp.
data[2][1] /= 2;
2604 tmp.
data[0][2] /= 2;
2605 tmp.
data[1][2] /= 2;
2606 tmp.
data[2][2] /= 4;
2651 template <
int dim,
typename Number>
2660 for (
unsigned int i=0; i<dim; ++i)
2661 for (
unsigned int j=i; j<dim; ++j)
2662 for (
unsigned int k=0; k<dim; ++k)
2663 for (
unsigned int l=k; l<dim; ++l)
2664 tmp[i][j][k][l] = t1[i][j] * t2[k][l];
2679 template <
typename Number>
2684 const Number array[1]
2699 template <
typename Number>
2704 const Number array[3]
2705 = { t[0][0], t[1][1], (t[0][1] + t[1][0])/2 };
2719 template <
typename Number>
2724 const Number array[6]
2725 = { t[0][0], t[1][1], t[2][2],
2726 (t[0][1] + t[1][0])/2,
2727 (t[0][2] + t[2][0])/2,
2728 (t[1][2] + t[2][1])/2
2741 template <
int rank,
int dim,
typename Number>
2745 const Number factor)
2760 template <
int rank,
int dim,
typename Number>
2778 template <
int rank,
int dim,
typename Number>
2782 const Number factor)
2797 template <
int rank,
int dim>
2801 const double factor)
2816 template <
int rank,
int dim>
2834 template <
int rank,
int dim>
2838 const double factor)
2854 template <
int dim,
typename Number>
2874 template <
int dim,
typename Number>
2881 for (
unsigned int i=0; i<dim; ++i)
2882 for (
unsigned int j=0; j<dim; ++j)
2883 s += t1[i][j] * t2[i][j];
2898 template <
int dim,
typename Number>
2923 template <
typename Number>
2930 tmp[0][0] = t[0][0][0][0] * s[0][0];
2950 template <
typename Number>
2957 tmp[0][0] = t[0][0][0][0] * s[0][0];
2976 template <
typename Number>
2983 const unsigned int dim = 2;
2985 for (
unsigned int i=0; i<dim; ++i)
2986 for (
unsigned int j=i; j<dim; ++j)
2987 tmp[i][j] = t[i][j][0][0] * s[0][0] +
2988 t[i][j][1][1] * s[1][1] +
2989 2 * t[i][j][0][1] * s[0][1];
3009 template <
typename Number>
3016 const unsigned int dim = 2;
3018 for (
unsigned int i=0; i<dim; ++i)
3019 for (
unsigned int j=i; j<dim; ++j)
3020 tmp[i][j] = s[0][0] * t[0][0][i][j] * +
3021 s[1][1] * t[1][1][i][j] +
3022 2 * s[0][1] * t[0][1][i][j];
3042 template <
typename Number>
3049 const unsigned int dim = 3;
3051 for (
unsigned int i=0; i<dim; ++i)
3052 for (
unsigned int j=i; j<dim; ++j)
3053 tmp[i][j] = t[i][j][0][0] * s[0][0] +
3054 t[i][j][1][1] * s[1][1] +
3055 t[i][j][2][2] * s[2][2] +
3056 2 * t[i][j][0][1] * s[0][1] +
3057 2 * t[i][j][0][2] * s[0][2] +
3058 2 * t[i][j][1][2] * s[1][2];
3078 template <
typename Number>
3085 const unsigned int dim = 3;
3087 for (
unsigned int i=0; i<dim; ++i)
3088 for (
unsigned int j=i; j<dim; ++j)
3089 tmp[i][j] = s[0][0] * t[0][0][i][j] +
3090 s[1][1] * t[1][1][i][j] +
3091 s[2][2] * t[2][2][i][j] +
3092 2 * s[0][1] * t[0][1][i][j] +
3093 2 * s[0][2] * t[0][2][i][j] +
3094 2 * s[1][2] * t[1][2][i][j];
3115 template <
int dim,
typename Number>
3121 for (
unsigned int i=0; i<dim; ++i)
3122 for (
unsigned int j=0; j<dim; ++j)
3123 dest[i] += src1[i][j] * src2[j];
3137 template <
int dim,
typename Number>
3147 for (
unsigned int i=0; i<dim; ++i)
3148 for (
unsigned int j=0; j<dim; ++j)
3165 template <
int dim,
typename Number>
3175 for (
unsigned int i=0; i<dim; ++i)
3176 for (
unsigned int j=0; j<dim; ++j)
3177 for (
unsigned int k=0; k<dim; ++k)
3178 for (
unsigned int l=0; l<dim; ++l)
3179 tt[i][j][k][l] = t[i][j][k][l];
3185 DEAL_II_NAMESPACE_CLOSE
VectorizedArray< Number > operator/(const VectorizedArray< Number > &u, const VectorizedArray< Number > &v)
Tensor< 2, n_rank2_components, Number > base_tensor_type
Number scalar_product(const Tensor< 2, dim, Number > &t1, const Tensor< 2, dim, Number > &t2)
Number second_invariant(const SymmetricTensor< 2, 1, Number > &)
Number trace(const SymmetricTensor< 2, dim, Number > &d)
VectorizedArray< Number > operator*(const VectorizedArray< Number > &u, const VectorizedArray< Number > &v)
SymmetricTensor< rank, dim, Number > transpose(const SymmetricTensor< rank, dim, Number > &t)
Number second_invariant(const SymmetricTensor< 2, 3, Number > &t)
SymmetricTensor operator+(const SymmetricTensor &s) const
void serialize(Archive &ar, const unsigned int version)
AccessorTypes< rank, dim, constness, Number >::reference reference
Number second_invariant(const SymmetricTensor< 2, 2, Number > &t)
::ExceptionBase & ExcMessage(std::string arg1)
#define AssertIndexRange(index, range)
internal::SymmetricTensorAccessors::StorageType< rank, dim, Number > base_tensor_descriptor
friend SymmetricTensor< 4, dim2, Number2 > deviator_tensor()
friend SymmetricTensor< 2, dim2, Number2 > unit_symmetric_tensor()
SymmetricTensor & operator*=(const Number factor)
SymmetricTensor & operator/=(const Number factor)
Number trace(const Tensor< 2, dim, Number > &d)
TableIndices< 2 > merge(const TableIndices< 2 > &previous_indices, const unsigned int new_index, const unsigned int position)
Number scalar_product(const SymmetricTensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)
SymmetricTensor< 2, dim, Number > deviator(const SymmetricTensor< 2, dim, Number > &t)
static std::size_t memory_consumption()
Number determinant(const Tensor< rank, 1, Number > &t)
SymmetricTensor< 4, dim, Number > outer_product(const SymmetricTensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)
Number scalar_product(const SymmetricTensor< 2, dim, Number > &t1, const Tensor< 2, dim, Number > &t2)
void double_contract(SymmetricTensor< 2, 3, Number > &tmp, const SymmetricTensor< 2, 3, Number > &s, const SymmetricTensor< 4, 3, Number > &t)
static const unsigned int n_independent_components
SymmetricTensor< 2, 3, Number > symmetrize(const Tensor< 2, 3, Number > &t)
SymmetricTensor & operator+=(const SymmetricTensor &)
void double_contract(SymmetricTensor< 2, 2, Number > &tmp, const SymmetricTensor< 4, 2, Number > &t, const SymmetricTensor< 2, 2, Number > &s)
Tensor< 2, dim, Number > invert(const Tensor< 2, dim, Number > &t)
void double_contract(SymmetricTensor< 2, 1, Number > &tmp, const SymmetricTensor< 4, 1, Number > &t, const SymmetricTensor< 2, 1, Number > &s)
SymmetricTensor< 2, 1, Number > symmetrize(const Tensor< 2, 1, Number > &t)
T sum(const T &t, const MPI_Comm &mpi_communicator)
static TableIndices< rank > unrolled_to_component_indices(const unsigned int i)
#define Assert(cond, exc)
void double_contract(SymmetricTensor< 2, 2, Number > &tmp, const SymmetricTensor< 2, 2, Number > &s, const SymmetricTensor< 4, 2, Number > &t)
static unsigned int component_to_unrolled_index(const TableIndices< rank > &indices)
bool operator==(const SymmetricTensor &) const
friend SymmetricTensor< 4, dim2, Number2 > identity_tensor()
::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
Number determinant(const SymmetricTensor< 2, dim, Number > &t)
Accessor< rank, dim, constness, P-1, Number > operator[](const unsigned int i)
internal::SymmetricTensorAccessors::double_contraction_result< rank, 2, dim, Number >::type operator*(const SymmetricTensor< 2, dim, Number > &s) const
void double_contract(SymmetricTensor< 2, 3, Number > &tmp, const SymmetricTensor< 4, 3, Number > &t, const SymmetricTensor< 2, 3, Number > &s)
OS & operator<<(OS &o, const Event &e)
static const unsigned int n_independent_components
Number first_invariant(const SymmetricTensor< 2, dim, Number > &t)
SymmetricTensor< 4, dim, Number > invert(const SymmetricTensor< 4, dim, Number > &t)
SymmetricTensor & operator-=(const SymmetricTensor &)
internal::SymmetricTensorAccessors::Accessor< rank, dim, true, rank-1, Number > operator[](const unsigned int row) const
Number scalar_product(const Tensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)
SymmetricTensor< 2, 2, Number > symmetrize(const Tensor< 2, 2, Number > &t)
bool operator!=(const SymmetricTensor &) const
Tensor< 1, n_independent_components, Number > base_tensor_type
::ExceptionBase & ExcNotImplemented()
void double_contract(SymmetricTensor< 2, 1, Number > &tmp, const SymmetricTensor< 2, 1, Number > &s, const SymmetricTensor< 4, 1, Number > &t)
AccessorTypes< rank, dim, constness, Number >::reference reference
SymmetricTensor operator-() const
double third_invariant(const SymmetricTensor< 2, dim, Number > &t)
SymmetricTensor & operator=(const SymmetricTensor &)
::ExceptionBase & ExcInternalError()
base_tensor_descriptor::base_tensor_type base_tensor_type
Number access_raw_entry(const unsigned int unrolled_index) const
friend Number2 trace(const SymmetricTensor< 2, dim2, Number2 > &d)
Number & operator()(const TableIndices< rank > &indices)
static const unsigned int dimension