v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
EshelbianPlasticity::OpHMHH Struct Reference
Inheritance diagram for EshelbianPlasticity::OpHMHH:
[legend]
Collaboration diagram for EshelbianPlasticity::OpHMHH:
[legend]

Public Member Functions

 OpHMHH (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, boost::shared_ptr< PhysicalEquations > &physics_ptr)
 
MoFEMErrorCode evaluateRhs (EntData &data)
 
MoFEMErrorCode evaluateLhs (EntData &data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpJacobian
 OpJacobian (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, boost::shared_ptr< PhysicalEquations > &physics_ptr)
 
virtual MoFEMErrorCode evaluateRhs (EntData &data)=0
 
virtual MoFEMErrorCode evaluateLhs (EntData &data)=0
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Additional Inherited Members

- Protected Member Functions inherited from EshelbianPlasticity::OpJacobian
 OpJacobian ()
 
- Protected Attributes inherited from EshelbianPlasticity::OpJacobian
int tAg = -1
 adol-c tape More...
 
bool evalRhs = false
 
bool evalLhs = false
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 
boost::shared_ptr< PhysicalEquationsphysicsPtr
 material physical equations More...
 

Detailed Description

Definition at line 18 of file EshelbianADOL-C.cpp.

Constructor & Destructor Documentation

◆ OpHMHH()

EshelbianPlasticity::OpHMHH::OpHMHH ( const int  tag,
const bool  eval_rhs,
const bool  eval_lhs,
boost::shared_ptr< DataAtIntegrationPts > &  data_ptr,
boost::shared_ptr< PhysicalEquations > &  physics_ptr 
)
inline

Definition at line 19 of file EshelbianADOL-C.cpp.

22 : OpJacobian(tag, eval_rhs, eval_lhs, data_ptr, physics_ptr) {}

Member Function Documentation

◆ evaluateLhs()

MoFEMErrorCode EshelbianPlasticity::OpHMHH::evaluateLhs ( EntData data)
virtual

Implements EshelbianPlasticity::OpJacobian.

Definition at line 95 of file EshelbianADOL-C.cpp.

95 {
105
106 const int number_of_active_variables = physicsPtr->activeVariables.size();
107 const int number_of_dependent_variables =
108 physicsPtr->dependentVariablesPiola.size();
109 std::vector<double *> jac_ptr(number_of_dependent_variables);
110 for (unsigned int n = 0; n != number_of_dependent_variables; ++n) {
111 jac_ptr[n] =
112 &(physicsPtr
113 ->dependentVariablesPiolaDirevatives[n *
114 number_of_active_variables]);
115 }
116
117 const auto nb_integration_pts = getGaussPts().size2();
118
119 auto create_data_mat = [nb_integration_pts](auto &m) {
120 m.resize(9, nb_integration_pts, false);
121 };
122
123 dataAtPts->P_du.resize(81, nb_integration_pts, false);
124
125 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
126 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
127 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
128
132
133 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
134
135 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
136
138
140 case LARGE_ROT:
141 case MODERATE_ROT:
142 t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
143 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
144 break;
145 case SMALL_ROT:
146 physicsPtr->get_h()(i, j) = iu(i, j);
147 break;
148 };
149
150 // play recorder for jacobians
151 int r = ::jacobian(tAg, number_of_dependent_variables,
152 number_of_active_variables,
153 &physicsPtr->activeVariables[0], &jac_ptr[0]);
154 if (r < 0) {
155 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
156 "ADOL-C function evaluation with error");
157 }
158
160 t_P_dh_tmp(i, j, N0, k) = physicsPtr->get_P_dh0()(i, j, k);
161 t_P_dh_tmp(i, j, N1, k) = physicsPtr->get_P_dh1()(i, j, k);
162 t_P_dh_tmp(i, j, N2, k) = physicsPtr->get_P_dh2()(i, j, k);
163
165 case LARGE_ROT:
166 case MODERATE_ROT: {
168 t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
169 r_P_du(k, l, m, n) =
170 (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
171 } break;
172 case SMALL_ROT:
173 r_P_du(i, j, m, n) = t_P_dh_tmp(i, j, m, n);
174 break;
175 };
176
177 ++iu;
178 ++t_grad_h1;
179 ++r_P_du;
180 }
182}
static Index< 'o', 3 > o
static Number< 2 > N2
static Index< 'p', 3 > p
static Number< 1 > N1
static Number< 0 > N0
Kronecker Delta class.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
int r
Definition: sdf.py:8
boost::shared_ptr< PhysicalEquations > physicsPtr
material physical equations
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

◆ evaluateRhs()

MoFEMErrorCode EshelbianPlasticity::OpHMHH::evaluateRhs ( EntData data)
virtual

Implements EshelbianPlasticity::OpJacobian.

Definition at line 28 of file EshelbianADOL-C.cpp.

28 {
36
37 const auto nb_integration_pts = getGaussPts().size2();
38 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
39 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
40
41 auto create_data_vec = [nb_integration_pts](auto &v) {
42 v.resize(nb_integration_pts, false);
43 };
44 auto create_data_mat = [nb_integration_pts](auto &m) {
45 m.resize(9, nb_integration_pts, false);
46 };
47
48 create_data_mat(dataAtPts->PAtPts);
49
50 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
51 auto r_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
52 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
53
55
57 case LARGE_ROT:
58 case MODERATE_ROT:
59 t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
60 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
61 break;
62 case SMALL_ROT:
63 physicsPtr->get_h()(i, j) = iu(i, j);
64 break;
65 };
66
67 int r = ::function(tAg, physicsPtr->dependentVariablesPiola.size(),
68 physicsPtr->activeVariables.size(),
69 &physicsPtr->activeVariables[0],
70 &physicsPtr->dependentVariablesPiola[0]);
71 if (r < 0) { // function is locally analytic
72 SETERRQ1(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
73 "ADOL-C function evaluation with error r = %d", r);
74 }
75
77 case LARGE_ROT:
78 case MODERATE_ROT: {
80 t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
81 r_P(k, l) = physicsPtr->get_P()(i, j) * t_h1_du(i, j, k, l);
82 }; break;
83 case SMALL_ROT:
84 r_P(i, j) = physicsPtr->get_P()(i, j);
85 break;
86 };
87
88 ++iu;
89 ++t_grad_h1;
90 ++r_P;
91 }
93}
const double v
phase velocity of light in medium (cm/ns)

The documentation for this struct was generated from the following file: