400 {
410
411 const int number_of_active_variables = physicsPtr->activeVariables.size();
412 const int number_of_dependent_variables =
413 physicsPtr->dependentVariablesPiola.size();
414 std::vector<double *> jac_ptr(number_of_dependent_variables);
415 for (
unsigned int n = 0;
n != number_of_dependent_variables; ++
n) {
417 &(physicsPtr
418 ->dependentVariablesPiolaDirevatives[
n *
419 number_of_active_variables]);
420 }
421
422 const auto nb_integration_pts = getGaussPts().size2();
423
424 auto create_data_mat = [nb_integration_pts](
auto &
m) {
425 m.resize(9, nb_integration_pts,
false);
426 };
427
428 dataAtPts->P_du.resize(81, nb_integration_pts, false);
429
430 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
431 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
432 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
433
437
439
440 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
441
443
447 physicsPtr->get_h()(
i,
j) = iu(
i,
k) * t_h1(
k,
j);
448 break;
452 physicsPtr->get_h()(
i,
j) = iu(
i,
k) * t_h1(
k,
j);
453 break;
455 physicsPtr->get_h()(
i,
j) = iu(
i,
j);
456 break;
457 };
458
459
460 int r = ::jacobian(tAg, number_of_dependent_variables,
461 number_of_active_variables,
462 &physicsPtr->activeVariables[0], &jac_ptr[0]);
463 if (r < 0) {
465 "ADOL-C function evaluation with error");
466 }
467
469 t_P_dh_tmp(
i,
j, N0,
k) = physicsPtr->get_P_dh0()(
i,
j,
k);
470 t_P_dh_tmp(
i,
j, N1,
k) = physicsPtr->get_P_dh1()(
i,
j,
k);
471 t_P_dh_tmp(
i,
j, N2,
k) = physicsPtr->get_P_dh2()(
i,
j,
k);
472
478 (t_P_dh_tmp(
i,
j, o, p) * t_h1_du(o, p,
m,
n)) * t_h1_du(
i,
j,
k,
l);
479 } break;
484 (t_P_dh_tmp(
i,
j, o, p) * t_h1_du(o, p,
m,
n)) * t_h1_du(
i,
j,
k,
l);
485 } break;
488 r_P_du(
i,
j,
m,
n) = t_P_dh_tmp(
i,
j,
m,
n);
489 break;
490 };
491
492 ++iu;
493 ++t_grad_h1;
494 ++r_P_du;
495 }
497}
#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()
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