| 1 |
// ------------------------------------------------------------------------ |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
// Copyright (C) 2016 - 2025 by the deal.II authors |
| 5 |
// |
| 6 |
// This file is part of the deal.II library. |
| 7 |
// |
| 8 |
// Part of the source code is dual licensed under Apache-2.0 WITH |
| 9 |
// LLVM-exception OR LGPL-2.1-or-later. Detailed license information |
| 10 |
// governing the source code and code contributions can be found in |
| 11 |
// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. |
| 12 |
// |
| 13 |
// ------------------------------------------------------------------------ |
| 14 |
|
| 15 |
#ifndef dealii_elasticity_standard_tensors_h |
| 16 |
#define dealii_elasticity_standard_tensors_h |
| 17 |
|
| 18 |
|
| 19 |
#include <deal.II/base/config.h> |
| 20 |
|
| 21 |
#include <deal.II/base/numbers.h> |
| 22 |
#include <deal.II/base/symmetric_tensor.h> |
| 23 |
#include <deal.II/base/tensor.h> |
| 24 |
|
| 25 |
DEAL_II_NAMESPACE_OPEN |
| 26 |
|
| 27 |
namespace Physics |
| 28 |
{ |
| 29 |
namespace Elasticity |
| 30 |
{ |
| 31 |
/** |
| 32 |
* A collection of tensor definitions that mostly conform to notation used |
| 33 |
* in standard scientific literature, in particular the book of |
| 34 |
* Wriggers (2008). The citation for this reference, as well as other |
| 35 |
* notation used here, can be found in the description for the |
| 36 |
* Physics::Elasticity namespace. |
| 37 |
* |
| 38 |
* @note These hold specifically for the codimension 0 case with a |
| 39 |
* Cartesian basis, where the metric tensor is the identity tensor. |
| 40 |
* |
| 41 |
* @relatesalso Tensor |
| 42 |
*/ |
| 43 |
template <int dim> |
| 44 |
class StandardTensors |
| 45 |
{ |
| 46 |
public: |
| 47 |
/** |
| 48 |
* @name Metric tensors |
| 49 |
*/ |
| 50 |
/** @{ */ |
| 51 |
|
| 52 |
/** |
| 53 |
* The second-order referential/spatial symmetric identity (metric) tensor |
| 54 |
* $\mathbf{I}$. |
| 55 |
* |
| 56 |
* This is defined such that, for any rank-2 tensor or symmetric tensor, |
| 57 |
* the following holds: |
| 58 |
* @f[ |
| 59 |
* \mathbf{I} \cdot \{ \bullet \} = \{ \bullet \} \cdot \mathbf{I} = |
| 60 |
* \{ \bullet \} |
| 61 |
* \qquad \text{and} \qquad |
| 62 |
* \mathbf{I} : \{ \bullet \} = \textrm{trace} \{ \bullet \} \, . |
| 63 |
* @f] |
| 64 |
* |
| 65 |
* This definition aligns with the rank-2 symmetric tensor returned by |
| 66 |
* unit_symmetric_tensor(). If one is to interpret the tensor as a |
| 67 |
* matrix, then this simply corresponds to the identity matrix. |
| 68 |
*/ |
| 69 |
static DEAL_II_CONSTEXPR const SymmetricTensor<2, dim> I |
| 70 |
#ifndef DEAL_II_CXX14_CONSTEXPR_BUG |
| 71 |
= unit_symmetric_tensor<dim>() |
| 72 |
#endif |
| 73 |
; |
| 74 |
|
| 75 |
/** |
| 76 |
* The fourth-order referential/spatial unit symmetric tensor |
| 77 |
* $\mathcal{S}$. |
| 78 |
* |
| 79 |
* This is defined such that for a general rank-2 tensor $\{ \hat{\bullet} |
| 80 |
* \}$ the following holds: |
| 81 |
* @f[ |
| 82 |
* \mathcal{S} : \{ \hat{\bullet} \} |
| 83 |
* \dealcoloneq \dfrac{1}{2} |
| 84 |
* \left[ \{ \hat{\bullet} \} + \{ \hat{\bullet} \}^T \right] \, . |
| 85 |
* @f] |
| 86 |
* |
| 87 |
* As a corollary to this, for any second-order symmetric tensor $\{ |
| 88 |
* \bullet \}$ |
| 89 |
* @f[ |
| 90 |
* \mathcal{S} : \{ \bullet \} |
| 91 |
* = \{ \bullet \} : \mathcal{S} = \{ \bullet \} \, . |
| 92 |
* @f] |
| 93 |
* |
| 94 |
* This definition aligns with the fourth-order symmetric tensor |
| 95 |
* $\mathcal{S}$ introduced in the Physics::Elasticity namespace |
| 96 |
* description and that which is returned by identity_tensor(). |
| 97 |
* |
| 98 |
* @note If you apply this to a standard tensor then it doesn't behave like |
| 99 |
* the fourth-order identity tensor, but rather as a symmetrization |
| 100 |
* operator. |
| 101 |
*/ |
| 102 |
static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> S |
| 103 |
#ifndef DEAL_II_CXX14_CONSTEXPR_BUG |
| 104 |
= identity_tensor<dim>() |
| 105 |
#endif |
| 106 |
; |
| 107 |
|
| 108 |
/** |
| 109 |
* The fourth-order referential/spatial tensor $\mathbf{I} \otimes |
| 110 |
* \mathbf{I}$. |
| 111 |
* |
| 112 |
* This is defined such that, for any rank-2 tensor, the following holds: |
| 113 |
* @f[ |
| 114 |
* [\mathbf{I} \otimes \mathbf{I}] : \{ \bullet \} = |
| 115 |
* \textrm{trace}\{ \bullet \} \mathbf{I} \, . |
| 116 |
* @f] |
| 117 |
*/ |
| 118 |
static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> IxI |
| 119 |
#ifndef DEAL_II_CXX14_CONSTEXPR_BUG |
| 120 |
= outer_product(unit_symmetric_tensor<dim>(), |
| 121 |
unit_symmetric_tensor<dim>()) |
| 122 |
#endif |
| 123 |
; |
| 124 |
|
| 125 |
/** @} */ |
| 126 |
|
| 127 |
/** |
| 128 |
* @name Projection operators |
| 129 |
*/ |
| 130 |
/** @{ */ |
| 131 |
|
| 132 |
/** |
| 133 |
* The fourth-order spatial deviatoric tensor. Also known as the |
| 134 |
* deviatoric operator, this tensor projects a second-order symmetric |
| 135 |
* tensor onto a deviatoric space (for which the hydrostatic component is |
| 136 |
* removed). |
| 137 |
* |
| 138 |
* This is defined as |
| 139 |
* @f[ |
| 140 |
* \mathcal{P} |
| 141 |
* \dealcoloneq \mathcal{S} - \frac{1}{\textrm{dim}} \mathbf{I} |
| 142 |
* \otimes \mathbf{I} |
| 143 |
* @f] |
| 144 |
* where $\mathcal{S}$ is the fourth-order unit symmetric tensor and |
| 145 |
* $\mathbf{I}$ is the second-order identity tensor. |
| 146 |
* |
| 147 |
* For any second-order (spatial) symmetric tensor the following holds: |
| 148 |
* @f[ |
| 149 |
* \mathcal{P} : \{ \bullet \} |
| 150 |
* \dealcoloneq \{ \bullet \} - \frac{1}{\textrm{dim}} |
| 151 |
* \left[ \{ \bullet \} : \mathbf{I} \right]\mathbf{I} |
| 152 |
* = \mathcal{P}^{T} : \{ \bullet \} |
| 153 |
* = \mathtt{dev\_P} \left( \{ \bullet \} \right) |
| 154 |
* @f] |
| 155 |
* and, therefore, |
| 156 |
* @f[ |
| 157 |
* \mathtt{dev\_P} \left( \{ \bullet \} \right) : \mathbf{I} |
| 158 |
* = \mathrm{trace}(\mathtt{dev\_P} \left( \{ \bullet \} \right)) = 0 \, |
| 159 |
* . |
| 160 |
* @f] |
| 161 |
* |
| 162 |
* This definition aligns with the fourth-order symmetric tensor that |
| 163 |
* is returned by deviator_tensor(). |
| 164 |
* |
| 165 |
* @note This function uses $\frac{1}{\text{dim}}$ as the factor in the |
| 166 |
* definition of the deviator, and that is unquestionably correct for |
| 167 |
* three-dimensional models. However, whether this is the correct choice |
| 168 |
* for two-dimensional models is something that depends on how one |
| 169 |
* thinks about two-dimensional models. For example, in elasticity, one |
| 170 |
* often does two-dimensional simulations that are thought of as cross |
| 171 |
* sections of three-dimensional objects that are infinite in |
| 172 |
* $z$-direction, with the assumption that the $z$-displacements are |
| 173 |
* zero and that the $x$- and $y$-displacements do not vary in |
| 174 |
* $z$-direction. Such models are often described as |
| 175 |
* "<a |
| 176 |
* href="https://en.wikipedia.org/wiki/Infinitesimal_strain_theory#Plane_strain">plane |
| 177 |
* strain</a>", indicating that nonzero strain components are all in the |
| 178 |
* $x$-$y$ plane. The important point here is that while we only |
| 179 |
* model two spatial variables, in the background *the model |
| 180 |
* really is three-dimensional*. In these cases, the deviator |
| 181 |
* should really contain $\frac{1}{3}$ as the factor in front of |
| 182 |
* the divergence, and in those cases you will not want to use |
| 183 |
* the current function. On the other hand, there are of course |
| 184 |
* also models that truly are two-dimensional -- say the |
| 185 |
* simulation of transport on the earth surface, or of the |
| 186 |
* deformation of monolayers of |
| 187 |
* [graphene](https://en.wikipedia.org/wiki/Graphene) (an |
| 188 |
* inherently two-dimensional material). In those cases, the |
| 189 |
* factor $\frac{1}{2}$ chosen in the definition of this |
| 190 |
* function when using `dim==2` is correct. Whether or not the |
| 191 |
* current function is right for you in two dimensions is |
| 192 |
* therefore a question of what your model represents. |
| 193 |
* |
| 194 |
* @dealiiWriggersA{47,3.129} |
| 195 |
* @dealiiHolzapfelA{232,6.105} |
| 196 |
*/ |
| 197 |
static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> dev_P |
| 198 |
#ifndef DEAL_II_CXX14_CONSTEXPR_BUG |
| 199 |
= deviator_tensor<dim>() |
| 200 |
#endif |
| 201 |
; |
| 202 |
|
| 203 |
/** |
| 204 |
* Return the fourth-order referential deviatoric tensor, as constructed |
| 205 |
* from |
| 206 |
* the deformation gradient tensor @p F. |
| 207 |
* Also known as the deviatoric operator, this tensor projects a |
| 208 |
* second-order symmetric tensor onto a deviatoric space (for which the |
| 209 |
* hydrostatic component is removed). |
| 210 |
* |
| 211 |
* This referential isochoric projection tensor is defined as |
| 212 |
* @f[ |
| 213 |
* \hat{\mathcal{P}} |
| 214 |
* \dealcoloneq \frac{\partial \bar{\mathbf{C}}}{\partial \mathbf{C}} |
| 215 |
* @f] |
| 216 |
* with |
| 217 |
* @f[ |
| 218 |
* \bar{\mathbf{C}} \dealcoloneq J^{-2/\textrm{dim}} \mathbf{C} |
| 219 |
* \qquad \text{,} \qquad |
| 220 |
* \mathbf{C} = \mathbf{F}^{T}\cdot\mathbf{F} |
| 221 |
* \qquad \text{and} \qquad |
| 222 |
* J = \textrm{det}\mathbf{F} |
| 223 |
* @f] |
| 224 |
* such that, for any second-order (referential) symmetric tensor, |
| 225 |
* the following holds: |
| 226 |
* @f[ |
| 227 |
* \{ \bullet \} : \hat{\mathcal{P}} |
| 228 |
* \dealcoloneq J^{-2/\textrm{dim}} \left[ \{ \bullet \} - |
| 229 |
* \frac{1}{\textrm{dim}}\left[\mathbf{C} : \{ \bullet \}\right] |
| 230 |
* \mathbf{C}^{-1} \right] = \mathtt{Dev\_P} \left( \{ \bullet \} \right) |
| 231 |
* \, . |
| 232 |
* @f] |
| 233 |
* It can therefore be readily shown that |
| 234 |
* @f[ |
| 235 |
* \mathtt{Dev\_P} \left( \{ \bullet \} \right) : \mathbf{C} = 0 \, . |
| 236 |
* @f] |
| 237 |
* |
| 238 |
* @note It may be observed that we have defined the tensor as the |
| 239 |
* transpose of that adopted by Wriggers (2008). We have done this so that |
| 240 |
* it may be strictly applied through the chain rule to achieve the |
| 241 |
* definition of the second Piola-Kirchhoff stress, i.e. |
| 242 |
* @f[ |
| 243 |
* \mathbf{S} |
| 244 |
* = 2\frac{\partial \psi \left( \bar{\mathbf{C}} \right)}{\partial |
| 245 |
* \mathbf{C}} = 2\frac{\partial \psi \left( \bar{\mathbf{C}} |
| 246 |
* \right)}{\partial \bar{\mathbf{C}}} : \frac{\partial |
| 247 |
* \bar{\mathbf{C}}}{\partial \mathbf{C}} = \bar{\mathbf{S}} : |
| 248 |
* \hat{\mathcal{P}} \equiv \hat{\mathcal{P}}^{T} : \bar{\mathbf{S}} \, . |
| 249 |
* @f] |
| 250 |
* |
| 251 |
* @note Comparing the definition of this tensor in Holzapfel (2001) to that |
| 252 |
* adopted here, the inclusion of the extra factor $J^{-2/\textrm{dim}}$ |
| 253 |
* does not, at the outset, seem to be a reasonable choice. However, in |
| 254 |
* the author's view it makes direct implementation of the expressions for |
| 255 |
* isochoric (referential) stress contributions and their linearization |
| 256 |
* simpler in practise. |
| 257 |
* |
| 258 |
* @dealiiWriggersA{46,3.125} |
| 259 |
* @dealiiHolzapfelA{229,6.83} |
| 260 |
*/ |
| 261 |
template <typename Number> |
| 262 |
static DEAL_II_HOST DEAL_II_CONSTEXPR SymmetricTensor<4, dim, Number> |
| 263 |
Dev_P(const Tensor<2, dim, Number> &F); |
| 264 |
|
| 265 |
/** |
| 266 |
* Return the transpose of the fourth-order referential deviatoric tensor, |
| 267 |
* as constructed from the deformation gradient tensor @p F. |
| 268 |
* The result performs the following operation: |
| 269 |
* @f[ |
| 270 |
* \hat{\mathcal{P}}^{T} : \{ \bullet \} |
| 271 |
* = J^{-2/\textrm{dim}} \left[ \{ \bullet \} - \frac{1}{\textrm{dim}} |
| 272 |
* \left[\mathbf{C}^{-1} : \{ \bullet \}\right] \mathbf{C} \right] = |
| 273 |
* \mathtt{Dev\_P\_T} \{ \bullet \} |
| 274 |
* @f] |
| 275 |
*/ |
| 276 |
template <typename Number> |
| 277 |
static DEAL_II_HOST DEAL_II_CONSTEXPR SymmetricTensor<4, dim, Number> |
| 278 |
Dev_P_T(const Tensor<2, dim, Number> &F); |
| 279 |
|
| 280 |
/** @} */ |
| 281 |
|
| 282 |
/** |
| 283 |
* @name Scalar derivatives |
| 284 |
*/ |
| 285 |
/** @{ */ |
| 286 |
/** |
| 287 |
* Return the derivative of the volumetric Jacobian |
| 288 |
* $J = \text{det} \mathbf{F}$ with respect to the right Cauchy-Green |
| 289 |
* tensor, as constructed from the deformation gradient tensor @p F. |
| 290 |
* The computed result is |
| 291 |
* @f[ |
| 292 |
* \frac{\partial J}{\partial \mathbf{C}} |
| 293 |
* = \frac{1}{2} J \mathbf{C}^{-1} |
| 294 |
* @f] |
| 295 |
* with |
| 296 |
* @f[ |
| 297 |
* \mathbf{C} = \mathbf{F}^{T}\cdot\mathbf{F} \, . |
| 298 |
* @f] |
| 299 |
* |
| 300 |
* @dealiiWriggersA{46,3.124} |
| 301 |
* @dealiiHolzapfelA{228,6.82} |
| 302 |
*/ |
| 303 |
template <typename Number> |
| 304 |
static DEAL_II_HOST DEAL_II_CONSTEXPR SymmetricTensor<2, dim, Number> |
| 305 |
ddet_F_dC(const Tensor<2, dim, Number> &F); |
| 306 |
|
| 307 |
/** @} */ |
| 308 |
|
| 309 |
/** |
| 310 |
* @name Tensor derivatives |
| 311 |
*/ |
| 312 |
/** @{ */ |
| 313 |
|
| 314 |
/** |
| 315 |
* Return the derivative of the inverse of the right Cauchy-Green |
| 316 |
* tensor with respect to the right Cauchy-Green tensor itself, |
| 317 |
* as constructed from the deformation gradient tensor @p F. |
| 318 |
* The result, accounting for symmetry, is defined in index notation as |
| 319 |
* @f[ |
| 320 |
* \left[ \frac{\partial \mathbf{C}^{-1}}{\partial \mathbf{C}} |
| 321 |
* \right]_{IJKL} |
| 322 |
* \dealcoloneq -\frac{1}{2}[ C^{-1}_{IK}C^{-1}_{JL} |
| 323 |
* + C^{-1}_{IL}C^{-1}_{JK} ] |
| 324 |
* @f] |
| 325 |
* |
| 326 |
* @dealiiWriggersA{76,3.255} |
| 327 |
*/ |
| 328 |
template <typename Number> |
| 329 |
static DEAL_II_HOST DEAL_II_CONSTEXPR SymmetricTensor<4, dim, Number> |
| 330 |
dC_inv_dC(const Tensor<2, dim, Number> &F); |
| 331 |
|
| 332 |
/** @} */ |
| 333 |
}; |
| 334 |
|
| 335 |
} // namespace Elasticity |
| 336 |
} // namespace Physics |
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
#ifndef DOXYGEN |
| 341 |
|
| 342 |
// --------------------- inline functions and constants ------------------- |
| 343 |
|
| 344 |
|
| 345 |
template <int dim> |
| 346 |
template <typename Number> |
| 347 |
DEAL_II_HOST DEAL_II_CONSTEXPR inline SymmetricTensor<4, dim, Number> |
| 348 |
Physics::Elasticity::StandardTensors<dim>::Dev_P( |
| 349 |
const Tensor<2, dim, Number> &F) |
| 350 |
{ |
| 351 |
// Make things work with AD types |
| 352 |
using std::pow; |
| 353 |
const Number det_F = determinant(F); |
| 354 |
Assert(numbers::value_is_greater_than(det_F, 0.0), |
| 355 |
ExcMessage("Deformation gradient has a negative determinant.")); |
| 356 |
const Tensor<2, dim, Number> C_ns = transpose(F) * F; |
| 357 |
const SymmetricTensor<2, dim, Number> C = symmetrize(C_ns); |
| 358 |
const SymmetricTensor<2, dim, Number> C_inv = symmetrize(invert(C_ns)); |
| 359 |
|
| 360 |
// See Wriggers p46 equ 3.125 (but transpose indices) |
| 361 |
SymmetricTensor<4, dim, Number> Dev_P = |
| 362 |
outer_product(C, C_inv); // Dev_P = C_x_C_inv |
| 363 |
Dev_P /= -dim; // Dev_P = -[1/dim]C_x_C_inv |
| 364 |
Dev_P += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_x_C_inv |
| 365 |
Dev_P *= pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_x_C_inv] |
| 366 |
|
| 367 |
return Dev_P; |
| 368 |
} |
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
template <int dim> |
| 373 |
template <typename Number> |
| 374 |
DEAL_II_HOST DEAL_II_CONSTEXPR inline SymmetricTensor<4, dim, Number> |
| 375 |
Physics::Elasticity::StandardTensors<dim>::Dev_P_T( |
| 376 |
const Tensor<2, dim, Number> &F) |
| 377 |
{ |
| 378 |
// Make things work with AD types |
| 379 |
using std::pow; |
| 380 |
const Number det_F = determinant(F); |
| 381 |
Assert(numbers::value_is_greater_than(det_F, 0.0), |
| 382 |
ExcMessage("Deformation gradient has a negative determinant.")); |
| 383 |
const Tensor<2, dim, Number> C_ns = transpose(F) * F; |
| 384 |
const SymmetricTensor<2, dim, Number> C = symmetrize(C_ns); |
| 385 |
const SymmetricTensor<2, dim, Number> C_inv = symmetrize(invert(C_ns)); |
| 386 |
|
| 387 |
// See Wriggers p46 equ 3.125 (not transposed) |
| 388 |
SymmetricTensor<4, dim, Number> Dev_P_T = |
| 389 |
outer_product(C_inv, C); // Dev_P = C_inv_x_C |
| 390 |
Dev_P_T /= -dim; // Dev_P = -[1/dim]C_inv_x_C |
| 391 |
Dev_P_T += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_inv_x_C |
| 392 |
Dev_P_T *= |
| 393 |
pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_inv_x_C] |
| 394 |
|
| 395 |
return Dev_P_T; |
| 396 |
} |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
template <int dim> |
| 401 |
template <typename Number> |
| 402 |
DEAL_II_HOST DEAL_II_CONSTEXPR SymmetricTensor<2, dim, Number> |
| 403 |
Physics::Elasticity::StandardTensors<dim>::ddet_F_dC( |
| 404 |
const Tensor<2, dim, Number> &F) |
| 405 |
{ |
| 406 |
return internal::NumberType<Number>::value(0.5 * determinant(F)) * |
| 407 |
symmetrize(invert(transpose(F) * F)); |
| 408 |
} |
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
template <int dim> |
| 413 |
template <typename Number> |
| 414 |
DEAL_II_HOST DEAL_II_CONSTEXPR inline SymmetricTensor<4, dim, Number> |
| 415 |
Physics::Elasticity::StandardTensors<dim>::dC_inv_dC( |
| 416 |
const Tensor<2, dim, Number> &F) |
| 417 |
{ |
| 418 |
const SymmetricTensor<2, dim, Number> C_inv = |
| 419 |
symmetrize(invert(transpose(F) * F)); |
| 420 |
|
| 421 |
SymmetricTensor<4, dim, Number> dC_inv_dC; |
| 422 |
for (unsigned int A = 0; A < dim; ++A) |
| 423 |
for (unsigned int B = A; B < dim; ++B) |
| 424 |
for (unsigned int C = 0; C < dim; ++C) |
| 425 |
for (unsigned int D = C; D < dim; ++D) |
| 426 |
dC_inv_dC[A][B][C][D] -= |
| 427 |
0.5 * (C_inv[A][C] * C_inv[B][D] + C_inv[A][D] * C_inv[B][C]); |
| 428 |
|
| 429 |
return dC_inv_dC; |
| 430 |
} |
| 431 |
|
| 432 |
#endif // DOXYGEN |
| 433 |
|
| 434 |
DEAL_II_NAMESPACE_CLOSE |
| 435 |
|
| 436 |
#endif |