401 {
411
412 const int number_of_active_variables = physicsPtr->activeVariables.size();
413 const int number_of_dependent_variables =
414 physicsPtr->dependentVariablesPiola.size();
415 std::vector<double *> jac_ptr(number_of_dependent_variables);
416 for (
unsigned int n = 0;
n != number_of_dependent_variables; ++
n) {
418 &(physicsPtr
419 ->dependentVariablesPiolaDirevatives[
n *
420 number_of_active_variables]);
421 }
422
423 const auto nb_integration_pts = getGaussPts().size2();
424
425 auto create_data_mat = [nb_integration_pts](
auto &
m) {
426 m.resize(9, nb_integration_pts,
false);
427 };
428
429 dataAtPts->P_du.resize(81, nb_integration_pts, false);
430
431 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
432 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
433 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
434
438
440
441 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
442
444
448 physicsPtr->get_h()(
i,
j) = iu(
i,
k) * t_h1(
k,
j);
449 break;
453 physicsPtr->get_h()(
i,
j) = iu(
i,
k) * t_h1(
k,
j);
454 break;
456 physicsPtr->get_h()(
i,
j) = iu(
i,
j);
457 break;
458 };
459
460
461 CHKERR physicsPtr->setParams(tAg, getFEEntityHandle(), gg);
462 int r = ::jacobian(tAg, number_of_dependent_variables,
463 number_of_active_variables,
464 &physicsPtr->activeVariables[0], &jac_ptr[0]);
465 if (r < 0) {
467 "ADOL-C function evaluation with error");
468 }
469
471 t_P_dh_tmp(
i,
j, N0,
k) = physicsPtr->get_P_dh0()(
i,
j,
k);
472 t_P_dh_tmp(
i,
j, N1,
k) = physicsPtr->get_P_dh1()(
i,
j,
k);
473 t_P_dh_tmp(
i,
j, N2,
k) = physicsPtr->get_P_dh2()(
i,
j,
k);
474
480 (t_P_dh_tmp(
i,
j, o, p) * t_h1_du(o, p,
m,
n)) * t_h1_du(
i,
j,
k,
l);
481 } break;
486 (t_P_dh_tmp(
i,
j, o, p) * t_h1_du(o, p,
m,
n)) * t_h1_du(
i,
j,
k,
l);
487 } break;
490 r_P_du(
i,
j,
m,
n) = t_P_dh_tmp(
i,
j,
m,
n);
491 break;
492 };
493
494 ++iu;
495 ++t_grad_h1;
496 ++r_P_du;
497 }
499}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Index< 'm', 3 > m
static enum RotSelector gradApproximator