1373 {
1376
1380
1382 int nb_integration_pts = getGaussPts().size2();
1383 int nb_base_functions = data.
getN().size2();
1384
1385 double time = getFEMethod()->ts_t;
1388 }
1389
1390#ifndef NDEBUG
1391 if (this->
nF.size() != nb_dofs)
1393 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1394#endif
1395
1396 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1398
1399 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1401 auto t_w = getFTensor0IntegrationWeight();
1402 auto t_coords = getFTensor1CoordsAtGaussPts();
1403
1405 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1406 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1407
1408 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1409
1413
1414 double a = sqrt(t_normal(
i) * t_normal(
i));
1416 t_da(
i) = t_normal(
i) /
a;
1419
1420 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1421 locJ -= (time_scale * t_w *
a * tau) * (t_val(
i) * t_var_u_gamma(
i));
1422
1423 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1424 int rr = 0;
1425 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1430 t_nf(
I) -= (time_scale * t_w * tau) * (t_val(
i) * t_var_u_gamma(
i)) *
1431 (t_da(
i) * t_normal_dX(
i,
I));
1432 ++t_diff_base;
1433 ++t_nf;
1434 }
1435 for (; rr != nb_base_functions; ++rr)
1436 ++t_diff_base;
1437
1438 ++t_w;
1439 ++t_coords;
1440 ++t_var_u_gamma;
1441 ++t_tangent1;
1442 ++t_tangent2;
1443 }
1444
1446 };
1447
1448
1450 for (
auto &bc : *(
bcData)) {
1451 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1452
1453 double time_scale = 1;
1456 }
1457
1458 if (nb_dofs) {
1459 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
1461 y -= 44;
1462 y /= (60 - 44);
1463 return -y * (y - 1) / 0.25;
1464 };
1465 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1466 } else {
1468 bc, [](double, double, double) { return 1; }, time_scale);
1469 }
1470 }
1471 }
1472 }
1474}
#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