Operator for linear form, usually to calculate values on right hand side.
56 {
58
62 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
64 auto t_flow =
65 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->plasticFlow);
66 auto t_plastic_strain_dot =
67 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->plasticStrainDot);
68 auto t_stress =
69 getFTensor2SymmetricFromMat<SPACE_DIM>(*(
commonDataPtr->mStressPtr));
70
71 auto t_D =
72 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*
commonDataPtr->mDPtr);
73 auto t_D_Op = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*
mDPtr);
74
77
80 t_flow_dir_dstress(
i,
j,
k,
l) =
81 1.5 * (t_diff_deviator(
M,
N,
i,
j) * t_diff_deviator(
M,
N,
k,
l));
82 t_flow_dir_dstrain(
i,
j,
k,
l) =
83 t_flow_dir_dstress(
i,
j,
m,
n) * t_D_Op(
m,
n,
k,
l);
84
92 false);
94 false);
95
104
106 auto t_res_c_dtau = getFTensor0FromVec(
commonDataPtr->resCdTau);
107 auto t_res_c_dstrain =
108 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->resCdStrain);
109 auto t_res_c_dstrain_dot =
110 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->resCdStrainDot);
111 auto t_res_flow =
112 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->resFlow);
113 auto t_res_flow_dtau =
114 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->resFlowDtau);
115 auto t_res_flow_dstrain = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
117 auto t_res_flow_dstrain_dot = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
119
120 auto next = [&]() {
121 ++t_tau;
122 ++t_tau_dot;
123 ++t_f;
124 ++t_flow;
125 ++t_plastic_strain_dot;
126 ++t_stress;
127 ++t_res_c;
128 ++t_res_c_dtau;
129 ++t_res_c_dstrain;
130 ++t_res_c_dstrain_dot;
131 ++t_res_flow;
132 ++t_res_flow_dtau;
133 ++t_res_flow_dstrain;
134 ++t_res_flow_dstrain_dot;
135 ++t_w;
136 };
137
138 auto get_avtive_pts = [&]() {
139 int nb_points_avtive_on_elem = 0;
140 int nb_points_on_elem = 0;
141
143 auto t_tau_dot = getFTensor0FromVec(
commonDataPtr->plasticTauDot);
144 auto t_f = getFTensor0FromVec(
commonDataPtr->plasticSurface);
145 auto t_plastic_strain_dot =
146 getFTensor2SymmetricFromMat<SPACE_DIM>(
commonDataPtr->plasticStrainDot);
147
150 const auto ww =
w(eqiv, t_tau_dot, t_f,
hardening(t_tau));
152
153 ++nb_points_on_elem;
154 if (sign_ww > 0) {
155 ++nb_points_avtive_on_elem;
156 }
157
158 ++t_tau;
159 ++t_tau_dot;
160 ++t_f;
161 ++t_plastic_strain_dot;
162 }
163
169
170 ++nb_elements;
171 nb_points += nb_points_on_elem;
172 if (nb_points_avtive_on_elem > 0) {
173 ++avtive_elems;
174 active_points += nb_points_avtive_on_elem;
175 if (nb_points_avtive_on_elem == nb_points_on_elem) {
176 ++avtive_full_elems;
177 }
178 }
179
180 if (nb_points_avtive_on_elem != nb_points_on_elem)
181 return 1;
182 else
183 return 0;
184 };
185
186 if (
getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
187 get_avtive_pts();
188 }
189
191
194 t_diff_plastic_strain);
195
198
199 auto ww =
w(eqiv, t_tau_dot, t_f, sigma_y);
202
203 auto c =
constraint(eqiv, t_tau_dot, t_f, sigma_y, abs_ww);
208
211 t_flow_dir(
k,
l) = 1.5 * (t_dev_stress(
I,
J) * t_diff_deviator(
I,
J,
k,
l));
213 t_flow_dstrain(
i,
j) = t_flow(
k,
l) * t_D_Op(
k,
l,
i,
j);
214
215 auto get_res_c = [&]() {
return c; };
216
217 auto get_res_c_dstrain = [&](auto &t_diff_res) {
218 t_diff_res(
i,
j) = c_f * t_flow_dstrain(
i,
j);
219 };
220
221 auto get_res_c_dstrain_dot = [&](auto &t_diff_res) {
222 t_diff_res(
i,
j) = (
getTSa() * c_equiv) * t_diff_eqiv(
i,
j);
223 };
224
225 auto get_res_c_dtau = [&]() {
226 return getTSa() * c_dot_tau + c_sigma_y * d_sigma_y;
227 };
228
229 auto get_res_flow = [&](auto &t_res_flow) {
230 const auto a = sigma_y;
231 const auto b = t_tau_dot;
232 t_res_flow(
k,
l) =
a * t_plastic_strain_dot(
k,
l) -
b * t_flow_dir(
k,
l);
233 };
234
235 auto get_res_flow_dtau = [&](auto &t_res_flow_dtau) {
236 const auto da = d_sigma_y;
238 t_res_flow_dtau(
k,
l) =
239 da * t_plastic_strain_dot(
k,
l) - db * t_flow_dir(
k,
l);
240 };
241
242 auto get_res_flow_dstrain = [&](auto &t_res_flow_dstrain) {
243 const auto b = t_tau_dot;
244 t_res_flow_dstrain(
m,
n,
k,
l) = -t_flow_dir_dstrain(
m,
n,
k,
l) *
b;
245 };
246
247 auto get_res_flow_dstrain_dot = [&](auto &t_res_flow_dstrain_dot) {
248 const auto a = sigma_y;
249 t_res_flow_dstrain_dot(
m,
n,
k,
l) =
250 (
a *
getTSa()) * t_diff_plastic_strain(
m,
n,
k,
l);
251 };
252
253 t_res_c = get_res_c();
254 get_res_flow(t_res_flow);
255
256 if (
getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
257 t_res_c_dtau = get_res_c_dtau();
258 get_res_c_dstrain(t_res_c_dstrain);
259 get_res_c_dstrain_dot(t_res_c_dstrain_dot);
260 get_res_flow_dtau(t_res_flow_dtau);
261 get_res_flow_dstrain(t_res_flow_dstrain);
262 get_res_flow_dstrain_dot(t_res_flow_dstrain_dot);
263 }
264
265 next();
266 }
267
269}
#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()
const double c
speed of light (cm/ns)
auto deviator(FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_stress, double trace)
double constrian_sign(double x)
FTensor::Index< 'j', SPACE_DIM > j
FTensor::Index< 'M', 3 > M
double diff_constrain_eqiv(double sign, double eqiv, double dot_tau)
FTensor::Index< 'l', SPACE_DIM > l
FTensor::Index< 'k', SPACE_DIM > k
auto diff_tensor()
[Operators definitions]
auto diff_constrain_df(double sign)
double w(double eqiv, double dot_tau, double f, double sigma_y)
FTensor::Index< 'N', 3 > N
auto diff_constrain_dsigma_y(double sign)
FTensor::Index< 'I', 3 > I
auto diff_deviator(FTensor::Ddg< double, SPACE_DIM, SPACE_DIM > &&t_diff_stress)
FTensor::Index< 'i', SPACE_DIM > i
[Common data]
FTensor::Index< 'm', SPACE_DIM > m
double constrain_abs(double x)
FTensor::Index< 'J', 3 > J
auto diff_equivalent_strain_dot(const T1 eqiv, T2 &t_plastic_strain_dot, T3 &t_diff_plastic_strain)
double trace(FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_stress)
double constraint(double eqiv, double dot_tau, double f, double sigma_y, double abs_w)
double diff_constrain_ddot_tau(double sign, double eqiv)
auto equivalent_strain_dot(FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_plastic_strain_dot)
FTensor::Index< 'n', SPACE_DIM > n
double hardening(double tau)
double hardening_dtau(double tau)
auto getFTensor0IntegrationWeight()
Get integration weights.
const TSMethod::TSContext getTSCtx() const
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element