398 {
408
409 const int number_of_active_variables = physicsPtr->activeVariables.size();
410 const int number_of_dependent_variables =
411 physicsPtr->dependentVariablesPiola.size();
412 std::vector<double *> jac_ptr(number_of_dependent_variables);
413 for (
unsigned int n = 0;
n != number_of_dependent_variables; ++
n) {
415 &(physicsPtr
416 ->dependentVariablesPiolaDirevatives[
n *
417 number_of_active_variables]);
418 }
419
420 const auto nb_integration_pts = getGaussPts().size2();
421
422 auto create_data_mat = [nb_integration_pts](
auto &
m) {
423 m.resize(9, nb_integration_pts,
false);
424 };
425
426 dataAtPts->P_du.resize(81, nb_integration_pts, false);
427
428 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
429 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
430 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
431
435
437
438 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
439
441
445 physicsPtr->get_h()(
i,
j) = iu(
i,
k) * t_h1(
k,
j);
446 break;
450 physicsPtr->get_h()(
i,
j) = iu(
i,
k) * t_h1(
k,
j);
451 break;
453 physicsPtr->get_h()(
i,
j) = iu(
i,
j);
454 break;
455 };
456
457
458 int r = ::jacobian(tAg, number_of_dependent_variables,
459 number_of_active_variables,
460 &physicsPtr->activeVariables[0], &jac_ptr[0]);
461 if (r < 0) {
463 "ADOL-C function evaluation with error");
464 }
465
467 t_P_dh_tmp(
i,
j, N0,
k) = physicsPtr->get_P_dh0()(
i,
j,
k);
468 t_P_dh_tmp(
i,
j, N1,
k) = physicsPtr->get_P_dh1()(
i,
j,
k);
469 t_P_dh_tmp(
i,
j, N2,
k) = physicsPtr->get_P_dh2()(
i,
j,
k);
470
476 (t_P_dh_tmp(
i,
j, o, p) * t_h1_du(o, p,
m,
n)) * t_h1_du(
i,
j,
k,
l);
477 } break;
482 (t_P_dh_tmp(
i,
j, o, p) * t_h1_du(o, p,
m,
n)) * t_h1_du(
i,
j,
k,
l);
483 } break;
486 r_P_du(
i,
j,
m,
n) = t_P_dh_tmp(
i,
j,
m,
n);
487 break;
488 };
489
490 ++iu;
491 ++t_grad_h1;
492 ++r_P_du;
493 }
495}
#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