deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
standard_tensors.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR 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// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_elasticity_standard_tensors_h
14#define dealii_elasticity_standard_tensors_h
15
16
17#include <deal.II/base/config.h>
18
21#include <deal.II/base/tensor.h>
22
24
25namespace Physics
26{
27 namespace Elasticity
28 {
41 template <int dim>
43 {
44 public:
68#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
69 = unit_symmetric_tensor<dim>()
70#endif
71 ;
72
101#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
102 = identity_tensor<dim>()
103#endif
104 ;
105
117#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
118 = outer_product(unit_symmetric_tensor<dim>(),
119 unit_symmetric_tensor<dim>())
120#endif
121 ;
122
196#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
197 = deviator_tensor<dim>()
198#endif
199 ;
200
259 template <typename Number>
262
274 template <typename Number>
277
301 template <typename Number>
304
326 template <typename Number>
329
331 };
332
333 } // namespace Elasticity
334} // namespace Physics
335
336
337
338#ifndef DOXYGEN
339
340// --------------------- inline functions and constants -------------------
341
342
343template <int dim>
344template <typename Number>
347 const Tensor<2, dim, Number> &F)
348{
349 // Make things work with AD types
350 using std::pow;
351 const Number det_F = determinant(F);
353 ExcMessage("Deformation gradient has a negative determinant."));
354 const Tensor<2, dim, Number> C_ns = transpose(F) * F;
357
358 // See Wriggers p46 equ 3.125 (but transpose indices)
360 outer_product(C, C_inv); // Dev_P = C_x_C_inv
361 Dev_P /= -dim; // Dev_P = -[1/dim]C_x_C_inv
362 Dev_P += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_x_C_inv
363 Dev_P *= pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_x_C_inv]
364
365 return Dev_P;
366}
367
368
369
370template <int dim>
371template <typename Number>
374 const Tensor<2, dim, Number> &F)
375{
376 // Make things work with AD types
377 using std::pow;
378 const Number det_F = determinant(F);
380 ExcMessage("Deformation gradient has a negative determinant."));
381 const Tensor<2, dim, Number> C_ns = transpose(F) * F;
384
385 // See Wriggers p46 equ 3.125 (not transposed)
387 outer_product(C_inv, C); // Dev_P = C_inv_x_C
388 Dev_P_T /= -dim; // Dev_P = -[1/dim]C_inv_x_C
389 Dev_P_T += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_inv_x_C
390 Dev_P_T *=
391 pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_inv_x_C]
392
393 return Dev_P_T;
394}
395
396
397
398template <int dim>
399template <typename Number>
402 const Tensor<2, dim, Number> &F)
403{
405 symmetrize(invert(transpose(F) * F));
406}
407
408
409
410template <int dim>
411template <typename Number>
414 const Tensor<2, dim, Number> &F)
415{
417 symmetrize(invert(transpose(F) * F));
418
420 for (unsigned int A = 0; A < dim; ++A)
421 for (unsigned int B = A; B < dim; ++B)
422 for (unsigned int C = 0; C < dim; ++C)
423 for (unsigned int D = C; D < dim; ++D)
424 dC_inv_dC[A][B][C][D] -=
425 0.5 * (C_inv[A][C] * C_inv[B][D] + C_inv[A][D] * C_inv[B][C]);
426
427 return dC_inv_dC;
428}
429
430#endif // DOXYGEN
431
433
434#endif
static DEAL_II_HOST constexpr SymmetricTensor< 4, dim, Number > Dev_P_T(const Tensor< 2, dim, Number > &F)
static DEAL_II_HOST constexpr SymmetricTensor< 4, dim, Number > Dev_P(const Tensor< 2, dim, Number > &F)
static constexpr const SymmetricTensor< 4, dim > dev_P
static DEAL_II_HOST constexpr SymmetricTensor< 4, dim, Number > dC_inv_dC(const Tensor< 2, dim, Number > &F)
static DEAL_II_HOST constexpr SymmetricTensor< 2, dim, Number > ddet_F_dC(const Tensor< 2, dim, Number > &F)
static constexpr const SymmetricTensor< 2, dim > I
static constexpr const SymmetricTensor< 4, dim > S
static constexpr const SymmetricTensor< 4, dim > IxI
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_CONSTEXPR
Definition config.h:282
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DEAL_II_HOST
Definition config.h:182
DerivativeForm< 1, spacedim, dim, Number > transpose(const DerivativeForm< 1, dim, spacedim, Number > &DF)
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
constexpr char A
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > F(const Tensor< 2, dim, Number > &Grad_u)
*  *  *  RotationFunction< dim, Number >::RotationFunction Number(dim)
bool value_is_greater_than(const Number1 &value_1, const Number2 &value_2)
Definition numbers.h:899
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
static constexpr const T & value(const T &t)
Definition numbers.h:662
constexpr SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
constexpr SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)
constexpr SymmetricTensor< 4, dim, Number > outer_product(const SymmetricTensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)