2601 {
2603
2605
2607 int nb_integration_pts = getGaussPts().size2();
2608 int nb_base_functions = data.
getN().size2();
2609
2610 double time = getFEMethod()->ts_t;
2613 }
2614
2615#ifndef NDEBUG
2616 if (this->locF.size() != nb_dofs)
2618 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2619#endif
2620
2621 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
2623
2624 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
2626 auto t_w = getFTensor0IntegrationWeight();
2627 auto t_coords = getFTensor1CoordsAtGaussPts();
2628 auto t_normal = getFTensor1NormalsAtGaussPts();
2629
2631
2632 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2633
2634 double a = sqrt(t_normal(
i) * t_normal(
i));
2636 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2637 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2638 int rr = 0;
2639 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2641 (time_scale *
a * t_w * t_row_base * tau) * (t_val(
i) *
scale);
2642 ++t_row_base;
2643 ++t_f;
2644 }
2645
2646 for (; rr != nb_base_functions; ++rr)
2647 ++t_row_base;
2648 ++t_w;
2649 ++t_coords;
2650 ++t_normal;
2651 }
2653 };
2654
2655
2656 EntityHandle fe_ent = getFEEntityHandle();
2657 for (
auto &bc : *(
bcData)) {
2658 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2659
2660 double time_scale = 1;
2663 }
2664
2666 if (nb_dofs) {
2667
2668 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
2670 y -= 44;
2671 y /= (60 - 44);
2672 return -y * (y - 1) / 0.25;
2673 };
2674 CHKERR integrate_rhs(bc, calc_tau, time_scale);
2675 } else {
2677 bc, [](double, double, double) { return 1; }, time_scale);
2678 }
2679 }
2680 }
2681 }
2683}
#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
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
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.