2772 {
2774
2776
2777 int nb_dofs =
data.getFieldData().size();
2778 int nb_integration_pts = getGaussPts().size2();
2779 int nb_base_functions =
data.getN().size2();
2780
2781 double time = getFEMethod()->ts_t;
2784 }
2785
2786#ifndef NDEBUG
2787 if (this->locF.size() != nb_dofs)
2789 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
2790#endif
2791
2792 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
2794
2795 auto val = bc.val;
2796 auto t_row_base =
data.getFTensor0N();
2797 auto t_w = getFTensor0IntegrationWeight();
2798 auto t_coords = getFTensor1CoordsAtGaussPts();
2799 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
2800 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
2801
2803
2805
2806 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2807
2813
2817
2818 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) * t_tangent1(
j)) *
2820 } else {
2821 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) *
2822 (t_tangent1(
j) + t_grad_gamma_u(
j, N0))) *
2823 (t_tangent2(
k) + t_grad_gamma_u(
k, N1));
2824 }
2825 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2827 t_val(
i) = (time_scale * t_w * tau *
scale * val) * t_normal(
i);
2828
2829 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2830 int rr = 0;
2831 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2832 t_f(
i) += t_row_base * t_val(
i);
2833 ++t_row_base;
2834 ++t_f;
2835 }
2836
2837 for (; rr != nb_base_functions; ++rr)
2838 ++t_row_base;
2839 ++t_w;
2840 ++t_coords;
2841 ++t_tangent1;
2842 ++t_tangent2;
2843 ++t_grad_gamma_u;
2844 }
2845 this->locF /= 2.;
2846
2848 };
2849
2850
2851 EntityHandle fe_ent = getFEEntityHandle();
2852 for (
auto &bc : *(
bcData)) {
2853 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2854
2855 double time_scale = 1;
2858 }
2859
2860 int nb_dofs =
data.getFieldData().size();
2861 if (nb_dofs) {
2863 bc, [](double, double, double) { return 1; }, time_scale);
2864 }
2865 }
2866 }
2868}
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
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