291 {
293
298
300
301 AssemblyDomainEleOp::locMat.resize(AssemblyDomainEleOp::nbRows, AssemblyDomainEleOp::nbCols,
302 false);
303 AssemblyDomainEleOp::locMat.clear();
304
305 const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
306 const auto nb_row_base_functions = row_data.getN().size2();
307
308 if (AssemblyDomainEleOp::colType == MBVERTEX &&
309 AssemblyDomainEleOp::colSide == 0) {
310
311 resDiff.resize(DIM * DIM, nb_integration_pts,
false);
312 auto t_res_diff = getFTensor2FromMat<DIM, DIM>(
resDiff);
313 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(
commonDataPtr->mGradPtr));
314 auto t_logC_dC =
316 auto t_c_dstrain =
317 getFTensor2SymmetricFromMat<DIM>(
commonDataPtr->resCdStrain);
318
319 auto next = [&]() {
320 ++t_grad;
321 ++t_logC_dC;
322 ++t_c_dstrain;
323 ++t_res_diff;
324 };
325
327
328 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
332
333 t_diff_ls_dlog_c(
k,
l) =
334 (t_c_dstrain(
i,
j)) * (t_logC_dC(
i,
j,
k,
l) / 2);
337
339 t_res_diff(
i,
j) = (t_diff_ls_dlog_c(
k,
l) * t_dC_dF(
k,
l,
i,
j));
340 next();
341 }
342 }
343
344 auto t_res_diff = getFTensor2FromMat<DIM, DIM>(
resDiff);
345
346 auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
347 auto t_row_base = row_data.getFTensor0N();
348 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
349 double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
350 ++t_w;
351
352 auto t_mat =
353 getFTensor1FromPtr<DIM>(AssemblyDomainEleOp::locMat.data().data());
354 size_t rr = 0;
355 for (; rr != AssemblyDomainEleOp::nbRows; ++rr) {
356 const auto row_base = alpha * t_row_base;
357 auto t_col_diff_base = col_data.getFTensor1DiffN<DIM>(gg, 0);
358 for (size_t cc = 0; cc != AssemblyDomainEleOp::nbCols / DIM; cc++) {
359 t_mat(
i) += row_base * (t_res_diff(
i,
j) * t_col_diff_base(
j));
360 ++t_mat;
361 ++t_col_diff_base;
362 }
363 ++t_row_base;
364 }
365 for (; rr != nb_row_base_functions; ++rr)
366 ++t_row_base;
367
368 ++t_res_diff;
369 }
370
372}
#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()
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto diff_symmetrize(FTensor::Number< DIM >)