Class dedicated to integrate operator.
1512 {
1518
1520 auto nb_gauss_pts = getGaussPts().size2();
1521
1522 auto objective_dstress =
1523 boost::make_shared<MatrixDouble>(nb_gauss_pts, symm_size);
1524 auto objective_dstrain =
1525 boost::make_shared<MatrixDouble>(nb_gauss_pts, symm_size);
1526 auto objective_du =
1527 boost::make_shared<MatrixDouble>(nb_gauss_pts,
SPACE_DIM);
1528
1529 auto evaluate_python = [&]() {
1531 auto &coords = OP::getCoordsAtGaussPts();
1534 objective_dstress);
1537 objective_dstrain);
1540 objective_du);
1541
1542 auto vol = OP::getMeasure();
1543 auto t_w = OP::getFTensor0IntegrationWeight();
1544
1545 auto t_D =
1546 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*(
commPtr->matDPtr));
1547 auto t_row_grad = data.getFTensor1DiffN<
SPACE_DIM>();
1548 auto t_row_base = data.getFTensor0N();
1549
1550 auto t_obj_dstress =
1551 getFTensor2SymmetricFromMat<SPACE_DIM>(*objective_dstress);
1552 auto t_obj_dstrain =
1553 getFTensor2SymmetricFromMat<SPACE_DIM>(*objective_dstrain);
1554 auto t_obj_du = getFTensor1FromMat<SPACE_DIM>(*objective_du);
1555
1556 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
1557 const double alpha = t_w * vol;
1559 t_adjoint_stress(
i,
j) =
1560 t_D(
i,
j,
k,
l) * t_obj_dstress(
k,
l) + t_obj_dstrain(
i,
j);
1561
1562 auto t_nf = OP::template getNf<SPACE_DIM>();
1563 int rr = 0;
1565 t_nf(
j) += alpha * t_row_grad(
i) * t_adjoint_stress(
i,
j);
1566 t_nf(
j) += alpha * t_row_base * t_obj_du(
j);
1567
1568 ++t_row_grad;
1569 ++t_row_base;
1570 ++t_nf;
1571 }
1572
1574 ++t_row_grad;
1575 ++t_row_base;
1576 }
1577 ++t_obj_dstrain;
1578 ++t_obj_dstress;
1579 ++t_obj_du;
1580 ++t_w;
1581 }
1583 };
1584 CHKERR evaluate_python();
1586 }
#define FTENSOR_INDEX(DIM, I)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
constexpr int SPACE_DIM
[Define dimension]
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
int nbRows
number of dofs on rows
int nbRowBaseFunctions
number or row base functions