1333 {
1336
1340
1341 int nb_dofs =
data.getFieldData().size();
1342 int nb_integration_pts = getGaussPts().size2();
1343 int nb_base_functions =
data.getN().size2();
1344
1345 double time = getFEMethod()->ts_t;
1348 }
1349
1350#ifndef NDEBUG
1351 if (this->
nF.size() != nb_dofs)
1353 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1354#endif
1355
1356 auto integrate_rhs = [&](auto &bc, auto calc_tau, double time_scale) {
1358
1359 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1360 auto t_diff_base =
data.getFTensor1DiffN<2>();
1361 auto t_w = getFTensor0IntegrationWeight();
1362 auto t_coords = getFTensor1CoordsAtGaussPts();
1363
1365 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1366 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1367
1368 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1369
1373
1374 double a = sqrt(t_normal(
i) * t_normal(
i));
1376 t_da(
i) = t_normal(
i) /
a;
1379
1380 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1381 locJ -= (time_scale * t_w *
a * tau) * (t_val(
i) * t_var_u_gamma(
i));
1382
1383 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1384 int rr = 0;
1385 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1390 t_nf(
I) -= (time_scale * t_w * tau) * (t_val(
i) * t_var_u_gamma(
i)) *
1391 (t_da(
i) * t_normal_dX(
i,
I));
1392 ++t_diff_base;
1393 ++t_nf;
1394 }
1395 for (; rr != nb_base_functions; ++rr)
1396 ++t_diff_base;
1397
1398 ++t_w;
1399 ++t_coords;
1400 ++t_var_u_gamma;
1401 ++t_tangent1;
1402 ++t_tangent2;
1403 }
1404
1406 };
1407
1408
1409 EntityHandle fe_ent = getFEEntityHandle();
1410 for (
auto &bc : *(
bcData)) {
1411 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1412
1413 double time_scale = 1;
1416 }
1417
1418 if (nb_dofs) {
1419 if (std::regex_match(bc.blockName, std::regex(".*COOK.*"))) {
1421 y -= 44;
1422 y /= (60 - 44);
1423 return -y * (y - 1) / 0.25;
1424 };
1425 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1426 } else {
1428 bc, [](double, double, double) { return 1; }, time_scale);
1429 }
1430 }
1431 }
1432 }
1434}
boost::shared_ptr< DataAtIntegrationPts > data
#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
VectorDouble nF
local right hand side vector