2688 {
2690
2692
2693 int nb_dofs =
data.getFieldData().size();
2694 int nb_integration_pts = getGaussPts().size2();
2695 int nb_base_functions =
data.getN().size2();
2696
2697 double time = getFEMethod()->ts_t;
2700 }
2701
2702#ifndef NDEBUG
2703 if (this->locF.size() != nb_dofs)
2705 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2706#endif
2707
2708 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
2710
2711 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
2712 auto t_row_base =
data.getFTensor0N();
2713 auto t_w = getFTensor0IntegrationWeight();
2714 auto t_coords = getFTensor1CoordsAtGaussPts();
2715 auto t_normal = getFTensor1NormalsAtGaussPts();
2716
2718
2719 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2720
2721 double a = sqrt(t_normal(
i) * t_normal(
i));
2723 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2724 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2725 int rr = 0;
2726 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2728 (time_scale *
a * t_w * t_row_base * tau) * (t_val(
i) *
scale);
2729 ++t_row_base;
2730 ++t_f;
2731 }
2732
2733 for (; rr != nb_base_functions; ++rr)
2734 ++t_row_base;
2735 ++t_w;
2736 ++t_coords;
2737 ++t_normal;
2738 }
2740 };
2741
2742
2743 EntityHandle fe_ent = getFEEntityHandle();
2744 for (
auto &bc : *(
bcData)) {
2745 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2746
2747 double time_scale = 1;
2750 }
2751
2752 int nb_dofs =
data.getFieldData().size();
2753 if (nb_dofs) {
2754
2755 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
2757 y -= 44;
2758 y /= (60 - 44);
2759 return -y * (y - 1) / 0.25;
2760 };
2761 CHKERR integrate_rhs(bc, calc_tau, time_scale);
2762 } else {
2764 bc, [](double, double, double) { return 1; }, time_scale);
2765 }
2766 }
2767 }
2768 }
2770}
boost::shared_ptr< DataAtIntegrationPts > data
#define FTENSOR_INDEX(DIM, I)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
static PetscBool physicalTimeFlg
static double currentPhysicalTime