Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
CohesiveZoneModelTools.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "RankFourTensor.h"
13 #include "RankTwoTensor.h"
14 #include "libmesh/vector_value.h"
15 #include "MooseTypes.h"
16 #include "RotationMatrix.h"
17 
19 {
20 template <bool is_ad = false>
23 {
24  return V / V.norm();
25 }
26 
28 template <bool is_ad = false>
31 {
32  const auto Uhat = U.trace() * RankTwoTensor::Identity() - U;
33  unsigned int k, l, m, n, p, q;
34  const auto Uhat_det = Uhat.det();
35 
37  for (k = 0; k < 3; k++)
38  for (l = 0; l < 3; l++)
39  for (m = 0; m < 3; m++)
40  for (n = 0; n < 3; n++)
41  {
42  dR_dF(k, l, m, n) = 0.;
43  for (p = 0; p < 3; p++)
44  for (q = 0; q < 3; q++)
45  dR_dF(k, l, m, n) +=
46  R(k, p) * (Uhat(p, q) * R(m, q) * Uhat(n, l) - Uhat(p, n) * R(m, q) * Uhat(q, l));
47 
48  dR_dF(k, l, m, n) /= Uhat_det;
49  }
50 
51  return dR_dF;
52 }
53 
56 
59 template <bool is_ad = false>
61 computeAreaRatio(const RankTwoTensor & FinvT, const Real & J, const RealVectorValue & N)
62 {
63  return J * (FinvT * N).norm();
64 }
65 
66 template <bool is_ad = false>
70  const GenericReal<is_ad> & J,
71  const GenericRankFourTensor<is_ad> & DFinv_DF)
72 {
73  const auto Fitr_N = FinvT * N;
74  const auto Fitr_N_norm = Fitr_N.norm();
76  for (unsigned int l = 0; l < 3; l++)
77  for (unsigned int m = 0; m < 3; m++)
78  {
79  R2temp(l, m) = 0;
80  for (unsigned int i = 0; i < 3; i++)
81  for (unsigned int j = 0; j < 3; j++)
82  R2temp(l, m) += Fitr_N(i) * DFinv_DF(j, i, l, m) * N(j);
83 
84  R2temp(l, m) *= J / Fitr_N_norm;
85  }
86 
87  return J * FinvT * Fitr_N_norm + R2temp;
88 }
90 
92 template <bool is_ad = false>
95  const GenericRealVectorValue<is_ad> & vector)
96 {
97  return (normal * vector) * normal;
98 }
99 
101 template <bool is_ad = false>
104  const GenericRealVectorValue<is_ad> & vector)
105 {
106  return vector - computeNormalComponents<is_ad>(normal, vector);
107 }
108 
110 template <bool is_ad = false>
113  const unsigned int mesh_dimension)
114 {
116  switch (mesh_dimension)
117  {
118  case 3:
119  rot = RotationMatrix::rotVec1ToVec2<is_ad>(GenericRealVectorValue<false>(1, 0, 0), normal);
120  break;
121  case 2:
122  rot = RotationMatrix::rotVec2DToX<is_ad>(normal).transpose();
123  break;
124  case 1:
125  rot = RankTwoTensor::Identity();
126  break;
127  default:
128  mooseError("computeReferenceRotation: mesh_dimension value should be 1, 2 or, 3. You "
129  "provided " +
130  std::to_string(mesh_dimension));
131  }
132  return rot;
133 }
134 } // namespace CohesiveZoneModelTools
GenericRealVectorValue< is_ad > computedVnormdV(const GenericRealVectorValue< is_ad > &V)
GenericRankFourTensor< is_ad > computedRdF(const GenericRankTwoTensor< is_ad > &R, const GenericRankTwoTensor< is_ad > &U)
compute the derivative of the rotation matrix, R=FU^-1, using Chen and Wheeler 1993 ...
Moose::GenericType< Real, is_ad > GenericReal
void mooseError(Args &&... args)
GenericRealVectorValue< is_ad > computeTangentComponents(const GenericRealVectorValue< is_ad > &normal, const GenericRealVectorValue< is_ad > &vector)
compute the tangent componets of a vector
GenericReal< is_ad > computeAreaRatio(const RankTwoTensor &FinvT, const Real &J, const RealVectorValue &N)
compute the area ratio betweeen the deformed and undeformed configuration, and its derivatives w...
GenericRankTwoTensor< is_ad > computeDAreaRatioDF(const GenericRankTwoTensor< is_ad > &FinvT, const GenericRealVectorValue< is_ad > &N, const GenericReal< is_ad > &J, const GenericRankFourTensor< is_ad > &DFinv_DF)
Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
static RankTwoTensorTempl Identity()
GenericRankTwoTensor< is_ad > computeReferenceRotation(const GenericRealVectorValue< is_ad > &normal, const unsigned int mesh_dimension)
compute the czm reference rotation based on the normal in the undeformed configuration and the mesh d...
GenericRealVectorValue< is_ad > computeNormalComponents(const GenericRealVectorValue< is_ad > &normal, const GenericRealVectorValue< is_ad > &vector)
compute the normal componets of a vector
Moose::GenericType< RealVectorValue, is_ad > GenericRealVectorValue
auto norm(const T &a) -> decltype(std::abs(a))
RankFourTensor computedFinversedF(const RankTwoTensor &F_inv)
compute the derivative of F^-1 w.r.t. to F
static const std::string R
Definition: NS.h:162
int N
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string k
Definition: NS.h:130
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor