Reference documentation for deal.II version GIT relicensing-362-gab68047079 2024-04-11 17:50:02+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: LGPL-2.1-or-later
4// Copyright (C) 2016 - 2023 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
23#include <deal.II/base/tensor.h>
24
26
27namespace Physics
28{
29 namespace Elasticity
30 {
43 template <int dim>
45 {
46 public:
70#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
71 = unit_symmetric_tensor<dim>()
72#endif
73 ;
74
103#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
104 = identity_tensor<dim>()
105#endif
106 ;
107
119#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
120 = outer_product(unit_symmetric_tensor<dim>(),
121 unit_symmetric_tensor<dim>())
122#endif
123 ;
124
169#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
170 = deviator_tensor<dim>()
171#endif
172 ;
173
232 template <typename Number>
235
247 template <typename Number>
250
274 template <typename Number>
277
299 template <typename Number>
302
304 };
305
306 } // namespace Elasticity
307} // namespace Physics
308
309
310
311#ifndef DOXYGEN
312
313// --------------------- inline functions and constants -------------------
314
315
316template <int dim>
317template <typename Number>
320 const Tensor<2, dim, Number> &F)
321{
322 // Make things work with AD types
323 using std::pow;
324 const Number det_F = determinant(F);
326 ExcMessage("Deformation gradient has a negative determinant."));
327 const Tensor<2, dim, Number> C_ns = transpose(F) * F;
330
331 // See Wriggers p46 equ 3.125 (but transpose indices)
333 outer_product(C, C_inv); // Dev_P = C_x_C_inv
334 Dev_P /= -dim; // Dev_P = -[1/dim]C_x_C_inv
335 Dev_P += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_x_C_inv
336 Dev_P *= pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_x_C_inv]
337
338 return Dev_P;
339}
340
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 (not transposed)
360 outer_product(C_inv, C); // Dev_P = C_inv_x_C
361 Dev_P_T /= -dim; // Dev_P = -[1/dim]C_inv_x_C
362 Dev_P_T += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_inv_x_C
363 Dev_P_T *=
364 pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_inv_x_C]
365
366 return Dev_P_T;
367}
368
369
370
371template <int dim>
372template <typename Number>
375 const Tensor<2, dim, Number> &F)
376{
378 symmetrize(invert(transpose(F) * F));
379}
380
381
382
383template <int dim>
384template <typename Number>
387 const Tensor<2, dim, Number> &F)
388{
390 symmetrize(invert(transpose(F) * F));
391
393 for (unsigned int A = 0; A < dim; ++A)
394 for (unsigned int B = A; B < dim; ++B)
395 for (unsigned int C = 0; C < dim; ++C)
396 for (unsigned int D = C; D < dim; ++D)
397 dC_inv_dC[A][B][C][D] -=
398 0.5 * (C_inv[A][C] * C_inv[B][D] + C_inv[A][D] * C_inv[B][C]);
399
400 return dC_inv_dC;
401}
402
403#endif // DOXYGEN
404
406
407#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:502
#define DEAL_II_CONSTEXPR
Definition config.h:236
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
DerivativeForm< 1, spacedim, dim, Number > transpose(const DerivativeForm< 1, dim, spacedim, Number > &DF)
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > F(const Tensor< 2, dim, Number > &Grad_u)
bool value_is_greater_than(const Number1 &value_1, const Number2 &value_2)
Definition numbers.h:961
::VectorizedArray< Number, width > pow(const ::VectorizedArray< Number, width > &, const Number p)
#define DEAL_II_HOST
Definition numbers.h:45
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE const T & value(const T &t)
Definition numbers.h:702
DEAL_II_HOST constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
DEAL_II_HOST constexpr SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
DEAL_II_HOST constexpr SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)
DEAL_II_HOST constexpr SymmetricTensor< 4, dim, Number > outer_product(const SymmetricTensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Number > &t2)