1959 {
1961
1963
1965 int nb_integration_pts = getGaussPts().size2();
1966 int nb_base_functions = data.
getN().size2();
1967
1968 double time = getFEMethod()->ts_t;
1971 }
1972
1973#ifndef NDEBUG
1974 if (this->locF.size() != nb_dofs)
1976 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
1977#endif
1978
1979 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1981
1982 auto val = bc.val;
1984 auto t_w = getFTensor0IntegrationWeight();
1985 auto t_coords = getFTensor1CoordsAtGaussPts();
1986 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1987 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1988
1990
1992
1993 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1994
2000
2004
2005 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) * t_tangent1(
j)) *
2007 } else {
2008 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) *
2009 (t_tangent1(
j) + t_grad_gamma_u(
j, N0))) *
2010 (t_tangent2(
k) + t_grad_gamma_u(
k, N1));
2011 }
2012 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2014 t_val(
i) = (time_scale * t_w * tau *
scale * val) * t_normal(
i);
2015
2016 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2017 int rr = 0;
2018 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2019 t_f(
i) += t_row_base * t_val(
i);
2020 ++t_row_base;
2021 ++t_f;
2022 }
2023
2024 for (; rr != nb_base_functions; ++rr)
2025 ++t_row_base;
2026 ++t_w;
2027 ++t_coords;
2028 ++t_tangent1;
2029 ++t_tangent2;
2030 ++t_grad_gamma_u;
2031 }
2032 this->locF /= 2.;
2033
2035 };
2036
2037
2039 for (
auto &bc : *(
bcData)) {
2040 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2041
2042 double time_scale = 1;
2045 }
2046
2048 if (nb_dofs) {
2050 bc, [](double, double, double) { return 1; }, time_scale);
2051 }
2052 }
2053 }
2055}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
[Define dimension]
#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
static enum StretchSelector stretchSelector
static double dynamicTime
static enum RotSelector gradApproximator
static PetscBool dynamicRelaxation
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.