1474 {
1477
1484
1486 int nb_integration_pts = getGaussPts().size2();
1487 int nb_base_functions = data.
getN().size2();
1488
1489#ifndef NDEBUG
1490 if (this->
nF.size() != nb_dofs)
1492 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1493#endif
1494
1495 auto integrate_rhs = [&](auto &bc) {
1497
1498 auto v_analytical_expr =
1500
1503 auto t_w = getFTensor0IntegrationWeight();
1504
1506 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1507 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1508
1509 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1510
1514
1515 double a = sqrt(t_normal(
i) * t_normal(
i));
1517 t_da(
i) = t_normal(
i) /
a;
1520
1521 locJ -= (t_w *
a) * (t_val(
i) * t_var_u_gamma(
i));
1522
1523 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1524 int rr = 0;
1525 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1530 t_nf(
I) -= t_w * (t_val(
i) * t_var_u_gamma(
i)) *
1531 (t_da(
i) * t_normal_dX(
i,
I));
1532 ++t_diff_base;
1533 ++t_nf;
1534 }
1535 for (; rr != nb_base_functions; ++rr)
1536 ++t_diff_base;
1537
1538 ++t_w;
1539 ++t_val;
1540 ++t_var_u_gamma;
1541 ++t_tangent1;
1542 ++t_tangent2;
1543 }
1544
1546 };
1547
1549 for (
auto &bc : *(
bcData)) {
1550 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1551 CHKERR integrate_rhs(bc);
1552 }
1553 }
1554
1556}
#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