14#include <boost/math/constants/constants.hpp>
28 boost::shared_ptr<ExternalStrainVec> external_strain_vec_ptr,
29 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
31 externalPressurePtr(
std::move(external_pressure_ptr)),
32 externalStrainVecPtr(
std::move(external_strain_vec_ptr)),
33 scalingMethodsMap(
std::move(smv)) {
44 "External-pressure integration-point vector is null");
47 const int nb_integration_pts =
getGaussPts().size2();
64 const std::regex analytical_pattern(
"(.*)ANALYTICAL_EXTERNALSTRAIN(.*)");
67 if (block.ents.find(fe_ent) == block.ents.end()) {
70 if (!std::isfinite(block.bulkModulusK)) {
72 "External-strain bulk modulus is not finite in block %s",
73 block.blockName.c_str());
77 if (std::regex_match(block.blockName, analytical_pattern)) {
79 external_strain = analytical_externalstrain_function(
80 time_step, time, nb_integration_pts, reference_coordinates,
88 "Scaling method is null for external-strain block %s",
89 block.blockName.c_str());
91 scale = it->second->getScale(time);
94 <<
"No scaling method found for " << block.blockName;
96 std::fill(external_strain.begin(), external_strain.end(),
100 if (external_strain.size() != nb_integration_pts) {
102 "Wrong number of analytical external-strain integration points");
104 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
105 const double q = 3 * block.bulkModulusK * external_strain[gg];
106 if (!std::isfinite(
q)) {
108 "External pressure q is not finite in block %s",
109 block.blockName.c_str());
111 (*externalPressurePtr)[gg] +=
q;
114 "Accumulated external pressure q is not finite in block %s",
115 block.blockName.c_str());
123template <
typename TInvD,
typename TRotation,
typename TDiffRotation,
126 TDiffRotation &t_diff_R, TStress &t_P) {
129 t_d_rotated_p_d_omega;
130 t_d_rotated_p_d_omega(
i,
j,
k) = t_diff_R(
n,
i,
k) * t_P(
n,
j);
133 t_d_b_d_omega(
i,
j,
k) =
134 (t_d_rotated_p_d_omega(
i,
j,
k) || t_d_rotated_p_d_omega(
j,
i,
k)) / 2.;
137 t_d_u_d_omega(
i,
j,
k) = t_d_u_d_b(
i,
j,
l,
m) * t_d_b_d_omega(
l,
m,
k);
140 t_d_h_d_omega(
i,
j,
k) = t_R(
i,
l) * t_d_u_d_omega(
j,
l,
k);
142 return std::make_tuple(t_d_b_d_omega, t_d_u_d_omega, t_d_h_d_omega);
167 auto t_L = FTensor::SymmLTensor<double, 3>();
170 *
dataAtPts->getStretchTensorAtPts(), nb_integration_pts);
172 *
dataAtPts->getDiffStretchTensorAtPts(), nb_integration_pts);
174 *
dataAtPts->getStretchH1AtPts(), nb_integration_pts);
176 *
dataAtPts->getDiffStretchH1AtPts(), nb_integration_pts);
178 *
dataAtPts->getAdjointPdstretchAtPts(), nb_integration_pts);
180 *
dataAtPts->getAdjointPdUAtPts(), nb_integration_pts);
182 *
dataAtPts->getAdjointPdUdPAtPts(), nb_integration_pts);
184 *
dataAtPts->getAdjointPdUdOmegaAtPts(), nb_integration_pts);
187 *
dataAtPts->getDeformationGradient(), nb_integration_pts);
189 *
dataAtPts->getPlasticH(), nb_integration_pts);
191 *
dataAtPts->getPlasticF(), nb_integration_pts);
193 *
dataAtPts->getInvPlasticF(), nb_integration_pts);
195 dataAtPts->hdOmegaAtPts, nb_integration_pts);
197 dataAtPts->hdLogStretchAtPts, nb_integration_pts);
200 dataAtPts->leviKirchhoffAtPts, nb_integration_pts);
202 dataAtPts->leviKirchhoff0AtPts, nb_integration_pts);
204 dataAtPts->leviKirchhoffdOmegaAtPts, nb_integration_pts);
206 dataAtPts->leviKirchhoffdLogStreatchAtPts, nb_integration_pts);
208 dataAtPts->leviKirchhoffPAtPts, nb_integration_pts);
211 dataAtPts->rotMatAtPts, nb_integration_pts);
213 *
dataAtPts->getEigenVals(), nb_integration_pts);
215 *
dataAtPts->getEigenVecs(), nb_integration_pts);
216 dataAtPts->nbUniq.resize(nb_integration_pts,
false);
218 dataAtPts->eigenValsC, nb_integration_pts);
220 dataAtPts->eigenVecsC, nb_integration_pts);
221 dataAtPts->nbUniqC.resize(nb_integration_pts,
false);
224 dataAtPts->logStretch2H1AtPts, nb_integration_pts);
226 dataAtPts->logStretchTotalTensorAtPts, nb_integration_pts);
229 dataAtPts->internalStressAtPts, nb_integration_pts);
235 auto t_log_plasticH =
dataAtPts->getFTensorPlasticH(nb_integration_pts);
236 auto t_plasticF_reconstruct =
237 dataAtPts->getFTensorPlasticF(nb_integration_pts);
238 auto t_invPlasticF_reconstruct =
239 dataAtPts->getFTensorInvPlasticF(nb_integration_pts);
246 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
249 t_eigen_vecs(
i,
j) = t_log_plasticH(
i,
j);
252 "Failed to diagonalise logarithmic plastic deformation");
253 const auto t_exp_plasticH =
255 const auto t_inv_exp_plasticH =
257 t_plasticF_reconstruct(
i,
j) = t_exp_plasticH(
i,
j);
258 t_invPlasticF_reconstruct(
i,
j) = t_inv_exp_plasticH(
i,
j);
261 const double det_plasticF =
263 if (!std::isfinite(det_plasticF) ||
264 det_plasticF <= std::numeric_limits<double>::epsilon())
266 "Plastic deformation gradient must have a positive determinant; "
272 ++t_plasticF_reconstruct;
273 ++t_invPlasticF_reconstruct;
278 auto get_intermediate_p =
280 DL>::size(intermediate_p_at_pts, nb_integration_pts);
281 auto get_intermediate_p0 =
283 DL>::size(intermediate_p0_at_pts, nb_integration_pts);
284 auto t_reference_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
285 auto t_reference_P0 =
dataAtPts->getFTensorApproxP0(nb_integration_pts);
286 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
287 auto t_intermediate_P = get_intermediate_p();
288 auto t_intermediate_P0 = get_intermediate_p0();
289 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
291 t_intermediate_P(
i,
j) =
292 t_reference_P(
i,
k) * t_plasticF(
j,
k) / det_plasticF;
293 t_intermediate_P0(
i,
j) =
294 t_reference_P0(
i,
k) * t_plasticF(
j,
k) / det_plasticF;
307 auto t_levi_kirchhoff =
309 auto t_levi_kirchhoff0 =
311 auto t_levi_kirchhoff_domega =
313 auto t_levi_kirchhoff_dstreach =
315 auto t_levi_kirchhoff_dP =
317 auto t_approx_P_adjoint_dstretch =
319 auto t_approx_P_adjoint_log_du =
321 auto t_approx_P_adjoint_log_du_dP =
323 auto t_approx_P_adjoint_log_du_domega =
333 auto t_eigen_vals_C =
dataAtPts->getFTensorEigenValsC(nb_integration_pts);
334 auto t_eigen_vecs_C =
dataAtPts->getFTensorEigenVecsC(nb_integration_pts);
341 auto t_log_stretch_total =
348 auto t_approx_P = get_intermediate_p();
349 auto t_approx_P0 = get_intermediate_p0();
363 ++t_levi_kirchhoff_domega;
364 ++t_levi_kirchhoff_dstreach;
365 ++t_levi_kirchhoff_dP;
366 ++t_approx_P_adjoint_dstretch;
367 ++t_approx_P_adjoint_log_du;
368 ++t_approx_P_adjoint_log_du_dP;
369 ++t_approx_P_adjoint_log_du_domega;
382 ++t_log_stretch_total;
395 constexpr auto t_diff_sym = FTensor::DiffSymmetrize<double>();
397 auto calculate_stretch_from_log = [&](
auto &t_log_u_src,
auto &t_u_dst,
398 auto &t_eigen_vals_dst,
399 auto &t_eigen_vecs_dst,
404 eigen_vec(
i,
j) = t_log_u_src(
i,
j);
406 MOFEM_LOG(
"SELF", Sev::error) <<
"Failed to compute eigen values";
410 nb_uniq_dst = getUniqNb<3>(eig);
411 if (nb_uniq_dst < 3) {
412 CHKERR sortEigenVals<3>(eig, eigen_vec);
414 t_eigen_vals_dst(
i) = eig(
i);
415 t_eigen_vecs_dst(
i,
j) = eigen_vec(
i,
j);
421 auto calculate_log_stretch = [&]() {
424 CHKERR calculate_stretch_from_log(t_log_u, t_u, t_eigen_vals, t_eigen_vecs,
426 t_nb_uniq = nb_uniq_val;
427 auto get_t_diff_u = [&]() {
432 t_diff_u(
i,
j,
k,
l) = get_t_diff_u()(
i,
j,
k,
l);
434 t_Ldiff_u(
i,
j,
L) = t_diff_u(
i,
j,
m,
n) * t_L(
m,
n,
L);
438 auto calculate_total_stretch = [&](
auto &t_h1) {
442 t_log_u2_h1(
i,
j) = 0;
443 t_log_stretch_total(
i,
j) = t_log_u(
i,
j);
452 t_C_h1(
i,
j) = t_h1(
k,
i) * t_h1(
k,
j);
453 t_eigen_vec(
i,
j) = t_C_h1(
i,
j);
456 "Failed to compute eigenvalues of F_H1^T F_H1");
459 t_nb_uniq_C = getUniqNb<3>(t_eig_C);
460 if (t_nb_uniq_C < 3) {
461 CHKERR sortEigenVals<3>(t_eig_C, t_eigen_vec);
463 for (
int aa = 0; aa != 3; ++aa) {
464 if (!std::isfinite(t_eig_C(aa)) || t_eig_C(aa) <= 0.) {
466 "F_H1^T F_H1 must be positive definite; eigenvalue %d is "
470 const double principal_stretch = std::sqrt(t_eig_C(aa));
471 const double coordinate_stretch =
473 if (!std::isfinite(coordinate_stretch)) {
474 SETERRQ(PETSC_COMM_SELF, PETSC_ERR_FP,
475 "Non-finite H1 coordinate stretch for principal stretch %g",
478 t_coordinate_stretch(aa) = coordinate_stretch;
480 t_eigen_vals_C(
i) = t_eig_C(
i);
481 t_eigen_vecs_C(
i,
j) = t_eigen_vec(
i,
j);
485 [](
const double v) {
return v; })(
i,
j);
488 t_log_stretch_total(
i,
j) = t_log_u2_h1(
i,
j) + t_log_u(
i,
j);
493 auto no_h1_loop = [&]() {
503 "no_h1_loop is only implemented for LARGE_ROT");
506 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
514 CHKERR calculate_log_stretch();
516 if ((
dataAtPts->physicsPtr->getFeatures() &
517 PhysicalEquations::noStretchMask)
519 t_u0(
i,
j) = t_u(
i,
j);
524 CHKERR calculate_stretch_from_log(t_log_u0, t_u0, t_eigen_vals_0,
525 t_eigen_vecs_0, nb_uniq_0);
528 CHKERR calculate_total_stretch(t_h1);
530 t_u_h1(
i,
j) = t_u(
i,
j);
531 t_diff_u_h1(
i,
j,
k,
l) = t_diff_u(
i,
j,
k,
l);
533 t_Ldiff_u(
i,
j,
L) = t_diff_u(
i,
j,
m,
n) * t_L(
m,
n,
L);
538 auto large_rot = [&]() {
542 t_diff_diff_R(
i,
j,
k,
l) =
549 t_h(
i,
k) = t_R(
i,
l) * t_u(
l,
k);
552 t_rotated_P(
l,
k) = t_R(
i,
l) * t_approx_P(
i,
k);
553 t_approx_P_adjoint_dstretch(
l,
k) =
554 t_diff_sym(
l,
k,
i,
j) * t_rotated_P(
i,
j);
555 t_approx_P_adjoint_log_du(
L) =
556 t_approx_P_adjoint_dstretch(
l,
k) * t_Ldiff_u(
l,
k,
L);
558 t_levi_kirchhoff(
m) =
559 t_diff_R(
i,
l,
m) * (t_u(
l,
k) * t_approx_P(
i,
k));
560 t_levi_kirchhoff0(
m) =
561 t_diff_R0(
i,
l,
m) * (t_u0(
l,
k) * t_approx_P0(
i,
k));
564 t_h_domega(
i,
k,
m) = t_diff_R(
i,
l,
m) * t_u(
l,
k);
565 t_h_dlog_u(
i,
k,
L) = t_R(
i,
l) * t_Ldiff_u(
l,
k,
L);
567 t_approx_P_adjoint_log_du_dP(
i,
k,
L) =
568 t_R(
i,
l) * t_Ldiff_u(
l,
k,
L);
571 t_A(
k,
l,
m) = t_diff_R(
i,
l,
m) * t_approx_P(
i,
k);
572 t_approx_P_adjoint_log_du_domega(
m,
L) =
573 t_A(
k,
l,
m) * t_Ldiff_u(
k,
l,
L);
575 t_levi_kirchhoff_dstreach(
m,
L) =
576 t_diff_R(
i,
l,
m) * (t_Ldiff_u(
l,
k,
L) * t_approx_P(
i,
k));
577 t_levi_kirchhoff_dP(
m,
i,
k) = t_diff_R(
i,
l,
m) * t_u(
l,
k);
578 t_levi_kirchhoff_domega(
m,
n) =
579 t_diff_diff_R(
i,
l,
m,
n) * (t_u(
l,
k) * t_approx_P(
i,
k));
581 if (
dataAtPts->physicsPtr->getFeatures().test(
582 PhysicalEquations::NO_STRETCH_NONLINEAR)) {
586 auto [t_d_b_d_omega, t_d_u_d_omega, t_d_h_d_omega] =
587 getDiffSpatialGradientDR(t_d_u_d_b, t_R, t_diff_R,
590 t_h_domega(
i,
k,
m) += t_d_h_d_omega(
i,
k,
m);
593 t_d_u_contract_p(
i,
l,
n) =
594 t_d_u_d_omega(
l,
k,
n) * t_approx_P(
i,
k);
595 t_levi_kirchhoff_domega(
m,
n) +=
596 t_diff_R(
i,
l,
m) * t_d_u_contract_p(
i,
l,
n);
602 t_d_b_d_p(
i,
j,
k,
l) =
603 t_diff_sym(
i,
j,
m,
l) * t_R(
k,
m);
607 t_d_u_d_p(
i,
j,
k,
l) =
608 t_d_u_d_b(
i,
j,
m,
n) * t_d_b_d_p(
m,
n,
k,
l);
609 t_levi_kirchhoff_dP(
m,
k,
l) +=
610 t_d_u_d_p(
i,
j,
k,
l) * t_d_b_d_omega(
i,
j,
m);
616 auto moderate_rot = [&](
auto &t_omega0) {
618 "moderate_rot is not implemented yet");
621 auto small_rot = [&]() {
622 t_u_h1(
i,
j) = t_u(
i,
j);
623 t_diff_u_h1(
i,
j,
k,
l) = t_diff_u(
i,
j,
k,
l);
625 t_Ldiff_u(
i,
j,
L) = t_diff_u(
i,
j,
m,
n) * t_L(
m,
n,
L);
627 t_R(
i,
j) =
t_kd(
i,
j) + levi_civita(
i,
j,
k) * t_omega(
k);
628 t_h(
i,
j) = levi_civita(
i,
j,
k) * t_omega(
k) + t_u(
i,
j);
630 t_h_domega(
i,
j,
k) = levi_civita(
i,
j,
k);
631 t_h_dlog_u(
i,
j,
L) = t_Ldiff_u(
i,
j,
L);
635 t_rotated_P(
i,
j) = t_R(
k,
i) * t_approx_P(
k,
j);
636 t_approx_P_adjoint_dstretch(
i,
j) =
637 t_diff_sym(
i,
j,
k,
l) * t_rotated_P(
k,
l);
638 t_approx_P_adjoint_log_du(
L) =
639 t_approx_P_adjoint_dstretch(
i,
j) * t_Ldiff_u(
i,
j,
L);
640 t_approx_P_adjoint_log_du_dP(
i,
j,
L) =
641 t_R(
i,
k) * t_Ldiff_u(
k,
j,
L);
642 t_approx_P_adjoint_log_du_domega(
m,
L) =
643 levi_civita(
k,
i,
m) * t_approx_P(
k,
j) *
647 t_levi_kirchhoff(
k) = levi_civita(
i,
j,
k) * t_approx_P(
i,
j);
648 t_levi_kirchhoff0(
k) = levi_civita(
i,
j,
k) * t_approx_P0(
i,
j);
649 t_levi_kirchhoff_dstreach(
m,
L) = 0;
650 t_levi_kirchhoff_dP(
k,
i,
j) = levi_civita(
i,
j,
k);
651 t_levi_kirchhoff_domega(
m,
n) = 0;
660 moderate_rot(t_omega0);
667 "rotationSelector not handled");
676 auto large_loop = [&]() {
686 "rotSelector should be large or small");
689 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
700 "Selected grad approximator not handled");
704 CHKERR calculate_log_stretch();
706 if ((
dataAtPts->physicsPtr->getFeatures() &
707 PhysicalEquations::noStretchMask)
709 t_u0(
i,
j) = t_u(
i,
j);
714 CHKERR calculate_stretch_from_log(t_log_u0, t_u0, t_eigen_vals_0,
715 t_eigen_vecs_0, nb_uniq_0);
718 CHKERR calculate_total_stretch(t_h1);
720 t_u_h1(
l,
k) = t_u(
l, o) * t_h1(o,
k);
722 t_u_h10(
l,
k) = t_u0(
l, o) * t_h1(o,
k);
723 t_diff_u_h1(
i,
j,
k,
l) = t_diff_u(
i, o,
k,
l) * t_h1(o,
j);
725 t_Ldiff_u_h1(
l,
k,
L) = t_diff_u_h1(
l,
k,
i,
j) * t_L(
i,
j,
L);
734 t_R(
i,
k) =
t_kd(
i,
k) + levi_civita(
i,
k,
l) * t_omega(
l);
735 t_diff_R(
i,
j,
k) = levi_civita(
i,
j,
k);
736 t_diff_R0(
i,
j,
k) = levi_civita(
i,
j,
k);
737 t_diff_diff_R(
i,
j,
l,
m) = 0;
745 t_diff_diff_R(
i,
j,
k,
l) =
751 "rotationSelector not handled");
755 t_h(
i,
k) = t_R(
i,
l) * t_u_h1(
l,
k);
760 (t_R(
i,
l) * t_approx_P(
i,
k)) * t_h1(o,
k);
761 t_approx_P_adjoint_dstretch(
l, o) =
762 t_diff_sym(
l, o,
i,
j) * t_rotated_P(
i,
j);
763 t_approx_P_adjoint_log_du(
L) =
764 t_R(
i,
l) * t_approx_P(
i,
k) * t_Ldiff_u_h1(
l,
k,
L);
767 t_levi_kirchhoff(
m) = t_diff_R(
i,
l,
m) * t_u_h1(
l,
k) * t_approx_P(
i,
k);
768 t_levi_kirchhoff0(
m) =
769 t_diff_R0(
i,
l,
m) * t_u_h10(
l,
k) * t_approx_P0(
i,
k);
773 t_h_domega(
i,
k,
m) = t_diff_R(
i,
l,
m) * t_u_h1(
l,
k);
774 t_h_dlog_u(
i,
k,
L) = t_R(
i,
l) * t_Ldiff_u_h1(
l,
k,
L);
776 t_approx_P_adjoint_log_du_dP(
i,
k,
L) =
777 t_R(
i,
l) * t_Ldiff_u_h1(
l,
k,
L);
780 t_A(
m,
L,
i,
k) = t_diff_R(
i,
l,
m) * t_Ldiff_u_h1(
l,
k,
L);
781 t_approx_P_adjoint_log_du_domega(
m,
L) =
782 t_A(
m,
L,
i,
k) * t_approx_P(
i,
k);
784 t_levi_kirchhoff_dstreach(
m,
L) =
785 t_diff_R(
i,
l,
m) * (t_Ldiff_u_h1(
l,
k,
L) * t_approx_P(
i,
k));
787 t_levi_kirchhoff_dP(
m,
i,
k) = t_diff_R(
i,
l,
m) * t_u_h1(
l,
k);
788 t_levi_kirchhoff_domega(
m,
n) =
789 t_diff_diff_R(
i,
l,
m,
n) * (t_u_h1(
l,
k) * t_approx_P(
i,
k));
798 auto moderate_loop = [&]() {
808 "rotSelector should be large or small");
811 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
822 "Selected grad approximator not handled");
826 CHKERR calculate_log_stretch();
828 CHKERR calculate_total_stretch(t_h1);
830 auto t_diff = FTensor::DiffTensor<double>();
832 t_u_h1(
l,
k) = (
t_kd(
l, o) + t_log_u(
l, o)) * t_h1(o,
k);
834 t_u_h10(
l,
k) = (
t_kd(
l, o) + t_log_u0(
l, o)) * t_h1(o,
k);
835 t_diff_u_h1(
i,
j,
k,
l) = t_diff(
i, o,
k,
l) * t_h1(o,
j);
837 t_Ldiff_u_h1(
l,
k,
L) = t_diff_u_h1(
l,
k,
i,
j) * t_L(
i,
j,
L);
846 t_R(
i,
k) =
t_kd(
i,
k) + levi_civita(
i,
k,
l) * t_omega(
l);
847 t_diff_R(
i,
j,
k) = levi_civita(
i,
j,
k);
848 t_diff_R0(
i,
j,
k) = levi_civita(
i,
j,
k);
849 t_diff_diff_R(
i,
j,
l,
m) = 0;
857 t_diff_diff_R(
i,
j,
k,
l) =
863 "rotationSelector not handled");
867 t_h(
i,
k) = t_R(
i,
l) * t_u_h1(
l,
k);
872 (t_R(
i,
l) * t_approx_P(
i,
k)) * t_h1(o,
k);
873 t_approx_P_adjoint_dstretch(
l, o) =
874 t_diff_sym(
l, o,
i,
j) * t_rotated_P(
i,
j);
875 t_approx_P_adjoint_log_du(
L) =
876 t_R(
i,
l) * t_approx_P(
i,
k) * t_Ldiff_u_h1(
l,
k,
L);
879 t_levi_kirchhoff(
m) = t_diff_R(
i,
l,
m) * t_u_h1(
l,
k) * t_approx_P(
i,
k);
880 t_levi_kirchhoff0(
m) =
881 t_diff_R0(
i,
l,
m) * t_u_h10(
l,
k) * t_approx_P0(
i,
k);
885 t_h_domega(
i,
k,
m) = t_diff_R(
i,
l,
m) * t_u_h1(
l,
k);
886 t_h_dlog_u(
i,
k,
L) = t_R(
i,
l) * t_Ldiff_u_h1(
l,
k,
L);
888 t_approx_P_adjoint_log_du_dP(
i,
k,
L) =
889 t_R(
i,
l) * t_Ldiff_u_h1(
l,
k,
L);
892 t_A(
m,
L,
i,
k) = t_diff_R(
i,
l,
m) * t_Ldiff_u_h1(
l,
k,
L);
893 t_approx_P_adjoint_log_du_domega(
m,
L) =
894 t_A(
m,
L,
i,
k) * t_approx_P(
i,
k);
896 t_levi_kirchhoff_dstreach(
m,
L) =
897 t_diff_R(
i,
l,
m) * (t_Ldiff_u_h1(
l,
k,
L) * t_approx_P(
i,
k));
899 t_levi_kirchhoff_dP(
m,
i,
k) = t_diff_R(
i,
l,
m) * t_u_h1(
l,
k);
900 t_levi_kirchhoff_domega(
m,
n) =
901 t_diff_diff_R(
i,
l,
m,
n) * (t_u_h1(
l,
k) * t_approx_P(
i,
k));
910 auto small_loop = [&]() {
917 "rotSelector should be small");
920 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
929 "gradApproximator not handled");
935 "stretchSelector should be linear for small loop");
937 t_u(
i,
j) = t_symm_kd(
i,
j) + t_log_u(
i,
j);
938 t_u_h1(
i,
j) = t_u(
i,
j);
939 t_diff_u_h1(
i,
j,
k,
l) =
941 t_diff_u_h1(
i,
j,
k,
l) /= 2.;
942 t_Ldiff_u(
i,
j,
L) = t_L(
i,
j,
L);
944 t_log_u2_h1(
i,
j) = 0;
945 t_log_stretch_total(
i,
j) = t_log_u(
i,
j);
947 t_R(
i,
j) =
t_kd(
i,
j) + levi_civita(
i,
j,
k) * t_omega(
k);
948 t_h(
i,
j) = levi_civita(
i,
j,
k) * t_omega(
k) + t_u(
i,
j);
950 t_h_domega(
i,
j,
k) = levi_civita(
i,
j,
k);
951 t_h_dlog_u(
i,
j,
L) = t_Ldiff_u(
i,
j,
L);
954 t_approx_P_adjoint_dstretch(
i,
j) =
955 t_diff_sym(
i,
j,
k,
l) * t_approx_P(
k,
l);
956 t_approx_P_adjoint_log_du(
L) =
957 t_approx_P_adjoint_dstretch(
i,
j) * t_Ldiff_u(
i,
j,
L);
958 t_approx_P_adjoint_log_du_dP(
i,
j,
L) = t_Ldiff_u(
i,
j,
L);
959 t_approx_P_adjoint_log_du_domega(
m,
L) = 0;
962 t_levi_kirchhoff(
k) = levi_civita(
i,
j,
k) * t_approx_P(
i,
j);
963 t_levi_kirchhoff0(
k) = levi_civita(
i,
j,
k) * t_approx_P0(
i,
j);
964 t_levi_kirchhoff_dstreach(
m,
L) = 0;
965 t_levi_kirchhoff_dP(
k,
i,
j) = levi_civita(
i,
j,
k);
966 t_levi_kirchhoff_domega(
m,
n) = 0;
975 case NO_H1_CONFIGURATION:
989 "gradApproximator not handled");
1001 auto n_in_the_loop = getNinTheLoop();
1002 auto loop_size = getLoopSize();
1003 auto sense = getSkeletonSense();
1004 auto nb_gauss_pts = getGaussPts().size2();
1005 auto t_normal = getFTensor1NormalsAtGaussPts();
1007 auto t_sigma =
dataAtPts->getFTensorApproxP(getGaussPts().size2());
1010 dataAtPts->tractionAtPts, nb_gauss_pts);
1011 if (!n_in_the_loop) {
1015 auto t_traction = get_tracion();
1016 for (
int gg = 0; gg != nb_gauss_pts; gg++) {
1018 t_sigma(
i,
j) * sense * (t_normal(
j) / t_normal.l2()) / loop_size;
1036 int nb_integration_pts = getGaussPts().size2();
1037 auto t_w = getFTensor0IntegrationWeight();
1038 auto t_traction =
dataAtPts->getFTensorTraction(nb_integration_pts);
1039 auto t_coords = getFTensor1CoordsAtGaussPts();
1040 auto t_spatial_disp =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1046 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
1047 double a = t_w * getMeasure();
1048 loc_reaction_forces(
i) +=
a*t_traction(
i);
1049 t_coords_spatial(
i) = t_coords(
i) + t_spatial_disp(
i);
1050 loc_moment_forces(
i) +=
1051 (
a * (FTensor::levi_civita<double>(
i,
j,
k) * t_coords_spatial(
j))) *
1072 int nb_integration_pts = data.
getN().size1();
1075 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1076 auto t_s_dot_w =
dataAtPts->getFTensorSmallWL2Dot(nb_integration_pts);
1077 auto w_l2_dot_dot_at_pts =
dataAtPts->getSmallWL2DotDotAtPts();
1078 const bool reset_w_l2_dot_dot =
1079 w_l2_dot_dot_at_pts->size1() != nb_integration_pts ||
1080 w_l2_dot_dot_at_pts->size2() != 3;
1082 *w_l2_dot_dot_at_pts, nb_integration_pts);
1083 if (reset_w_l2_dot_dot) {
1084 w_l2_dot_dot_at_pts->clear();
1086 auto t_s_dot_dot_w =
dataAtPts->getFTensorSmallWL2DotDot(nb_integration_pts);
1088 auto piola_scale =
dataAtPts->piolaScale;
1089 auto alpha_w =
alphaW / piola_scale;
1090 auto alpha_rho =
alphaRho / piola_scale;
1092 int nb_base_functions = data.
getN().size2();
1096 auto get_ftensor1 = [](
auto &
v) {
1108 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1110 auto t_nf = get_ftensor1(
nF);
1112 for (; bb != nb_dofs / 3; ++bb) {
1113 t_nf(
i) -=
a * t_row_base_fun * t_div_P(
i);
1114 t_nf(
i) +=
a * t_row_base_fun * alpha_w * t_s_dot_w(
i);
1115 t_nf(
i) +=
a * t_row_base_fun * alpha_rho * t_s_dot_dot_w(
i);
1119 for (; bb != nb_base_functions; ++bb)
1133 auto t_levi_kirchhoff =
1134 dataAtPts->getFTensorLeviKirchhoff(nb_integration_pts);
1135 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_integration_pts);
1136 auto t_omega_grad =
dataAtPts->getFTensorRotAxisGrad(nb_integration_pts);
1137 auto t_omega_dot =
dataAtPts->getFTensorRotAxisDot(nb_integration_pts);
1138 auto t_omega_grad_dot =
1139 dataAtPts->getFTensorRotAxisGradDot(nb_integration_pts);
1140 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
1141 auto t_invPlasticF =
dataAtPts->getFTensorInvPlasticF(nb_integration_pts);
1142 int nb_base_functions = data.
getN().size2();
1148 auto get_ftensor1 = [](
auto &
v) {
1154 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1159 t_omega_grad_intermediate(
k,
j) =
1160 t_omega_grad(
k,
i) * t_invPlasticF(
i,
j);
1162 t_omega_grad_dot_intermediate(
k,
j) =
1163 t_omega_grad_dot(
k,
i) * t_invPlasticF(
i,
j);
1165 double a =
v * t_w * det_plasticF;
1166 auto t_nf = get_ftensor1(
nF);
1168 for (; bb != nb_dofs / 3; ++bb) {
1169 t_nf(
k) -= (
a * t_row_base_fun) * t_levi_kirchhoff(
k);
1170 t_nf(
k) += (
a *
alphaR) * (t_row_base_fun * t_omega(
k));
1172 t_row_grad_intermediate(
j) =
1173 t_row_grad_fun(
i) * t_invPlasticF(
i,
j);
1175 (t_row_grad_intermediate(
j) *
1176 t_omega_grad_intermediate(
k,
j));
1178 (t_row_base_fun * t_omega_dot(
k));
1180 (t_row_grad_intermediate(
j) *
1181 t_omega_grad_dot_intermediate(
k,
j));
1186 for (; bb != nb_base_functions; ++bb) {
1205 int nb_integration_pts = data.
getN().size1();
1209 int nb_base_functions = data.
getN().size2() / 3;
1217 auto get_ftensor1 = [](
auto &
v) {
1222 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1223 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
1224 auto t_invPlasticF =
dataAtPts->getFTensorInvPlasticF(nb_integration_pts);
1226 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1228 double a =
v * t_w * det_plasticF;
1229 auto t_nf = get_ftensor1(
nF);
1232 t_residuum(
i,
j) = t_h(
i,
j) - t_invPlasticF(
i,
j);
1235 for (; bb != nb_dofs / 3; ++bb) {
1237 t_row_base_piola(
j) =
1238 t_plasticF(
j,
k) * t_row_base_fun(
k) / det_plasticF;
1239 t_nf(
i) -=
a * t_row_base_piola(
j) * t_residuum(
i,
j);
1244 for (; bb != nb_base_functions; ++bb)
1259 int nb_integration_pts = data.
getN().size1();
1263 int nb_base_functions = data.
getN().size2() / 9;
1271 auto get_ftensor0 = [](
auto &
v) {
1275 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1276 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
1277 auto t_invPlasticF =
dataAtPts->getFTensorInvPlasticF(nb_integration_pts);
1279 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1281 double a =
v * t_w * det_plasticF;
1282 auto t_nf = get_ftensor0(
nF);
1285 t_residuum(
i,
j) = t_h(
i,
j) - t_invPlasticF(
i,
j);
1288 for (; bb != nb_dofs; ++bb) {
1290 t_row_base_piola(
i,
j) =
1291 t_row_base_fun(
i,
k) * t_plasticF(
j,
k) / det_plasticF;
1292 t_nf -=
a * t_row_base_piola(
i,
j) * t_residuum(
i,
j);
1296 for (; bb != nb_base_functions; ++bb) {
1311 int nb_integration_pts = data.
getN().size1();
1314 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1315 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
1316 auto t_invPlasticF =
dataAtPts->getFTensorInvPlasticF(nb_integration_pts);
1317 int nb_base_functions = data.
getN().size2() / 3;
1322 auto get_ftensor1 = [](
auto &
v) {
1327 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1329 double a =
v * t_w * det_plasticF;
1330 auto t_nf = get_ftensor1(
nF);
1332 for (; bb != nb_dofs / 3; ++bb) {
1333 const double div_row_base =
1334 (t_plasticF(
i,
j) * t_row_diff_base_fun(
j,
k) *
1335 t_invPlasticF(
k,
i)) /
1337 t_nf(
i) -=
a * div_row_base * t_w_l2(
i);
1339 ++t_row_diff_base_fun;
1341 for (; bb != nb_base_functions; ++bb) {
1342 ++t_row_diff_base_fun;
1358 int nb_integration_pts = getGaussPts().size2();
1361 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1363 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1364 if (tag_length != 9) {
1366 "Number of internal stress components should be 9 but is %d",
1371 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1372 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(
1373 tag, &fe_ent, 1, &*const_stress_vec.data().begin());
1374 auto t_const_stress = getFTensor1FromArray<9, 9>(const_stress_vec);
1376 auto get_internal_stress =
1378 dataAtPts->internalStressAtPts, nb_integration_pts);
1380 auto t_internal_stress = get_internal_stress();
1383 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1384 t_internal_stress(
L) = t_const_stress(
L);
1385 ++t_internal_stress;
1396 int nb_integration_pts = getGaussPts().size2();
1399 CHKERR getPtrFE() -> mField.get_moab().tag_get_handle(tagName.c_str(), tag);
1401 CHKERR getPtrFE() -> mField.get_moab().tag_get_length(tag, tag_length);
1402 if (tag_length != 9) {
1404 "Number of internal stress components should be 9 but is %d",
1408 auto fe_ent = getNumeredEntFiniteElementPtr()->getEnt();
1409 const EntityHandle *vert_conn;
1411 CHKERR getPtrFE() -> mField.get_moab().get_connectivity(fe_ent, vert_conn,
1414 CHKERR getPtrFE() -> mField.get_moab().tag_get_data(tag, vert_conn, vert_num,
1417 auto get_internal_stress =
1419 dataAtPts->internalStressAtPts, nb_integration_pts);
1421 auto t_internal_stress = get_internal_stress();
1426 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1427 auto t_vert_data = getFTensor1FromArray<9, 9>(vert_data);
1428 for (
int bb = 0; bb != nb_shape_fn; ++bb) {
1429 t_internal_stress(
L) += t_vert_data(
L) * t_shape_n;
1433 ++t_internal_stress;
1445 int nb_integration_pts = data.
getN().size1();
1446 auto v = getVolume();
1447 auto t_w = getFTensor0IntegrationWeight();
1452 auto get_ftensor2 = [](
auto &
v) {
1454 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
1457 auto t_internal_stress =
1458 dataAtPts->getFTensorInternalStress(nb_integration_pts);
1462 : getFEMethod()->ts_t;
1465 double scale = scalingMethodPtr->getScale(time);
1468 auto t_L = FTensor::SymmLTensor<double, 3>();
1470 int nb_base_functions = data.
getN().size2();
1472 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1474 auto t_nf = get_ftensor2(nF);
1477 t_symm_stress(
i,
j) =
1478 (t_internal_stress(
i,
j) + t_internal_stress(
j,
i)) / 2;
1481 t_residual(
L) = t_L(
i,
j,
L) * (
scale * t_symm_stress(
i,
j));
1484 for (; bb != nb_dofs / 6; ++bb) {
1485 t_nf(
L) +=
a * t_row_base_fun * t_residual(
L);
1489 for (; bb != nb_base_functions; ++bb)
1493 ++t_internal_stress;
1503 int nb_integration_pts = data.
getN().size1();
1504 auto v = getVolume();
1505 auto t_w = getFTensor0IntegrationWeight();
1507 auto get_ftensor2 = [](
auto &
v) {
1509 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
1512 auto t_internal_stress =
1513 dataAtPts->getFTensorInternalStressVec(nb_integration_pts);
1518 t_L = voigt_to_symm();
1522 : getFEMethod()->ts_t;
1525 double scale = scalingMethodPtr->getScale(time);
1527 int nb_base_functions = data.
getN().size2();
1529 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1531 auto t_nf = get_ftensor2(nF);
1534 t_residual(
L) = t_L(M,
L) * (
scale * t_internal_stress(M));
1537 for (; bb != nb_dofs / 6; ++bb) {
1538 t_nf(
L) +=
a * t_row_base_fun * t_residual(
L);
1542 for (; bb != nb_base_functions; ++bb)
1546 ++t_internal_stress;
1551template <AssemblyType A>
1555 EntityHandle fe_ent = OP::getFEEntityHandle();
1557 for (
auto &bc : (*bcDispPtr)) {
1559 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1562 int nb_integration_pts = OP::getGaussPts().size2();
1563 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1564 auto t_w = OP::getFTensor0IntegrationWeight();
1565 int nb_base_functions = data.
getN().size2() / 3;
1572 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1574 scale *= scalingMethodsMap.at(bc.blockName)
1577 scale *= scalingMethodsMap.at(bc.blockName)
1578 ->getScale(OP::getFEMethod()->ts_t);
1582 <<
"No scaling method found for " << bc.blockName;
1589 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1590 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
1592 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1594 t_w * (t_row_base_fun(
j) * t_normal(
j)) * t_bc_disp(
i) * 0.5;
1598 for (; bb != nb_base_functions; ++bb)
1610 return OP::iNtegrate(data);
1616 EntityHandle fe_ent = OP::getFEEntityHandle();
1618 for (
auto &bc : (*bcDispPtr)) {
1620 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1623 int nb_integration_pts = OP::getGaussPts().size2();
1624 auto t_w = OP::getFTensor0IntegrationWeight();
1625 int nb_base_functions = data.
getN().size2();
1628 if (!this->sourceVec) {
1630 "Source vector for OpTauStabilizationDispRhsBc is not set");
1632 if (data.
getN().size1() != nb_integration_pts) {
1634 "Number of integration points in data should be %d but is %d",
1635 nb_integration_pts, (
int)data.
getN().size1());
1637 if (nb_base_functions < nb_dofs /
SPACE_DIM) {
1639 "Number of base functions in data should be %d but is %d",
1647 *this->sourceVec, nb_integration_pts)();
1659 ->getScale(OP::getFEMethod()->ts_t);
1663 <<
"No scaling method found for " << bc.blockName;
1670 auto area = getMeasure();
1671 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
1672 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1674 area * t_w * OP::betaCoeff(t_coords(0), t_coords(1), t_coords(2));
1678 bc.flags[ii] ? t_disp_val(ii) - t_bc_disp(ii) : 0.;
1679 auto t_nf = getFTensor1FromPtr<3, 3>(OP::locF.data().data());
1681 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1683 (tau_scale * t_row_base_fun) * t_bc_residual(
i);
1687 for (; bb != nb_base_functions; ++bb)
1704 EntityHandle fe_ent = OP::getFEEntityHandle();
1706 for (
auto &bc : (*bcDispPtr)) {
1708 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1711 int nb_integration_pts = OP::getGaussPts().size2();
1712 auto t_w = OP::getFTensor0IntegrationWeight();
1713 int nb_base_functions = row_data.
getN().size2();
1721 t_bc_mask(ii) = bc.flags[ii] ? 1. : 0.;
1723 auto get_t_vec = [&](
const int rr) {
1724 std::array<double *, SPACE_DIM> ptrs;
1726 ptrs[
i] = &OP::locMat(rr +
i,
i);
1731 auto area = getMeasure();
1732 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
1733 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1735 area * t_w * OP::betaCoeff(t_coords(0), t_coords(1), t_coords(2));
1737 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1740 for (
int cc = 0; cc != nb_dofs /
SPACE_DIM; ++cc) {
1742 tau_scale * (t_row_base_fun * t_col_base_fun) * t_bc_mask(
i);
1748 for (; rr != nb_base_functions; ++rr)
1763 EntityHandle fe_ent = OP::getFEEntityHandle();
1764 for (
auto &bc : (*bcDispPtr)) {
1765 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1767 auto analytical_data = getAnalyticalExpr(
this,
analytical_expr, bc.blockName);
1768 auto &v_analytical_expr = std::get<1>(analytical_data);
1771 int nb_integration_pts = OP::getGaussPts().size2();
1772 auto t_w = OP::getFTensor0IntegrationWeight();
1773 int nb_base_functions = data.
getN().size2();
1777 if (!this->sourceVec) {
1779 "Source vector for OpTauStabilizationOpAnalyticalDispBc is not "
1782 if (data.
getN().size1() != nb_integration_pts) {
1784 "Number of integration points in data should be %d but is %d",
1785 nb_integration_pts, (
int)data.
getN().size1());
1787 if (nb_base_functions < nb_dofs /
SPACE_DIM) {
1789 "Number of base functions in data should be at least %d but is "
1791 nb_dofs /
SPACE_DIM, nb_base_functions);
1797 *this->sourceVec, nb_integration_pts)();
1802 auto area = getMeasure();
1803 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
1804 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1806 area * t_w * OP::betaCoeff(t_coords(0), t_coords(1), t_coords(2));
1810 bc.flags[ii] ? t_disp_val(ii) - t_bc_disp(ii) : 0.;
1811 auto t_nf = getFTensor1FromPtr<3, 3>(OP::locF.data().data());
1813 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1815 (tau_scale * t_row_base_fun) * t_bc_residual(
i);
1819 for (; bb != nb_base_functions; ++bb)
1837 EntityHandle fe_ent = OP::getFEEntityHandle();
1838 for (
auto &bc : (*bcDispPtr)) {
1839 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1841 int nb_integration_pts = OP::getGaussPts().size2();
1842 auto t_w = OP::getFTensor0IntegrationWeight();
1843 int nb_base_functions = row_data.
getN().size2();
1849 t_bc_mask(ii) = bc.flags[ii] ? 1. : 0.;
1851 auto get_t_vec = [&](
const int rr) {
1852 std::array<double *, SPACE_DIM> ptrs;
1854 ptrs[
i] = &OP::locMat(rr +
i,
i);
1859 auto area = getMeasure();
1860 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
1861 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1863 area * t_w * OP::betaCoeff(t_coords(0), t_coords(1), t_coords(2));
1865 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1868 for (
int cc = 0; cc != nb_dofs /
SPACE_DIM; ++cc) {
1870 tau_scale * (t_row_base_fun * t_col_base_fun) * t_bc_mask(
i);
1876 for (; rr != nb_base_functions; ++rr)
1888template <AssemblyType A>
1896 double time = OP::getFEMethod()->ts_t;
1902 EntityHandle fe_ent = OP::getFEEntityHandle();
1904 for (
auto &bc : (*bcRotPtr)) {
1906 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1908 int nb_integration_pts = OP::getGaussPts().size2();
1909 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1910 auto t_w = OP::getFTensor0IntegrationWeight();
1912 int nb_base_functions = data.
getN().size2() / 3;
1923 auto get_rotation_angle = [&]() {
1924 double theta = bc.theta;
1925 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
1926 theta *= scalingMethodsMap.at(bc.blockName)->getScale(time);
1931 auto get_rotation = [&](
auto theta) {
1933 if (bc.vals.size() == 7) {
1934 t_omega(0) = bc.vals[4];
1935 t_omega(1) = bc.vals[5];
1936 t_omega(2) = bc.vals[6];
1939 t_omega(
i) = OP::getFTensor1Normal()(
i);
1941 if (t_omega.
l2() > std::numeric_limits<double>::epsilon()) {
1945 <<
"Rotation axis is zero vector for block " << bc.blockName
1946 <<
". This may lead to unexpected results.";
1948 t_omega(
i) *= theta;
1950 RotSelector::SMALL_ROT
1955 auto t_R = get_rotation(get_rotation_angle());
1956 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
1958 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1960 t_delta(
i) = t_center(
i) - t_coords(
i);
1962 t_disp(
i) = t_delta(
i) - t_R(
i,
j) * t_delta(
j);
1964 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
1966 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1967 t_nf(
i) += t_w * (t_row_base_fun(
j) * t_normal(
j)) * t_disp(
i) * 0.5;
1971 for (; bb != nb_base_functions; ++bb)
1984 return OP::iNtegrate(data);
1993 double time = OP::getFEMethod()->ts_t;
1999 EntityHandle fe_ent = OP::getFEEntityHandle();
2001 for (
auto &bc : (*bcRotPtr)) {
2003 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2005 int nb_integration_pts = OP::getGaussPts().size2();
2006 auto t_w = OP::getFTensor0IntegrationWeight();
2008 int nb_base_functions = data.
getN().size2();
2019 auto get_rotation_angle = [&]() {
2020 double theta = bc.theta;
2027 auto get_rotation = [&](
auto theta) {
2029 if (bc.vals.size() == 7) {
2030 t_omega(0) = bc.vals[4];
2031 t_omega(1) = bc.vals[5];
2032 t_omega(2) = bc.vals[6];
2035 t_omega(
i) = OP::getFTensor1Normal()(
i);
2037 if (t_omega.
l2() > std::numeric_limits<double>::epsilon()) {
2040 t_omega(
i) *= theta;
2042 RotSelector::SMALL_ROT
2047 auto area = getMeasure();
2048 auto t_R = get_rotation(get_rotation_angle());
2049 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
2052 *this->sourceVec, nb_integration_pts)();
2054 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2056 area * t_w * OP::betaCoeff(t_coords(0), t_coords(1), t_coords(2));
2059 t_delta(
i) = t_center(
i) - t_coords(
i);
2061 t_bc_disp(
i) = t_delta(
i) - t_R(
i,
j) * t_delta(
j);
2063 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
2065 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2067 (tau_scale * t_row_base_fun) * (t_disp_val(
i) - t_bc_disp(
i));
2071 for (; bb != nb_base_functions; ++bb)
2088 EntityHandle fe_ent = OP::getFEEntityHandle();
2090 for (
auto &bc : (*bcRotPtr)) {
2092 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2095 int nb_integration_pts = OP::getGaussPts().size2();
2096 auto t_w = OP::getFTensor0IntegrationWeight();
2097 int nb_base_functions = row_data.
getN().size2();
2103 auto get_t_vec = [&](
const int rr) {
2104 std::array<double *, SPACE_DIM> ptrs;
2106 ptrs[
i] = &OP::locMat(rr +
i,
i);
2111 auto area = getMeasure();
2112 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
2113 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2115 area * t_w * OP::betaCoeff(t_coords(0), t_coords(1), t_coords(2));
2117 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2120 for (
int cc = 0; cc != nb_dofs /
SPACE_DIM; ++cc) {
2121 for (
int ii = 0; ii !=
SPACE_DIM; ++ii) {
2122 t_mat(ii) += tau_scale * (t_row_base_fun * t_col_base_fun);
2129 for (; rr != nb_base_functions; ++rr)
2141template <AssemblyType A>
2145 double time = OP::getFEMethod()->ts_t;
2151 EntityHandle fe_ent = OP::getFEEntityHandle();
2153 for (
auto &bc : (*bcDispPtr)) {
2155 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2157 for (
auto &bd : (*brokenBaseSideDataPtr)) {
2161 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
2162 auto t_w = OP::getFTensor0IntegrationWeight();
2170 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2171 scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2174 <<
"No scaling method found for " << bc.blockName;
2178 double val =
scale * bc.val;
2181 int nb_integration_pts = OP::getGaussPts().size2();
2182 int nb_base_functions = data.
getN().size2();
2184 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2187 t_N(
i) = t_normal(
i);
2191 t_P(
i,
j) = t_N(
i) * t_N(
j);
2196 t_traction(
i) = t_approx_P(
i,
j) * t_N(
j);
2200 t_Q(
i,
j) * t_traction(
j) + t_P(
i,
j) * 2 * t_u(
j) - t_N(
i) * val;
2202 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
2204 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2205 t_nf(
i) += (t_w * t_row_base * OP::getMeasure()) * t_res(
i);
2209 for (; bb != nb_base_functions; ++bb)
2223template <AssemblyType A>
2229 double time = OP::getFEMethod()->ts_t;
2234 int row_nb_dofs = row_data.
getIndices().size();
2235 int col_nb_dofs = col_data.
getIndices().size();
2236 auto &locMat = OP::locMat;
2237 locMat.resize(row_nb_dofs, col_nb_dofs,
false);
2241 EntityHandle fe_ent = OP::getFEEntityHandle();
2243 for (
auto &bc : (*bcDispPtr)) {
2245 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2247 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
2248 auto t_w = OP::getFTensor0IntegrationWeight();
2254 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2255 scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2258 <<
"No scaling method found for " << bc.blockName;
2261 int nb_integration_pts = OP::getGaussPts().size2();
2262 int row_nb_dofs = row_data.
getIndices().size();
2263 int col_nb_dofs = col_data.
getIndices().size();
2264 int nb_base_functions = row_data.
getN().size2();
2267 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2270 t_N(
i) = t_normal(
i);
2274 t_P(
i,
j) = t_N(
i) * t_N(
j);
2277 t_d_res(
i,
j) = 2.0 * t_P(
i,
j);
2280 for (; rr != row_nb_dofs /
SPACE_DIM; ++rr) {
2281 auto t_mat = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
2284 for (
auto cc = 0; cc != col_nb_dofs /
SPACE_DIM; ++cc) {
2285 t_mat(
i,
j) += (t_w * t_row_base * t_col_base) * t_d_res(
i,
j);
2292 for (; rr != nb_base_functions; ++rr)
2299 locMat *= OP::getMeasure();
2305template <AssemblyType A>
2311 double time = OP::getFEMethod()->ts_t;
2316 int row_nb_dofs = row_data.
getIndices().size();
2317 int col_nb_dofs = col_data.
getIndices().size();
2318 auto &locMat = OP::locMat;
2319 locMat.resize(row_nb_dofs, col_nb_dofs,
false);
2323 EntityHandle fe_ent = OP::getFEEntityHandle();
2325 for (
auto &bc : (*bcDispPtr)) {
2327 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2329 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
2330 auto t_w = OP::getFTensor0IntegrationWeight();
2339 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2340 scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2343 <<
"No scaling method found for " << bc.blockName;
2346 int nb_integration_pts = OP::getGaussPts().size2();
2347 int nb_base_functions = row_data.
getN().size2();
2350 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2353 t_N(
i) = t_normal(
i);
2357 t_P(
i,
j) = t_N(
i) * t_N(
j);
2362 t_d_res(
i,
j) = t_Q(
i,
j);
2365 for (; rr != row_nb_dofs /
SPACE_DIM; ++rr) {
2366 auto t_mat = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
2369 for (
auto cc = 0; cc != col_nb_dofs /
SPACE_DIM; ++cc) {
2371 ((t_w * t_row_base) * (t_N(
k) * t_col_base(
k))) * t_d_res(
i,
j);
2378 for (; rr != nb_base_functions; ++rr)
2385 locMat *= OP::getMeasure();
2392 return OP::iNtegrate(data);
2409 EntityHandle fe_ent = OP::getFEEntityHandle();
2411 for (
auto &bc : (*bcSpringPtr)) {
2413 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2415 for (
auto &bd : (*brokenBaseSideDataPtr)) {
2419 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
2420 auto t_w = OP::getFTensor0IntegrationWeight();
2428 int nb_integration_pts = OP::getGaussPts().size2();
2429 int nb_base_functions = data.
getN().size2();
2431 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2434 t_N(
i) = t_normal(
i);
2438 t_P(
i,
j) = t_N(
i) * t_N(
j);
2443 t_traction(
i) = t_approx_P(
i,
j) * t_N(
j);
2446 t_res(
i) = 0.5 *(t_traction(
i)) - bc.normalStiffness * t_P(
i,
j) * t_u(
j) -
2447 bc.tangentialStiffness * t_Q(
i,
j) * t_u(
j);
2449 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
2451 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2452 t_nf(
i) += (t_w * t_row_base * OP::getMeasure()) * t_res(
i);
2456 for (; bb != nb_base_functions; ++bb)
2474 int row_nb_dofs = row_data.
getIndices().size();
2475 int col_nb_dofs = col_data.
getIndices().size();
2476 auto &locMat = OP::locMat;
2477 locMat.resize(row_nb_dofs, col_nb_dofs,
false);
2481 EntityHandle fe_ent = OP::getFEEntityHandle();
2483 for (
auto &bc : (*bcSpringPtr)) {
2485 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2487 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
2488 auto t_w = OP::getFTensor0IntegrationWeight();
2493 int nb_integration_pts = OP::getGaussPts().size2();
2494 int nb_base_functions = row_data.
getN().size2();
2499 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2502 t_N(
i) = t_normal(
i);
2506 t_P(
i,
j) = t_N(
i) * t_N(
j);
2511 t_d_res(
i,
j) = -(bc.normalStiffness * t_P(
i,
j) +
2512 bc.tangentialStiffness * t_Q(
i,
j));
2515 for (; rr != row_nb_dofs /
SPACE_DIM; ++rr) {
2516 auto t_mat = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
2519 for (
auto cc = 0; cc != col_nb_dofs /
SPACE_DIM; ++cc) {
2520 t_mat(
i,
j) += (t_w * t_row_base * t_col_base) * t_d_res(
i,
j);
2527 for (; rr != nb_base_functions; ++rr)
2534 locMat *= OP::getMeasure();
2544 int row_nb_dofs = row_data.
getIndices().size();
2545 int col_nb_dofs = col_data.
getIndices().size();
2546 auto &locMat = OP::locMat;
2547 locMat.resize(row_nb_dofs, col_nb_dofs,
false);
2551 EntityHandle fe_ent = OP::getFEEntityHandle();
2553 for (
auto &bc : (*bcSpringPtr)) {
2555 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2557 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
2558 auto t_w = OP::getFTensor0IntegrationWeight();
2564 int nb_integration_pts = OP::getGaussPts().size2();
2565 int nb_base_functions = row_data.
getN().size2();
2570 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2573 t_N(
i) = t_normal(
i);
2577 for (; rr != row_nb_dofs /
SPACE_DIM; ++rr) {
2578 auto t_mat = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
2581 for (
auto cc = 0; cc != col_nb_dofs /
SPACE_DIM; ++cc) {
2583 ((t_w * t_row_base) * (t_N(
k) * t_col_base(
k))) * 0.5 *
t_kd(
i,
j);
2590 for (; rr != nb_base_functions; ++rr)
2597 locMat *= OP::getMeasure();
2603template <AssemblyType A>
2607 double time = OP::getFEMethod()->ts_t;
2613 EntityHandle fe_ent = OP::getFEEntityHandle();
2615 for (
auto &bc : (*bcDispPtr)) {
2617 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2622 auto [block_name, v_analytical_expr] =
2630 int nb_integration_pts = OP::getGaussPts().size2();
2631 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
2632 auto t_w = OP::getFTensor0IntegrationWeight();
2633 int nb_base_functions = data.
getN().size2() / 3;
2642 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2643 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
2646 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2648 t_w * (t_row_base_fun(
j) * t_normal(
j)) * t_bc_disp(
i) * 0.5;
2652 for (; bb != nb_base_functions; ++bb)
2665 return OP::iNtegrate(data);
2674 int nb_integration_pts = getGaussPts().size2();
2675 int nb_base_functions = data.
getN().size2();
2677 double time = getFEMethod()->ts_t;
2683 if (this->locF.size() != nb_dofs)
2685 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2688 auto integrate_rhs = [&](
auto &bc,
auto calc_tau,
double time_scale) {
2691 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
2693 auto t_w = getFTensor0IntegrationWeight();
2694 auto t_coords = getFTensor1CoordsAtGaussPts();
2695 auto t_normal = getFTensor1NormalsAtGaussPts();
2699 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2701 double a = sqrt(t_normal(
i) * t_normal(
i));
2703 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2704 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2706 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2708 (time_scale *
a * t_w * t_row_base * tau) * (t_val(
i) *
scale);
2713 for (; rr != nb_base_functions; ++rr)
2723 EntityHandle fe_ent = getFEEntityHandle();
2724 for (
auto &bc : *(
bcData)) {
2725 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2727 double time_scale = 1;
2735 if (std::regex_match(bc.blockName, std::regex(
".*COOK.*"))) {
2739 return -y * (y - 1) / 0.25;
2741 CHKERR integrate_rhs(bc, calc_tau, time_scale);
2744 bc, [](
double,
double,
double) {
return 1; }, time_scale);
2758 int nb_integration_pts = getGaussPts().size2();
2759 int nb_base_functions = data.
getN().size2();
2761 double time = getFEMethod()->ts_t;
2767 if (this->locF.size() != nb_dofs)
2769 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2772 auto integrate_rhs = [&](
auto &bc,
auto calc_tau,
double time_scale) {
2777 auto t_w = getFTensor0IntegrationWeight();
2778 auto t_coords = getFTensor1CoordsAtGaussPts();
2779 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
2780 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
2786 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2798 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) * t_tangent1(
j)) *
2801 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) *
2802 (t_tangent1(
j) + t_grad_gamma_u(
j, N0))) *
2803 (t_tangent2(
k) + t_grad_gamma_u(
k, N1));
2805 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2807 t_val(
i) = (time_scale * t_w * tau *
scale * val) * t_normal(
i);
2809 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2811 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2812 t_f(
i) += t_row_base * t_val(
i);
2817 for (; rr != nb_base_functions; ++rr)
2831 EntityHandle fe_ent = getFEEntityHandle();
2832 for (
auto &bc : *(
bcData)) {
2833 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2835 double time_scale = 1;
2843 bc, [](
double,
double,
double) {
return 1; }, time_scale);
2850template <AssemblyType A>
2861 double time = OP::getFEMethod()->ts_t;
2866 int nb_base_functions = row_data.
getN().size2();
2867 int row_nb_dofs = row_data.
getIndices().size();
2868 int col_nb_dofs = col_data.
getIndices().size();
2869 int nb_integration_pts = OP::getGaussPts().size2();
2870 auto &locMat = OP::locMat;
2871 locMat.resize(row_nb_dofs, col_nb_dofs,
false);
2874 auto integrate_lhs = [&](
auto &bc,
auto calc_tau,
double time_scale) {
2879 auto t_w = OP::getFTensor0IntegrationWeight();
2880 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
2881 auto t_tangent1 = OP::getFTensor1Tangent1AtGaussPts();
2882 auto t_tangent2 = OP::getFTensor1Tangent2AtGaussPts();
2887 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2897 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2898 auto t_val = time_scale * t_w * tau * val;
2901 for (; rr != row_nb_dofs /
SPACE_DIM; ++rr) {
2902 auto t_mat = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
2905 for (
auto cc = 0; cc != col_nb_dofs /
SPACE_DIM; ++cc) {
2907 t_normal_du(
i,
l) = (FTensor::levi_civita<double>(
i,
j,
k) *
2908 (t_tangent2(
k) + t_grad_gamma_u(
k, N1))) *
2909 t_kd(
j,
l) * t_diff_col_base(N0)
2913 (FTensor::levi_civita<double>(
i,
j,
k) *
2914 (t_tangent1(
j) + t_grad_gamma_u(
j, N0))) *
2915 t_kd(
k,
l) * t_diff_col_base(N1);
2917 t_mat(
i,
j) += t_row_base * t_val * t_normal_du(
i,
j);
2924 for (; rr != nb_base_functions; ++rr)
2939 EntityHandle fe_ent = OP::getFEEntityHandle();
2940 for (
auto &bc : *(bcData)) {
2941 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2943 double time_scale = 1;
2944 if (scalingMethodsMap.find(bc.blockName) != scalingMethodsMap.end()) {
2945 time_scale *= scalingMethodsMap.at(bc.blockName)->getScale(time);
2951 bc, [](
double,
double,
double) {
return 1; }, time_scale);
2970 int nb_integration_pts = getGaussPts().size2();
2971 int nb_base_functions = data.
getN().size2();
2973 double time = getFEMethod()->ts_t;
2979 if (this->locF.size() != nb_dofs)
2981 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2985 EntityHandle fe_ent = getFEEntityHandle();
2986 for (
auto &bc : *(
bcData)) {
2987 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2991 auto [block_name, v_analytical_expr] =
2995 auto t_w = getFTensor0IntegrationWeight();
2996 auto t_coords = getFTensor1CoordsAtGaussPts();
3000 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3002 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
3004 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
3005 t_f(
i) -= t_w * t_row_base * (t_val(
i) *
scale);
3010 for (; rr != nb_base_functions; ++rr)
3016 this->locF *= getMeasure();
3025 int nb_integration_pts = row_data.
getN().size1();
3026 int row_nb_dofs = row_data.
getIndices().size();
3027 int col_nb_dofs = col_data.
getIndices().size();
3028 auto get_ftensor1 = [](
MatrixDouble &
m,
const int r,
const int c) {
3030 &
m(r + 0,
c + 0), &
m(r + 1,
c + 1), &
m(r + 2,
c + 2));
3035 int row_nb_base_functions = row_data.
getN().size2();
3037 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3040 for (; rr != row_nb_dofs / 3; ++rr) {
3042 auto t_m = get_ftensor1(
K, 3 * rr, 0);
3043 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3044 double div_col_base = t_col_diff_base_fun(
i,
i);
3045 t_m(
i) -=
a * t_row_base_fun * div_col_base;
3047 ++t_col_diff_base_fun;
3051 for (; rr != row_nb_base_functions; ++rr)
3062 if (
alphaW < std::numeric_limits<double>::epsilon() &&
3063 alphaRho < std::numeric_limits<double>::epsilon())
3066 const int nb_integration_pts = row_data.
getN().size1();
3067 const int row_nb_dofs = row_data.
getIndices().size();
3068 auto get_ftensor1 = [](
MatrixDouble &
m,
const int r,
const int c) {
3070 &
m(r + 0,
c + 0), &
m(r + 1,
c + 1), &
m(r + 2,
c + 2)
3079 auto piola_scale =
dataAtPts->piolaScale;
3080 auto alpha_w =
alphaW / piola_scale;
3081 auto alpha_rho =
alphaRho / piola_scale;
3083 int row_nb_base_functions = row_data.
getN().size2();
3086 double ts_scale = alpha_w *
getTSa();
3087 if (std::abs(
alphaRho) > std::numeric_limits<double>::epsilon())
3088 ts_scale += alpha_rho *
getTSaa();
3090 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3091 double a =
v * t_w * ts_scale;
3094 for (; rr != row_nb_dofs / 3; ++rr) {
3097 auto t_m = get_ftensor1(
K, 3 * rr, 0);
3098 for (
int cc = 0; cc != row_nb_dofs / 3; ++cc) {
3099 const double b =
a * t_row_base_fun * t_col_base_fun;
3108 for (; rr != row_nb_base_functions; ++rr)
3127 int nb_integration_pts = row_data.
getN().size1();
3128 int row_nb_dofs = row_data.
getIndices().size();
3129 int col_nb_dofs = col_data.
getIndices().size();
3130 auto get_ftensor3 = [](
MatrixDouble &
m,
const int r,
const int c) {
3133 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2),
3135 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2),
3137 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2),
3139 &
m(r + 3,
c + 0), &
m(r + 3,
c + 1), &
m(r + 3,
c + 2),
3141 &
m(r + 4,
c + 0), &
m(r + 4,
c + 1), &
m(r + 4,
c + 2),
3143 &
m(r + 5,
c + 0), &
m(r + 5,
c + 1), &
m(r + 5,
c + 2));
3149 int row_nb_base_functions = row_data.
getN().size2();
3152 auto t_approx_P_adjoint_log_du_dP =
3153 dataAtPts->getFTensorAdjointPdUdP(nb_integration_pts);
3154 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3156 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3158 double a =
v * t_w * det_plasticF;
3160 for (; rr != row_nb_dofs / 6; ++rr) {
3163 auto t_m = get_ftensor3(
K, 6 * rr, 0);
3165 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3167 t_col_base_piola(
j) =
3168 t_plasticF(
j,
k) * t_col_base_fun(
k) / det_plasticF;
3170 a * (t_approx_P_adjoint_log_du_dP(
i,
j,
L) *
3171 t_col_base_piola(
j)) *
3179 for (; rr != row_nb_base_functions; ++rr)
3182 ++t_approx_P_adjoint_log_du_dP;
3199 int nb_integration_pts = row_data.
getN().size1();
3200 int row_nb_dofs = row_data.
getIndices().size();
3201 int col_nb_dofs = col_data.
getIndices().size();
3202 auto get_ftensor2 = [](
MatrixDouble &
m,
const int r,
const int c) {
3204 &
m(r + 0,
c), &
m(r + 1,
c), &
m(r + 2,
c), &
m(r + 3,
c), &
m(r + 4,
c),
3212 int row_nb_base_functions = row_data.
getN().size2();
3214 auto t_approx_P_adjoint_log_du_dP =
3215 dataAtPts->getFTensorAdjointPdUdP(nb_integration_pts);
3216 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3218 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3220 double a =
v * t_w * det_plasticF;
3222 for (; rr != row_nb_dofs / 6; ++rr) {
3223 auto t_m = get_ftensor2(
K, 6 * rr, 0);
3224 auto t_col_base_fun = col_data.
getFTensor2N<3, 3>(gg, 0);
3225 for (
int cc = 0; cc != col_nb_dofs; ++cc) {
3227 t_col_base_piola(
i,
j) =
3228 t_col_base_fun(
i,
k) * t_plasticF(
j,
k) / det_plasticF;
3230 a * (t_approx_P_adjoint_log_du_dP(
i,
j,
L) *
3231 t_col_base_piola(
i,
j)) *
3238 for (; rr != row_nb_base_functions; ++rr)
3241 ++t_approx_P_adjoint_log_du_dP;
3254 int row_nb_dofs = row_data.
getIndices().size();
3255 int col_nb_dofs = col_data.
getIndices().size();
3256 auto get_ftensor3 = [](
MatrixDouble &
m,
const int r,
const int c) {
3259 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2),
3261 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2),
3263 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2),
3265 &
m(r + 3,
c + 0), &
m(r + 3,
c + 1), &
m(r + 3,
c + 2),
3267 &
m(r + 4,
c + 0), &
m(r + 4,
c + 1), &
m(r + 4,
c + 2),
3269 &
m(r + 5,
c + 0), &
m(r + 5,
c + 1), &
m(r + 5,
c + 2)
3281 auto t_approx_P_adjoint_log_du_domega =
3282 dataAtPts->getFTensorAdjointPdUdOmega(nb_integration_pts);
3283 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3285 int row_nb_base_functions = row_data.
getN().size2();
3288 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3290 double a =
v * t_w * det_plasticF;
3293 for (; rr != row_nb_dofs / 6; ++rr) {
3295 auto t_m = get_ftensor3(
K, 6 * rr, 0);
3296 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3297 double v =
a * t_row_base_fun * t_col_base_fun;
3298 t_m(
L,
k) -=
v * t_approx_P_adjoint_log_du_domega(
k,
L);
3305 for (; rr != row_nb_base_functions; ++rr)
3309 ++t_approx_P_adjoint_log_du_domega;
3320 int row_nb_dofs = row_data.
getIndices().size();
3321 int col_nb_dofs = col_data.
getIndices().size();
3322 auto get_ftensor2 = [](
MatrixDouble &
m,
const int r,
const int c) {
3326 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2), &
m(r + 0,
c + 3),
3327 &
m(r + 0,
c + 4), &
m(r + 0,
c + 5),
3329 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2), &
m(r + 1,
c + 3),
3330 &
m(r + 1,
c + 4), &
m(r + 1,
c + 5),
3332 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2), &
m(r + 2,
c + 3),
3333 &
m(r + 2,
c + 4), &
m(r + 2,
c + 5)
3343 auto t_levi_kirchhoff_du =
3344 dataAtPts->getFTensorLeviKirchhoffdLogStretch(nb_integration_pts);
3345 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3346 int row_nb_base_functions = row_data.
getN().size2();
3348 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3350 double a =
v * t_w * det_plasticF;
3352 for (; rr != row_nb_dofs / 3; ++rr) {
3353 auto t_m = get_ftensor2(
K, 3 * rr, 0);
3354 const double b =
a * t_row_base_fun;
3356 for (
int cc = 0; cc != col_nb_dofs /
size_symm; ++cc) {
3357 t_m(
k,
L) -= (b * t_col_base_fun) * t_levi_kirchhoff_du(
k,
L);
3363 for (; rr != row_nb_base_functions; ++rr) {
3367 ++t_levi_kirchhoff_du;
3385 int row_nb_dofs = row_data.
getIndices().size();
3386 int col_nb_dofs = col_data.
getIndices().size();
3387 auto get_ftensor2 = [](
MatrixDouble &
m,
const int r,
const int c) {
3390 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2),
3392 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2),
3394 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2)
3402 int row_nb_base_functions = row_data.
getN().size2();
3404 auto t_levi_kirchhoff_dP =
3405 dataAtPts->getFTensorLeviKirchhoffP(nb_integration_pts);
3406 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3408 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3410 double a =
v * t_w * det_plasticF;
3412 for (; rr != row_nb_dofs / 3; ++rr) {
3413 double b =
a * t_row_base_fun;
3415 auto t_m = get_ftensor2(
K, 3 * rr, 0);
3416 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3418 t_col_base_piola(
k) =
3419 t_plasticF(
k,
l) * t_col_base_fun(
l) / det_plasticF;
3421 b * (t_levi_kirchhoff_dP(
m,
i,
k) * t_col_base_piola(
k));
3427 for (; rr != row_nb_base_functions; ++rr) {
3432 ++t_levi_kirchhoff_dP;
3442 int row_nb_dofs = row_data.
getIndices().size();
3443 int col_nb_dofs = col_data.
getIndices().size();
3445 auto get_ftensor1 = [](
MatrixDouble &
m,
const int r,
const int c) {
3447 &
m(r + 0,
c), &
m(r + 1,
c), &
m(r + 2,
c));
3457 auto t_levi_kirchoff_dP =
3458 dataAtPts->getFTensorLeviKirchhoffP(nb_integration_pts);
3459 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3461 int row_nb_base_functions = row_data.
getN().size2();
3464 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3466 double a =
v * t_w * det_plasticF;
3468 for (; rr != row_nb_dofs / 3; ++rr) {
3469 double b =
a * t_row_base_fun;
3470 auto t_col_base_fun = col_data.
getFTensor2N<3, 3>(gg, 0);
3471 auto t_m = get_ftensor1(
K, 3 * rr, 0);
3472 for (
int cc = 0; cc != col_nb_dofs; ++cc) {
3474 t_col_base_piola(
i,
k) =
3475 t_col_base_fun(
i,
l) * t_plasticF(
k,
l) / det_plasticF;
3477 b * (t_levi_kirchoff_dP(
m,
i,
k) * t_col_base_piola(
i,
k));
3484 for (; rr != row_nb_base_functions; ++rr) {
3488 ++t_levi_kirchoff_dP;
3498 int row_nb_dofs = row_data.
getIndices().size();
3499 int col_nb_dofs = col_data.
getIndices().size();
3500 auto get_ftensor2 = [](
MatrixDouble &
m,
const int r,
const int c) {
3503 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2),
3505 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2),
3507 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2)
3522 (std::abs(
alphaViscousR) > std::numeric_limits<double>::epsilon() ||
3527 auto t_levi_kirchhoff_domega =
3528 dataAtPts->getFTensorLeviKirchhoffdOmega(nb_integration_pts);
3529 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3530 auto t_invPlasticF =
dataAtPts->getFTensorInvPlasticF(nb_integration_pts);
3531 int row_nb_base_functions = row_data.
getN().size2();
3536 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3538 double a =
v * t_w * det_plasticF;
3545 for (; rr != row_nb_dofs / 3; ++rr) {
3546 auto t_m = get_ftensor2(
K, 3 * rr, 0);
3547 const double row_mass =
a * t_row_base_fun;
3549 t_row_grad_intermediate(
j) =
3550 t_row_grad_fun(
i) * t_invPlasticF(
i,
j);
3553 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3555 t_col_grad_intermediate(
j) =
3556 t_col_grad_fun(
i) * t_invPlasticF(
i,
j);
3558 (row_mass * t_col_base_fun) * t_levi_kirchhoff_domega(
k,
l);
3560 t_kd(
k,
l) * (mass_coeff * t_row_base_fun * t_col_base_fun);
3564 (t_row_grad_intermediate(
j) * t_col_grad_intermediate(
j)));
3572 for (; rr != row_nb_base_functions; ++rr) {
3577 ++t_levi_kirchhoff_domega;
3584template <
typename TInvD,
typename TRotation>
3587 constexpr auto t_diff_sym = FTensor::DiffSymmetrize<double>();
3591 t_d_b_d_p(
i,
j,
k,
l) = t_diff_sym(
i,
j,
m,
l) * t_R(
k,
m);
3595 t_d_u_d_p(
i,
j,
k,
l) =
3596 t_d_u_d_b(
i,
j,
m,
n) * t_d_b_d_p(
m,
n,
k,
l);
3600 t_d_h_d_p(
i,
j,
k,
l) = t_R(
i,
m) * t_d_u_d_p(
m,
j,
k,
l);
3608 dataAtPts->physicsPtr->getFeatures().test(
3609 PhysicalEquations::NO_STRETCH_NONLINEAR)) {
3611 integrateImpl<size_symm * size_symm>(row_data, col_data));
3623 auto get_ftensor2 = [](
MatrixDouble &
m,
const int r,
const int c) {
3626 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2),
3628 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2),
3630 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2)
3636 int row_nb_dofs = row_data.
getIndices().size();
3637 int col_nb_dofs = col_data.
getIndices().size();
3641 int row_nb_base_functions = row_data.
getN().size2() / 3;
3651 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(
dataAtPts->matInvD);
3652 auto t_R =
dataAtPts->getFTensorRotMat(nb_integration_pts);
3653 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3656 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3658 double a =
v * t_w * det_plasticF;
3660 auto assemble = [&](
auto &t_diff_h_p) {
3662 for (; rr != row_nb_dofs / 3; ++rr) {
3664 t_row_base_piola(
j) =
3665 t_plasticF(
j,
m) * t_row_base(
m) / det_plasticF;
3667 auto t_m = get_ftensor2(
K, 3 * rr, 0);
3668 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3670 t_col_base_piola(
l) =
3671 t_plasticF(
l,
n) * t_col_base(
n) / det_plasticF;
3672 t_m(
i,
k) -=
a * t_row_base_piola(
j) *
3673 (t_diff_h_p(
i,
j,
k,
l) * t_col_base_piola(
l));
3681 for (; rr != row_nb_base_functions; ++rr)
3685 if (
dataAtPts->physicsPtr->getFeatures().test(
3686 PhysicalEquations::NO_STRETCH_NONLINEAR)) {
3687 auto t_diff_h_p = getDiffSpatialGradientDP(t_inv_D, t_R);
3706 dataAtPts->physicsPtr->getFeatures().test(
3707 PhysicalEquations::NO_STRETCH_NONLINEAR)) {
3709 integrateImpl<size_symm * size_symm>(row_data, col_data));
3723 int row_nb_dofs = row_data.
getIndices().size();
3724 int col_nb_dofs = col_data.
getIndices().size();
3728 int row_nb_base_functions = row_data.
getN().size2() / 9;
3738 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(
dataAtPts->matInvD);
3739 auto t_R =
dataAtPts->getFTensorRotMat(nb_integration_pts);
3740 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3743 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3745 double a =
v * t_w * det_plasticF;
3747 auto assemble = [&](
auto &t_diff_h_p) {
3749 for (; rr != row_nb_dofs; ++rr) {
3751 t_row_base_piola(
i,
j) =
3752 t_row_base(
i,
m) * t_plasticF(
j,
m) / det_plasticF;
3754 for (
int cc = 0; cc != col_nb_dofs; ++cc) {
3756 t_col_base_piola(
k,
l) =
3757 t_col_base(
k,
n) * t_plasticF(
l,
n) / det_plasticF;
3759 a * (t_row_base_piola(
i,
j) *
3760 (t_diff_h_p(
i,
j,
k,
l) * t_col_base_piola(
k,
l)));
3767 for (; rr != row_nb_base_functions; ++rr)
3771 if (
dataAtPts->physicsPtr->getFeatures().test(
3772 PhysicalEquations::NO_STRETCH_NONLINEAR)) {
3773 auto t_diff_h_p = getDiffSpatialGradientDP(t_inv_D, t_R);
3791 dataAtPts->physicsPtr->getFeatures().test(
3792 PhysicalEquations::NO_STRETCH_NONLINEAR)) {
3794 integrateImpl<size_symm * size_symm>(row_data, col_data));
3807 auto get_ftensor1 = [](
MatrixDouble &
m,
const int r,
const int c) {
3810 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2)
3816 int row_nb_dofs = row_data.
getIndices().size();
3817 int col_nb_dofs = col_data.
getIndices().size();
3821 int row_nb_base_functions = row_data.
getN().size2() / 9;
3831 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(
dataAtPts->matInvD);
3832 auto t_R =
dataAtPts->getFTensorRotMat(nb_integration_pts);
3833 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3836 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3838 double a =
v * t_w * det_plasticF;
3840 auto assemble = [&](
auto &t_diff_h_p) {
3841 auto t_m = get_ftensor1(
K, 0, 0);
3843 for (; rr != row_nb_dofs; ++rr) {
3845 t_row_base_piola(
i,
j) =
3846 t_row_base(
i,
m) * t_plasticF(
j,
m) / det_plasticF;
3848 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3850 t_col_base_piola(
l) =
3851 t_plasticF(
l,
n) * t_col_base(
n) / det_plasticF;
3853 a * (t_row_base_piola(
i,
j) * t_diff_h_p(
i,
j,
k,
l)) *
3854 t_col_base_piola(
l);
3862 for (; rr != row_nb_base_functions; ++rr)
3866 if (
dataAtPts->physicsPtr->getFeatures().test(
3867 PhysicalEquations::NO_STRETCH_NONLINEAR)) {
3868 auto t_diff_h_p = getDiffSpatialGradientDP(t_inv_D, t_R);
3886 auto get_ftensor1 = [](
MatrixDouble &
m,
const int r,
const int c) {
3889 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2)
3895 int row_nb_dofs = row_data.
getIndices().size();
3896 int col_nb_dofs = col_data.
getIndices().size();
3900 int row_nb_base_functions = row_data.
getN().size2() / 9;
3906 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3909 auto t_m = get_ftensor1(
K, 0, 0);
3912 for (; rr != row_nb_dofs; ++rr) {
3914 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3915 t_m(
k) +=
a * t_row_base(
k,
l) * t_col_base(
l);
3923 for (; rr != row_nb_base_functions; ++rr)
3942 int nb_integration_pts = row_data.
getN().size1();
3943 int row_nb_dofs = row_data.
getIndices().size();
3944 int col_nb_dofs = col_data.
getIndices().size();
3946 auto get_ftensor2 = [](
MatrixDouble &
m,
const int r,
const int c) {
3949 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2),
3951 &
m(r + 1,
c + 0), &
m(r + 1,
c + 1), &
m(r + 1,
c + 2),
3953 &
m(r + 2,
c + 0), &
m(r + 2,
c + 1), &
m(r + 2,
c + 2)
3960 int row_nb_base_functions = row_data.
getN().size2() / 3;
3963 auto t_h_domega =
dataAtPts->getFTensorSmallHdOmega(nb_integration_pts);
3964 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
3966 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
3968 double a =
v * t_w * det_plasticF;
3971 for (; rr != row_nb_dofs / 3; ++rr) {
3974 t_row_base_piola(
j) =
3975 t_plasticF(
j,
m) * t_row_base_fun(
m) / det_plasticF;
3977 t_PRT(
i,
k) = t_row_base_piola(
j) * t_h_domega(
i,
j,
k);
3980 auto t_m = get_ftensor2(
K, 3 * rr, 0);
3981 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
3982 t_m(
i,
j) -= (
a * t_col_base_fun) * t_PRT(
i,
j);
3990 for (; rr != row_nb_base_functions; ++rr)
4011 int nb_integration_pts = row_data.
getN().size1();
4012 int row_nb_dofs = row_data.
getIndices().size();
4013 int col_nb_dofs = col_data.
getIndices().size();
4015 auto get_ftensor2 = [](
MatrixDouble &
m,
const int r,
const int c) {
4017 &
m(r,
c + 0), &
m(r,
c + 1), &
m(r,
c + 2));
4022 int row_nb_base_functions = row_data.
getN().size2() / 9;
4025 auto t_h_domega =
dataAtPts->getFTensorSmallHdOmega(nb_integration_pts);
4026 auto t_plasticF =
dataAtPts->getFTensorPlasticF(nb_integration_pts);
4027 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
4029 double a =
v * t_w * det_plasticF;
4032 for (; rr != row_nb_dofs; ++rr) {
4035 t_row_base_piola(
i,
j) =
4036 t_row_base_fun(
i,
m) * t_plasticF(
j,
m) / det_plasticF;
4038 t_PRT(
k) = t_row_base_piola(
i,
j) * t_h_domega(
i,
j,
k);
4041 auto t_m = get_ftensor2(
K, rr, 0);
4042 for (
int cc = 0; cc != col_nb_dofs / 3; ++cc) {
4043 t_m(
j) -= (
a * t_col_base_fun) * t_PRT(
j);
4051 for (; rr != row_nb_base_functions; ++rr)
4065 if (
tagSense != getSkeletonSense())
4068 auto create_tag = [
this](
const std::string tag_name,
const int size) {
4069 double def_VAL[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
4072 th, MB_TAG_CREAT | MB_TAG_SPARSE,
4077 Tag th_cauchy_streess = create_tag(
"CauchyStress", 9);
4078 Tag th_detF = create_tag(
"detF", 1);
4079 Tag th_traction = create_tag(
"traction", 3);
4080 Tag th_disp_error = create_tag(
"DisplacementError", 1);
4082 Tag th_energy = create_tag(
"Energy", 1);
4083 Tag th_young_modulus = create_tag(
"YoungModulus", 1);
4085 const auto nb_gauss_pts = getGaussPts().size2();
4086 auto t_w =
dataAtPts->getFTensorSmallWL2(nb_gauss_pts);
4087 auto t_h =
dataAtPts->getFTensorSmallH(nb_gauss_pts);
4088 auto t_approx_P =
dataAtPts->getFTensorApproxP(nb_gauss_pts);
4090 auto t_normal = getFTensor1NormalsAtGaussPts();
4091 auto t_disp =
dataAtPts->getFTensorSmallWH1(nb_gauss_pts);
4095 if (
dataAtPts->energyAtPts.size() == 0) {
4097 dataAtPts->energyAtPts.resize(nb_gauss_pts);
4103 if (
dataAtPts->physicsPtr->getFeatures().test(
4104 PhysicalEquations::NON_HOMOGENEOUS_MATERIAL)) {
4105 if (
dataAtPts->youngModulusAtPts.size() != nb_gauss_pts)
4107 "Young's modulus postprocessing requires current material data");
4108 t_youngs_modulus.emplace(
4118 if (t_youngs_modulus)
4119 ++*t_youngs_modulus;
4128 auto set_float_precision = [](
const double x) {
4129 if (std::abs(x) < std::numeric_limits<float>::epsilon())
4136 auto save_scal_tag = [&](
auto &
th,
auto v,
const int gg) {
4138 v = set_float_precision(
v);
4146 auto save_vec_tag = [&](
auto &
th,
auto &t_d,
const int gg) {
4149 for (
auto &
a :
v.data())
4150 a = set_float_precision(
a);
4152 &*
v.data().begin());
4160 &
m(0, 0), &
m(0, 1), &
m(0, 2),
4162 &
m(1, 0), &
m(1, 1), &
m(1, 2),
4164 &
m(2, 0), &
m(2, 1), &
m(2, 2));
4166 auto save_mat_tag = [&](
auto &
th,
auto &t_d,
const int gg) {
4168 t_m(
i,
j) = t_d(
i,
j);
4169 for (
auto &
v :
m.data())
4170 v = set_float_precision(
v);
4172 &*
m.data().begin());
4176 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
4179 t_traction(
i) = t_approx_P(
i,
j) * t_normal(
j) / t_normal.
l2();
4182 CHKERR save_vec_tag(th_traction, t_traction, gg);
4184 double u_error = sqrt((t_disp(
i) - t_w(
i)) * (t_disp(
i) - t_w(
i)));
4185 if (!std::isfinite(u_error))
4187 CHKERR save_scal_tag(th_disp_error, u_error, gg);
4188 CHKERR save_scal_tag(th_energy, t_energy, gg);
4189 if (t_youngs_modulus)
4190 CHKERR save_scal_tag(th_young_modulus, *t_youngs_modulus, gg);
4194 t_cauchy(
i,
j) = (1. / jac) * (t_approx_P(
i,
k) * t_h(
j,
k));
4195 CHKERR save_mat_tag(th_cauchy_streess, t_cauchy, gg);
4205 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
4206 std::vector<FieldSpace> spaces, std::string geom_field_name,
4207 boost::shared_ptr<Range> crack_front_edges_ptr) {
4210 constexpr bool scale_l2 =
false;
4214 "Scale L2 Ainsworth Legendre base is not implemented");
4223 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
4224 std::vector<FieldSpace> spaces, std::string geom_field_name,
4225 boost::shared_ptr<Range> crack_front_edges_ptr) {
4228 constexpr bool scale_l2 =
false;
4232 "Scale L2 Ainsworth Legendre base is not implemented");
4241 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
4242 std::vector<FieldSpace> spaces, std::string geom_field_name,
4243 boost::shared_ptr<Range> crack_front_edges_ptr,
4244 boost::shared_ptr<MatrixDouble> jac, boost::shared_ptr<VectorDouble> det,
4245 boost::shared_ptr<MatrixDouble> inv_jac) {
4248 if (!geom_field_name.empty()) {
4250 auto jac = boost::make_shared<MatrixDouble>();
4251 auto det = boost::make_shared<VectorDouble>();
4254 geom_field_name, jac));
4261 constexpr bool scale_l2_ainsworth_legendre_base =
false;
4263 if (scale_l2_ainsworth_legendre_base) {
4271 boost::shared_ptr<MatrixDouble> jac,
4272 boost::shared_ptr<Range> edges_ptr)
4281 if (
type == MBEDGE && edgesPtr->find(ent) != edgesPtr->end()) {
4284 return OP::doWork(side,
type, data);
4289 boost::shared_ptr<Range> edgesPtr;
4292 if (!geom_field_name.empty()) {
4293 auto jac = boost::make_shared<MatrixDouble>();
4294 auto det = boost::make_shared<VectorDouble>();
4296 geom_field_name, jac,
4298 : boost::make_shared<
Range>()));
4373 const auto nb_gauss_pts = getGaussPts().size2();
4375 dataAtPts->faceMaterialForceAtPts, nb_gauss_pts);
4376 dataAtPts->normalPressureAtPts.resize(nb_gauss_pts,
false);
4377 if (getNinTheLoop() == 0) {
4378 dataAtPts->faceMaterialForceAtPts.clear();
4381 auto loop_size = getLoopSize();
4382 if (loop_size == 1) {
4383 auto numebered_fe_ptr = getSidePtrFE()->numeredEntFiniteElementPtr;
4384 auto pstatus = numebered_fe_ptr->getPStatus();
4385 if (pstatus & (PSTATUS_SHARED | PSTATUS_MULTISHARED)) {
4392 auto t_normal = getFTensor1NormalsAtGaussPts();
4393 auto t_T =
dataAtPts->getFTensorFaceMaterialForce(
4397 auto t_P =
dataAtPts->getFTensorApproxP(nb_gauss_pts);
4398 auto t_u_gamma =
dataAtPts->getFTensorSmallHybridDisp(nb_gauss_pts);
4399 auto t_grad_u_gamma =
dataAtPts->getFTensorGradHybridDisp(nb_gauss_pts);
4400 auto t_strain =
dataAtPts->getFTensorLogStretch(nb_gauss_pts);
4401 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_gauss_pts);
4422 case GRIFFITH_FORCE:
4423 for (
auto gg = 0; gg != getGaussPts().size2(); ++gg) {
4424 t_N(
I) = t_normal(
I);
4427 t_A(
i,
j) = levi_civita(
i,
j,
k) * t_omega(
k);
4429 t_grad_u(
i,
j) = t_R(
i,
j) + t_strain(
i,
j);
4431 t_T(
I) += t_N(
J) * (t_grad_u(
i,
I) * t_P(
i,
J)) / loop_size;
4434 t_T(
I) -= t_N(
I) * ((t_strain(
i,
K) * t_P(
i,
K)) / 2.) / loop_size;
4437 (t_N(
J) * ((
t_kd(
i,
I) + t_grad_u_gamma(
i,
I)) * t_P(
i,
J))) /
4443 case GRIFFITH_SKELETON:
4444 for (
auto gg = 0; gg != getGaussPts().size2(); ++gg) {
4447 t_N(
I) = t_normal(
I);
4452 t_strain(
i,
j) - 0.5 * (t_grad_u_gamma(
i,
j) + t_grad_u_gamma(
j,
i));
4456 t_grad_u_gamma(
i,
J) +
4457 (2 * t_R(
i,
K) * t_N(
K) - (t_R(
k,
L) * t_N(
k) * t_N(
L)) * t_N(
i)) *
4460 t_T(
I) += t_N(
J) * (t_grad_u(
i,
I) * t_P(
i,
J)) / loop_size;
4463 t_T(
I) -= t_N(
I) * ((t_strain(
i,
K) * t_P(
i,
K)) / 2.) / loop_size;
4467 (t_N(
J) * ((
t_kd(
i,
I) + t_grad_u_gamma(
i,
I)) * t_P(
i,
J))) /
4476 "Grffith energy release "
4477 "selector not implemented");
4481 auto side_fe_ptr = getSidePtrFE();
4482 auto side_fe_mi_ptr = side_fe_ptr->numeredEntFiniteElementPtr;
4483 auto pstatus = side_fe_mi_ptr->getPStatus();
4485 auto owner = side_fe_mi_ptr->getOwnerProc();
4487 <<
"OpFaceSideMaterialForce: owner proc is not 0, owner proc: " << owner
4488 <<
" " << getPtrFE()->mField.get_comm_rank() <<
" n in the loop "
4489 << getNinTheLoop() <<
" loop size " << getLoopSize();
4501 auto fe_mi_ptr = getFEMethod()->numeredEntFiniteElementPtr;
4502 auto pstatus = fe_mi_ptr->getPStatus();
4504 auto owner = fe_mi_ptr->getOwnerProc();
4506 <<
"OpFaceMaterialForce: owner proc is not 0, owner proc: " << owner
4507 <<
" " << getPtrFE()->mField.get_comm_rank();
4515 double face_pressure = 0.;
4516 auto t_T =
dataAtPts->getFTensorFaceMaterialForce(
4517 getGaussPts().size2());
4520 auto t_w = getFTensor0IntegrationWeight();
4521 for (
auto gg = 0; gg != getGaussPts().size2(); ++gg) {
4522 t_face_T(
I) += t_w * t_T(
I);
4523 face_pressure += t_w * t_p;
4528 t_face_T(
I) *= getMeasure();
4529 face_pressure *= getMeasure();
4531 auto get_tag = [&](
auto name,
auto dim) {
4532 auto &moab = getPtrFE()->mField.get_moab();
4534 double def_val[] = {0., 0., 0.};
4535 CHK_MOAB_THROW(moab.tag_get_handle(name, dim, MB_TYPE_DOUBLE, tag,
4536 MB_TAG_CREAT | MB_TAG_SPARSE, def_val),
4541 auto set_tag = [&](
auto &&tag,
auto ptr) {
4542 auto &moab = getPtrFE()->mField.get_moab();
4543 auto face = getPtrFE()->getFEEntityHandle();
4544 CHK_MOAB_THROW(moab.tag_set_data(tag, &face, 1, ptr),
"set tag");
4547 set_tag(get_tag(
"MaterialForce", 3), &t_face_T(0));
4548 set_tag(get_tag(
"FacePressure", 1), &face_pressure);
4553template <
typename OP_PTR>
4554std::tuple<std::string, MatrixDouble>
4556 const std::string block_name) {
4558 auto nb_gauss_pts = op_ptr->getGaussPts().size2();
4560 auto ts_time = op_ptr->getTStime();
4561 auto ts_time_step = op_ptr->getTStimeStep();
4568 MatrixDouble m_ref_coords = op_ptr->getCoordsAtGaussPts();
4569 MatrixDouble m_ref_normals = op_ptr->getNormalsAtGaussPts();
4571 auto v_analytical_expr =
4573 m_ref_coords, m_ref_normals, block_name);
4575 if (PetscUnlikely(!v_analytical_expr.size2())) {
4577 "Analytical expression is empty or does not exist, "
4578 "check python file");
4581 return std::make_tuple(block_name, v_analytical_expr);
4585 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
4586 boost::shared_ptr<MatrixDouble> vec,
ScalarFun beta_coeff,
4587 boost::shared_ptr<Range> ents_ptr)
4588 :
OP(broken_base_side_data, ents_ptr) {
4589 this->sourceVec = vec;
4590 this->betaCoeff = beta_coeff;
4594 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
4595 ScalarFun beta_coeff, boost::shared_ptr<Range> ents_ptr)
4596 :
OP(broken_base_side_data, ents_ptr) {
4597 this->sourceVec = boost::shared_ptr<MatrixDouble>();
4598 this->betaCoeff = beta_coeff;
4607 if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
4612 if (!brokenBaseSideData) {
4617 auto do_work_rhs = [
this](
int row_side, EntityType row_type,
4625 OP::nbIntegrationPts = OP::getGaussPts().size2();
4627 OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(row_data);
4629 OP::locF.resize(OP::nbRows,
false);
4632 CHKERR this->iNtegrate(row_data);
4634 CHKERR this->aSsemble(row_data);
4638 switch (OP::opType) {
4640 for (
auto &bd : *brokenBaseSideData) {
4642 boost::shared_ptr<MatrixDouble>(brokenBaseSideData, &bd.getFlux());
4643 CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData());
4644 this->sourceVec.reset();
4649 (std::string(
"wrong op type ") +
4650 OpBaseDerivativesBase::OpTypeNames[OP::opType])
4658 const std::string row_field,
4659 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
4660 ScalarFun beta_coeff, boost::shared_ptr<Range> ents_ptr)
4661 :
OP(row_field, boost::shared_ptr<
MatrixDouble>(), beta_coeff, ents_ptr),
4662 brokenBaseSideDataPtr(broken_base_side_data) {
4663 this->betaCoeff = beta_coeff;
4669 for (
auto &bd : (*brokenBaseSideDataPtr)) {
4674 if (this->sourceVec->size2() !=
SPACE_DIM) {
4676 "Inconsistent size of the source vector");
4678 if (this->sourceVec->size1() != OP::getGaussPts().size2()) {
4680 "Inconsistent size of the source vector");
4684 CHKERR OP::iNtegrate(data);
4686 this->sourceVec.reset();
4692 std::string row_field,
4693 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
4694 ScalarFun beta,
const bool assmb_transpose,
const bool only_transpose,
4695 boost::shared_ptr<Range> ents_ptr)
4696 :
OP(row_field, broken_base_side_data, assmb_transpose, only_transpose,
4698 this->betaCoeff = beta;
4703 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
4704 ScalarFun beta, boost::shared_ptr<Range> ents_ptr)
4705 :
OP(broken_base_side_data, ents_ptr) {
4707 this->betaCoeff = beta;
4708 OP::assembleTranspose =
false;
4709 OP::onlyTranspose =
false;
4718 if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
4723 if (!brokenBaseSideData) {
4728 auto do_work_lhs = [
this](
int row_side,
int col_side, EntityType row_type,
4729 EntityType col_type,
4734 auto check_if_assemble_transpose = [&] {
4736 if (OP::rowSide != OP::colSide || OP::rowType != OP::colType)
4740 }
else if (OP::assembleTranspose) {
4746 OP::rowSide = row_side;
4747 OP::rowType = row_type;
4748 OP::colSide = col_side;
4749 OP::colType = col_type;
4751 OP::locMat.resize(OP::nbRows, OP::nbCols,
false);
4753 CHKERR this->iNtegrate(row_data, col_data);
4754 CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
4758 switch (OP::opType) {
4761 for (
auto &bd : *brokenBaseSideData) {
4764 if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
4766 "base functions not set");
4770 OP::nbRows = bd.getData().getIndices().size();
4773 OP::nbIntegrationPts = OP::getGaussPts().size2();
4774 OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(bd.getData());
4782 bd.getSide(), bd.getSide(),
4785 bd.getType(), bd.getType(),
4788 bd.getData(), bd.getData()
4797 (std::string(
"wrong op type ") +
4798 OpBaseDerivativesBase::OpTypeNames[OP::opType])
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
Auxilary functions for Eshelbian plasticity.
Eshelbian plasticity interface.
Lie algebra implementation.
#define FTENSOR_INDEXES(DIM,...)
#define FTENSOR_INDEX(DIM, I)
Kronecker Delta class symmetric.
Tensor1< T, Tensor_Dim > normalize()
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ USER_BASE
user implemented approximation base
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ L2
field with C-1 continuity
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
boost::function< T(const T)> Fun
auto getMat(A &&t_val, B &&t_vec, Fun< double > f)
Get the Mat object.
auto getDiffMat(A &&t_val, B &&t_vec, Fun< double > f, Fun< double > d_f, const int nb)
Get the Diff Mat object.
auto getDiffSpatialGradientDP(TInvD &t_d_u_d_b, TRotation &t_R)
std::tuple< std::string, MatrixDouble > getAnalyticalExpr(OP_PTR op_ptr, MatrixDouble &analytical_expr, const std::string block_name)
MatrixDouble analytical_expr_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, MatrixDouble &m_ref_normals, const std::string block_name)
auto getDiffSpatialGradientDR(TInvD &t_d_u_d_b, TRotation &t_R, TDiffRotation &t_diff_R, TStress &t_P)
boost::shared_ptr< VectorDouble > VectorPtr
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
VectorBoundedArray< double, 3 > VectorDouble3
UBlasMatrix< double > MatrixDouble
implementation of Data Operators for Forces and Sources
decltype(GetFTensor2SymmetricFromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2SymmetricFromMatType
auto getFTensor2FromMat(M &data)
Get tensor rank 2 (matrix) form data matrix.
decltype(GetFTensor4FromMatImpl< Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, Tensor_Dim3, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor4FromMatType
decltype(GetFTensor4DdgFromMatImpl< Tensor_Dim01, Tensor_Dim23, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor4DdgFromMatType
auto getFTensor1FromMat(M &data, int rr=0, int cc=0)
Get tensor rank 1 (vector) form data matrix.
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
MoFEMErrorCode computeEigenValuesSymmetric(const MatrixDouble &mat, VectorDouble &eig, MatrixDouble &eigen_vec)
compute eigenvalues of a symmetric matrix using lapack dsyev
static auto getFTensor0FromVec(V &data)
Get tensor rank 0 (scalar) form data vector.
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
decltype(GetFTensor3FromMatImpl< Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor3FromMatType
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType
constexpr IntegrationType I
constexpr auto field_name
FTensor::Index< 'm', 3 > m
static enum StretchSelector stretchSelector
static PetscBool l2UserBaseScale
static enum RotSelector rotSelector
static enum RotSelector gradApproximator
static PetscBool physicalTimeFlg
static double currentPhysicalTime
static constexpr enum SymmetrySelector symmetrySelector
static boost::function< double(const double)> f
static PetscBool setSingularity
static boost::function< double(const double)> d_f
static enum EnergyReleaseSelector energyReleaseSelector
static boost::function< double(const double)> inv_f
static auto diffDiffExp(A &&t_w_vee, B &&theta)
static auto diffExp(A &&t_w_vee, B &&theta)
static auto exp(A &&t_w_vee, B &&theta)
Add operators pushing bases from local to physical configuration.
std::array< bool, MBMAXTYPE > doEntities
If true operator is executed for entity.
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN(FieldApproximationBase base)
Get derivatives of base functions for Hdiv space.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
const VectorFieldEntities & getFieldEntities() const
Get field entities (const version)
auto getFTensor2N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
Get DOF values on entity.
auto getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
EntityHandle getFEEntityHandle() const
Return finite element entity handle.
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)
auto getFTensor0IntegrationWeight()
Get integration weights.
const TSMethod::TSContext getTSCtx() const
double getTStimeStep() const
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Operator for inverting matrices at integration points.
Scale base functions by inverses of measure of element.
static constexpr Switches CtxSetTime
Time value switch.
@ CTX_TSSETIJACOBIAN
Setting up implicit Jacobian.
double getVolume() const
element volume (linear geometry)
MoFEMErrorCode iNtegrate(EntData &data)
MatrixDouble K
local tangent matrix
VectorDouble nF
local right hand side vector
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode assemble(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
boost::shared_ptr< AnalyticalTractionBcVec > bcData
boost::shared_ptr< double > piolaScalePtr
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
OpBrokenBaseBrokenBase(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, ScalarFun beta, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
OpBrokenBaseTimesBrokenDisp(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, ScalarFun beta_coeff=[](double, double, double) constexpr { return 1;}, boost::shared_ptr< Range > ents_ptr=nullptr)
OpBrokenBaseTimesHybridDisp(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< MatrixDouble > vec, ScalarFun beta_coeff=[](double, double, double) constexpr { return 1;}, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
boost::shared_ptr< double > piolaScalePtr
MoFEMErrorCode iNtegrate(EntData &data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< PressureBcVec > bcData
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< double > piolaScalePtr
boost::shared_ptr< TractionBcVec > bcData
MoFEMErrorCode iNtegrate(EntData &data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
MoFEMErrorCode doWork(int side, EntityType type, EntData &data) override
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< ExternalStrainVec > externalStrainVecPtr
VectorPtr externalPressurePtr
OpCalculateExternalPressure(VectorPtr external_pressure_ptr, boost::shared_ptr< ExternalStrainVec > external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
std::array< double, 6 > & reactionVec
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Caluclate face material force and normal pressure at gauss points.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
OpHybridBaseTimesBrokenDisp(const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, ScalarFun beta_coeff, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideDataPtr
OpHyrbridBaseBrokenBase(std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, ScalarFun beta, const bool assmb_transpose, const bool only_transpose, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &data)
std::vector< EntityHandle > & mapGaussPts
moab::Interface & postProcMesh
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data)
const bool hasNonhomogeneousMatBlock
MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
const bool hasNonhomogeneousMatBlock
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data)
const bool hasNonhomogeneousMatBlock
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &row_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
MoFEMErrorCode iNtegrate(EntData &data)