1478 {
1481
1488
1490 int nb_integration_pts = getGaussPts().size2();
1491 int nb_base_functions = data.
getN().size2();
1492
1493#ifndef NDEBUG
1494 if (this->
nF.size() != nb_dofs)
1496 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1497#endif
1498
1499 auto integrate_rhs = [&](auto &bc) {
1501
1502 auto v_analytical_expr =
1504
1507 auto t_w = getFTensor0IntegrationWeight();
1508
1510 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1511 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1512
1513 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1514
1518
1519 double a = sqrt(t_normal(
i) * t_normal(
i));
1521 t_da(
i) = t_normal(
i) /
a;
1524
1525 locJ -= (t_w *
a) * (t_val(
i) * t_var_u_gamma(
i));
1526
1527 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1528 int rr = 0;
1529 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1534 t_nf(
I) -= t_w * (t_val(
i) * t_var_u_gamma(
i)) *
1535 (t_da(
i) * t_normal_dX(
i,
I));
1536 ++t_diff_base;
1537 ++t_nf;
1538 }
1539 for (; rr != nb_base_functions; ++rr)
1540 ++t_diff_base;
1541
1542 ++t_w;
1543 ++t_val;
1544 ++t_var_u_gamma;
1545 ++t_tangent1;
1546 ++t_tangent2;
1547 }
1548
1550 };
1551
1553 for (
auto &bc : *(
bcData)) {
1554 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1555 CHKERR integrate_rhs(bc);
1556 }
1557 }
1558
1560}
#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
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