1438 {
1441
1448
1449 int nb_dofs =
data.getFieldData().size();
1450 int nb_integration_pts = getGaussPts().size2();
1451 int nb_base_functions =
data.getN().size2();
1452
1453#ifndef NDEBUG
1454 if (this->
nF.size() != nb_dofs)
1456 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1457#endif
1458
1459 auto integrate_rhs = [&](auto &bc) {
1461
1463
1465 auto t_diff_base =
data.getFTensor1DiffN<2>();
1466 auto t_w = getFTensor0IntegrationWeight();
1467
1469 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1470 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1471
1472 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1473
1477
1478 double a = sqrt(t_normal(
i) * t_normal(
i));
1480 t_da(
i) = t_normal(
i) /
a;
1483
1484 locJ -= (t_w *
a) * (t_val(
i) * t_var_u_gamma(
i));
1485
1486 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1487 int rr = 0;
1488 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1494 t_w * (t_val(
i) * t_var_u_gamma(
i)) * (t_da(
i) * t_normal_dX(
i,
I));
1495 ++t_diff_base;
1496 ++t_nf;
1497 }
1498 for (; rr != nb_base_functions; ++rr)
1499 ++t_diff_base;
1500
1501 ++t_w;
1502 ++t_val;
1503 ++t_var_u_gamma;
1504 ++t_tangent1;
1505 ++t_tangent2;
1506 }
1507
1509 };
1510
1511 EntityHandle fe_ent = getFEEntityHandle();
1512 for (
auto &bc : *(
bcData)) {
1513 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1514 CHKERR integrate_rhs(bc);
1515 }
1516 }
1517
1519}
boost::shared_ptr< DataAtIntegrationPts > data
#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 MatrixDouble getTopologicalAnalyticalExpr(OP_PTR op_ptr, const std::string &block_name)
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
auto getFTensor1FromMat(M &data, int rr=0, int cc=0)
Get tensor rank 1 (vector) form data matrix.
constexpr IntegrationType I
VectorDouble nF
local right hand side vector