362 {
364 switch (snes_ctx) {
365 case CTX_SNESSETFUNCTION: {
366
367 auto zero_vals = [&](
auto v) {
369 int size = problemPtr->getNbLocalDofsRow();
370 int ghosts = problemPtr->getNbGhostDofsRow();
371 double *array;
373 for (
int i = 0;
i != size + ghosts; ++
i)
375 CHKERR VecRestoreArray(
v, &array);
377 };
378
379 Vec l_x_lambda, l_f_lambda;
380 CHKERR VecGhostGetLocalForm(
arcPtr->xLambda, &l_x_lambda);
381 CHKERR VecGhostGetLocalForm(
arcPtr->F_lambda, &l_f_lambda);
382 CHKERR zero_vals(l_x_lambda);
383 CHKERR zero_vals(l_f_lambda);
384 CHKERR VecGhostRestoreLocalForm(
arcPtr->xLambda, &l_x_lambda);
385 CHKERR VecGhostRestoreLocalForm(
arcPtr->F_lambda, &l_f_lambda);
386
387 } break;
388 default:
390 "Lambda can be zeroed ONLY when the right hand side is evaluated.");
391 }
393}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)