2685 {
2687
2689
2691 int nb_integration_pts = getGaussPts().size2();
2692 int nb_base_functions = data.
getN().size2();
2693
2694 double time = getFEMethod()->ts_t;
2697 }
2698
2699#ifndef NDEBUG
2700 if (this->locF.size() != nb_dofs)
2702 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2703#endif
2704
2705 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
2707
2708 auto val = bc.val;
2710 auto t_w = getFTensor0IntegrationWeight();
2711 auto t_coords = getFTensor1CoordsAtGaussPts();
2712 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
2713 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
2714
2716
2718
2719 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2720
2726
2730
2731 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) * t_tangent1(
j)) *
2733 } else {
2734 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) *
2735 (t_tangent1(
j) + t_grad_gamma_u(
j, N0))) *
2736 (t_tangent2(
k) + t_grad_gamma_u(
k, N1));
2737 }
2738 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2740 t_val(
i) = (time_scale * t_w * tau *
scale * val) * t_normal(
i);
2741
2742 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2743 int rr = 0;
2744 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2745 t_f(
i) += t_row_base * t_val(
i);
2746 ++t_row_base;
2747 ++t_f;
2748 }
2749
2750 for (; rr != nb_base_functions; ++rr)
2751 ++t_row_base;
2752 ++t_w;
2753 ++t_coords;
2754 ++t_tangent1;
2755 ++t_tangent2;
2756 ++t_grad_gamma_u;
2757 }
2758 this->locF /= 2.;
2759
2761 };
2762
2763
2764 EntityHandle fe_ent = getFEEntityHandle();
2765 for (
auto &bc : *(
bcData)) {
2766 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2767
2768 double time_scale = 1;
2771 }
2772
2774 if (nb_dofs) {
2776 bc, [](double, double, double) { return 1; }, time_scale);
2777 }
2778 }
2779 }
2781}
#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
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
auto getFTensor2FromMat(M &data)
Get tensor rank 2 (matrix) form data matrix.
static enum StretchSelector stretchSelector
static enum RotSelector gradApproximator
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.