v0.15.0
Loading...
Searching...
No Matches
HMHHStVenantKirchhoff.cpp
Go to the documentation of this file.
1/**
2 * @file HMHHStVenantKirchhoff.cpp
3 * @brief Implementation StVenantKirchhoff
4 * @version 0.1
5 * @date 2024-08-31
6 *
7 * @copyright Copyright (c) 2024
8 *
9 */
10
11namespace EshelbianPlasticity {
12
14
15 static constexpr int numberOfActiveVariables = 9;
16 static constexpr int numberOfDependentVariables = 9;
17
21
22 MoFEMErrorCode getOptions() {
24
25 double E = 1;
26 double nu = 0;
27
28 PetscOptionsBegin(PETSC_COMM_WORLD, "stvenant_", "", "none");
29
30 CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
31 PETSC_NULLPTR);
32 CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
33 PETSC_NULLPTR);
34
35 PetscOptionsEnd();
36
37 MOFEM_LOG("EP", Sev::inform) << "St Venant Kirchhoff model parameters: "
38 << "E = " << E << ", nu = " << nu;
39
40 lambda = LAMBDA(E, nu);
41 mu = MU(E, nu);
42
44 }
45
46 virtual OpJacobian *
47 returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs,
48 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
49 boost::shared_ptr<PhysicalEquations> physics_ptr) {
50 return (new OpHMHH(tag, eval_rhs, eval_lhs, data_ptr, physics_ptr));
51 }
52
53 double lambda;
54 double mu;
55 double sigmaY;
56
65
75
77
78 MoFEMErrorCode recordTape(const int tape, DTensor2Ptr *t_h_ptr) {
80 FTensor::Index<'i', 3> i;
81 FTensor::Index<'j', 3> j;
82 FTensor::Index<'I', 3> I;
83 FTensor::Index<'J', 3> J;
87
89
91
92 auto ih = get_h();
93 // auto iH = get_H();
94 if (t_h_ptr)
95 ih(i, j) = (*t_h_ptr)(i, j);
96 else {
97 ih(i, j) = t_kd(i, j);
98 }
99
100 auto r_P = get_P();
101
102 enableMinMaxUsingAbs();
103 trace_on(tape);
104
105 // Set active variables to ADOL-C
106 th(i, j) <<= get_h()(i, j);
107
108 tF(i, I) = th(i, I);
109 CHKERR determinantTensor3by3(tF, detF);
110 CHKERR invertTensor3by3(tF, detF, tInvF);
111
112 // Deformation and strain
113 tC(I, J) = tF(i, I) * tF(i, J);
114 tE(I, J) = tC(I, J);
115 tE(N0, N0) -= 1;
116 tE(N1, N1) -= 1;
117 tE(N2, N2) -= 1;
118 tE(I, J) *= 0.5;
119
120 // Energy
121 trE = tE(I, I);
122 energy = 0.5 * lambda * trE * trE + mu * (tE(I, J) * tE(I, J));
123
124 // Stress Piola II
125 tS(I, J) = tE(I, J);
126 tS(I, J) *= 2 * mu;
127 tS(N0, N0) += lambda * trE;
128 tS(N1, N1) += lambda * trE;
129 tS(N2, N2) += lambda * trE;
130 // Stress Piola I
131 tP(i, J) = tF(i, I) * tS(I, J);
132
133 // Set dependent variables to ADOL-C
134 tP(i, j) >>= r_P(i, j);
135
136 trace_off();
137
139 }
140};
141
142
143
144} // namespace EshelbianPlasticity
Kronecker Delta class symmetric.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MU(E, NU)
Definition fem_tools.h:23
#define LAMBDA(E, NU)
Definition fem_tools.h:22
constexpr auto t_kd
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'j', 3 > j
constexpr IntegrationType I
HMHStVenantKirchhoff(const double lambda, const double mu)
virtual OpJacobian * returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
MoFEMErrorCode recordTape(const int tape, DTensor2Ptr *t_h_ptr)