https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
20template <bool is_ad = false>
23{
24 return V / V.norm();
25}
26
28template <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
59template <bool is_ad = false>
61computeAreaRatio(const RankTwoTensor & FinvT, const Real & J, const RealVectorValue & N)
62{
63 return J * (FinvT * N).norm();
64}
65
66template <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
92template <bool is_ad = false>
95 const GenericRealVectorValue<is_ad> & vector)
96{
97 return (normal * vector) * normal;
98}
99
101template <bool is_ad = false>
104 const GenericRealVectorValue<is_ad> & vector)
105{
106 return vector - computeNormalComponents<is_ad>(normal, vector);
107}
108
110template <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:
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
const double R
const Real p
void mooseError(Args &&... args)
Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
Moose::GenericType< Real, is_ad > GenericReal
Moose::GenericType< RealVectorValue, is_ad > GenericRealVectorValue
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor
static RankTwoTensorTempl Identity()
GenericRealVectorValue< is_ad > computeTangentComponents(const GenericRealVectorValue< is_ad > &normal, const GenericRealVectorValue< is_ad > &vector)
compute the tangent componets of a vector
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...
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)
GenericRealVectorValue< is_ad > computeNormalComponents(const GenericRealVectorValue< is_ad > &normal, const GenericRealVectorValue< is_ad > &vector)
compute the normal componets of a vector
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
RankFourTensor computedFinversedF(const RankTwoTensor &F_inv)
compute the derivative of F^-1 w.r.t. to F
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....