1334 {
1335
1338 auto &ep = *(cohesive_ctx->ep_ptr);
1339
1340#ifndef NDEBUG
1341 CHKERR VecView(delta_kappa, PETSC_VIEWER_STDOUT_WORLD);
1342#endif
1343
1344 CHKERR VecCopy(delta_kappa, cohesive_ctx->kappaVec.second);
1345 CHKERR VecGhostUpdateBegin(cohesive_ctx->kappaVec.second, INSERT_VALUES,
1346 SCATTER_FORWARD);
1347 CHKERR VecGhostUpdateEnd(cohesive_ctx->kappaVec.second, INSERT_VALUES,
1348 SCATTER_FORWARD);
1350 ep.mField.get_moab(), cohesive_ctx->kappaVec,
1352
1353
1355 cohesive_ctx->kspSolVec);
1356
1359 ksp, cohesive_ctx->lambdaVec);
1360
1362 ep, cohesive_ctx->setIntegrationAtFrontFace, cohesive_ctx->lambdaVec,
1363 cohesive_ctx->dissipationVec, cohesive_ctx->gradDissipationVec);
1364
1365 CHKERR VecSum(cohesive_ctx->dissipationVec.second, f);
1366 CHKERR VecCopy(cohesive_ctx->gradDissipationVec.second,
g);
1367
1369 <<
"Cohesive objective function (negative total dissipation): " << *
f;
1370
1372}
#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.
#define MOFEM_LOG(channel, severity)
Log.
Tag get_delta_kappa_tag(moab::Interface &moab)
static MoFEMErrorCode evaluateDissipationAndGradImpl(EshelbianCore &ep, ForcesAndSourcesCore::GaussHookFun set_integration_at_front_face, SmartPetscObj< Vec > lambda_vec, CommInterface::EntitiesPetscVector &dissipation_vec, CommInterface::EntitiesPetscVector &grad_dissipation_vec)
static MoFEMErrorCode evaluatePrimalProblemCohesiveImpl(EshelbianCore &ep, SmartPetscObj< TS > ts, SmartPetscObj< Vec > x)
static MoFEMErrorCode evaluateCohesiveLambdaImpl(EshelbianCore &ep, ForcesAndSourcesCore::GaussHookFun set_integration_at_front_face, SmartPetscObj< KSP > ksp, SmartPetscObj< Vec > lambda_vec)
auto snesGetKSP(SNES snes)
CohesiveTAOCtxImpl(EshelbianCore *ep, ForcesAndSourcesCore::GaussHookFun set_integration_at_front_face, SmartPetscObj< TS > time_solver)
static MoFEMErrorCode setTagFromVector(moab::Interface &moab, EntitiesPetscVector &vec, Tag tag)