v0.15.0
Loading...
Searching...
No Matches
HMHPMooneyRivlinWriggersEq63.cpp
Go to the documentation of this file.
1/**
2 * @file HMHPMooneyRivlinWriggersEq63.cpp
3 * @brief Implement of MooneyRivlinWriggersEq63
4 *
5 * @copyright Copyright (c) 2024
6 *
7 */
8
9namespace EshelbianPlasticity {
10
12
13 static constexpr int numberOfActiveVariables = 9;
14 static constexpr int numberOfDependentVariables = 9;
15
20
21 virtual OpJacobian *
22 returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs,
23 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
24 boost::shared_ptr<PhysicalEquations> physics_ptr) {
25 return (new OpHMHH(tag, eval_rhs, eval_lhs, data_ptr, physics_ptr));
26 }
27
28 MoFEMErrorCode getOptions() {
30 PetscOptionsBegin(PETSC_COMM_WORLD, "mooneyrivlin_", "", "none");
31 alpha = 1;
32 CHKERR PetscOptionsScalar("-alpha", "Alpha", "", alpha, &alpha, PETSC_NULLPTR);
33 beta = 1;
34 CHKERR PetscOptionsScalar("-beta", "Beta", "", beta, &beta, PETSC_NULLPTR);
35
36 lambda = 1;
37 CHKERR PetscOptionsScalar("-lambda", "Lambda", "", lambda, &lambda,
38 PETSC_NULLPTR);
39
40 epsilon = 0;
41 CHKERR PetscOptionsScalar("-epsilon", "Epsilon", "", epsilon, &epsilon,
42 PETSC_NULLPTR);
43
44 PetscOptionsEnd();
46 }
47
48 double alpha;
49 double beta;
50 double lambda;
51 double epsilon;
52
56
61
64
69
74
76
77 MoFEMErrorCode recordTape(const int tape, DTensor2Ptr *t_h_ptr) {
79
80 FTensor::Index<'i', 3> i;
81 FTensor::Index<'j', 3> j;
82 FTensor::Index<'k', 3> k;
83 FTensor::Index<'I', 3> I;
84 FTensor::Index<'J', 3> J;
85 FTensor::Index<'K', 3> K;
89
91
93
94 auto ih = get_h();
95 if (t_h_ptr)
96 ih(i, j) = (*t_h_ptr)(i, j);
97 else {
98 ih(i, j) = t_kd(i, j);
99 }
100
101 auto r_P = get_P();
102
103 enableMinMaxUsingAbs();
104 trace_on(tape);
105
106 // Set active variables to ADOL-C
107 th(i, j) <<= get_h()(i, j);
108
109 tF(i, I) = th(i, I);
110 CHKERR determinantTensor3by3(tF, detF);
111 CHKERR invertTensor3by3(tF, detF, tInvF);
112
113 tCof(i, I) = detF * tInvF(I, i);
114
115 A = tF(k, K) * tF(k, K);
116 B = tCof(k, K) * tCof(k, K);
117
118 tBF(i, I) = 4 * alpha * (A * tF(i, I));
119 tBCof(i, I) = 4 * beta * (B * tCof(i, I));
120 tBj = (-12 * alpha - 24 * beta) / detF +
121 0.5 * (lambda / epsilon) *
122 (pow(detF, epsilon - 1) - pow(detF, -epsilon - 1));
123
124 tP(i, I) = tBF(i, I);
125 tP(i, I) += (levi_civita(i, j, k) * tBCof(j, J)) *
126 (levi_civita(I, J, K) * tF(k, K));
127 tP(i, I) += tCof(i, I) * tBj;
128
129 // Set dependent variables to ADOL-C
130 tP(i, j) >>= r_P(i, j);
131
132 trace_off();
133
135 }
136};
137
138
139
140} // 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.
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr IntegrationType I
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)
HMHPMooneyRivlinWriggersEq63(const double alpha, const double beta, const double lambda)
MoFEMErrorCode recordTape(const int tape, DTensor2Ptr *t_h_ptr)