static char help[] =
"...\n\n";
};
auto fun = [](
const double x,
const double y,
const double z) {
return x + y + x * x + y * y;
};
private:
boost::shared_ptr<MatrixDouble> invJacPtr;
boost::shared_ptr<VectorDouble> approxVals;
boost::shared_ptr<MatrixDouble> approxGradVals;
boost::shared_ptr<MatrixDouble> approxHessianVals;
};
};
boost::shared_ptr<CommonData> commonDataPtr;
OpError(boost::shared_ptr<MatrixDouble> data_ptr)
const int nb_integration_pts = getGaussPts().size2();
auto t_val = getFTensor1FromMat<1>(
*(dataPtr));
auto t_coords = getFTensor1CoordsAtGaussPts();
for (int gg = 0; gg != nb_integration_pts; ++gg) {
double diff = t_val(0) -
fun(t_coords(0), t_coords(1), t_coords(2));
constexpr
double eps = 1e-8;
if (std::abs(diff) >
eps) {
MOFEM_LOG(
"SELF", Sev::error) <<
"Wrong function value " << diff;
"Wrong function value");
}
++t_val;
++t_coords;
}
MOFEM_LOG(
"SELF", Sev::noisy) <<
"All is OK";
}
private:
boost::shared_ptr<MatrixDouble> dataPtr;
};
}
CHKERR mField.getInterface(simpleInterface);
CHKERR simpleInterface->getOptions();
CHKERR simpleInterface->loadFile();
}
CHKERR simpleInterface->setUp();
}
auto rule = [](
int,
int,
int p) ->
int {
return 2 * p; };
}
MOFEM_LOG(
"WORLD", Sev::inform) <<
"Solve problem";
CHKERR KSPSetFromOptions(solver);
auto dm = simpleInterface->getDM();
CHKERR VecGhostUpdateBegin(
D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateEnd(
D, INSERT_VALUES, SCATTER_FORWARD);
}
pipeline_mng->getDomainLhsFE().reset();
pipeline_mng->getDomainRhsFE().reset();
pipeline_mng->getOpDomainRhsPipeline().clear();
auto rule = [](
int,
int,
int p) ->
int {
return 2 * p + 1; };
CHKERR pipeline_mng->setDomainRhsIntegrationRule(
rule);
auto entity_data_l2 = boost::make_shared<EntitiesFieldData>(
MBENTITYSET);
auto mass_ptr = boost::make_shared<MatrixDouble>();
auto coeffs_ptr =
boost::make_shared<MatrixDouble>();
auto data_ptr =
boost::make_shared<MatrixDouble>();
auto op_this =
pipeline_mng->getOpDomainRhsPipeline().push_back(op_this);
pipeline_mng->getOpDomainRhsPipeline().push_back(
auto fe_physics_ptr = op_this->getThisFEPtr();
fe_physics_ptr->getRuleHook = [](
int,
int,
int p) {
return 2 * p; };
fe_physics_ptr->getOpPtrVector().push_back(
data_ptr));
fe_physics_ptr->getOpPtrVector().push_back(
CHKERR pipeline_mng->loopFiniteElements();
}
int main(
int argc,
char *argv[]) {
try {
DMType dm_name = "DMMOFEM";
}
}