1977 {
1979
1981
1983 int nb_integration_pts = getGaussPts().size2();
1984 int nb_base_functions = data.
getN().size2();
1985
1986 double time = getFEMethod()->ts_t;
1989 }
1990
1991#ifndef NDEBUG
1992 if (this->locF.size() != nb_dofs)
1994 "Size of locF %ld != nb_dofs %d", this->locF.size(), nb_dofs);
1995#endif
1996
1997 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1999
2000 auto val = bc.val;
2002 auto t_w = getFTensor0IntegrationWeight();
2003 auto t_coords = getFTensor1CoordsAtGaussPts();
2004 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
2005 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
2006
2008
2010
2011 for (int gg = 0; gg != nb_integration_pts; ++gg) {
2012
2018
2022
2023 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) * t_tangent1(
j)) *
2025 } else {
2026 t_normal(
i) = (FTensor::levi_civita<double>(
i,
j,
k) *
2027 (t_tangent1(
j) + t_grad_gamma_u(
j, N0))) *
2028 (t_tangent2(
k) + t_grad_gamma_u(
k, N1));
2029 }
2030 auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
2032 t_val(
i) = (time_scale * t_w * tau *
scale * val) * t_normal(
i);
2033
2034 auto t_f = getFTensor1FromPtr<3>(&*this->locF.begin());
2035 int rr = 0;
2036 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
2037 t_f(
i) += t_row_base * t_val(
i);
2038 ++t_row_base;
2039 ++t_f;
2040 }
2041
2042 for (; rr != nb_base_functions; ++rr)
2043 ++t_row_base;
2044 ++t_w;
2045 ++t_coords;
2046 ++t_tangent1;
2047 ++t_tangent2;
2048 ++t_grad_gamma_u;
2049 }
2050 this->locF /= 2.;
2051
2053 };
2054
2055
2057 for (
auto &bc : *(
bcData)) {
2058 if (bc.faces.find(fe_ent) != bc.faces.end()) {
2059
2060 double time_scale = 1;
2063 }
2064
2066 if (nb_dofs) {
2068 bc, [](double, double, double) { return 1; }, time_scale);
2069 }
2070 }
2071 }
2073}
#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
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.