1369 {
1372
1376
1378 int nb_integration_pts = getGaussPts().size2();
1379 int nb_base_functions = data.
getN().size2();
1380
1381 double time = getFEMethod()->ts_t;
1384 }
1385
1386#ifndef NDEBUG
1387 if (this->
nF.size() != nb_dofs)
1389 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1390#endif
1391
1392 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1394
1395 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1397 auto t_w = getFTensor0IntegrationWeight();
1398 auto t_coords = getFTensor1CoordsAtGaussPts();
1399
1401 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1402 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1403
1404 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1405
1409
1410 double a = sqrt(t_normal(
i) * t_normal(
i));
1412 t_da(
i) = t_normal(
i) /
a;
1415
1416 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1417 locJ -= (time_scale * t_w *
a * tau) * (t_val(
i) * t_var_u_gamma(
i));
1418
1419 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1420 int rr = 0;
1421 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1426 t_nf(
I) -= (time_scale * t_w * tau) * (t_val(
i) * t_var_u_gamma(
i)) *
1427 (t_da(
i) * t_normal_dX(
i,
I));
1428 ++t_diff_base;
1429 ++t_nf;
1430 }
1431 for (; rr != nb_base_functions; ++rr)
1432 ++t_diff_base;
1433
1434 ++t_w;
1435 ++t_coords;
1436 ++t_var_u_gamma;
1437 ++t_tangent1;
1438 ++t_tangent2;
1439 }
1440
1442 };
1443
1444
1446 for (
auto &bc : *(
bcData)) {
1447 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1448
1449 double time_scale = 1;
1452 }
1453
1454 if (nb_dofs) {
1455 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
1457 y -= 44;
1458 y /= (60 - 44);
1459 return -y * (y - 1) / 0.25;
1460 };
1461 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1462 } else {
1464 bc, [](double, double, double) { return 1; }, time_scale);
1465 }
1466 }
1467 }
1468 }
1470}
#define FTENSOR_INDEXES(DIM,...)
#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
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
constexpr IntegrationType I
static PetscBool physicalTimeFlg
static double currentPhysicalTime
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
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.
VectorDouble nF
local right hand side vector