352 {
354 switch (snes_ctx) {
355 case CTX_SNESSETFUNCTION: {
356
357 auto zero_vals = [&](
auto v) {
359 int size = problemPtr->getNbLocalDofsRow();
360 int ghosts = problemPtr->getNbGhostDofsRow();
361 double *array;
363 for (
int i = 0;
i != size + ghosts; ++
i)
365 CHKERR VecRestoreArray(
v, &array);
367 };
368
369 Vec l_x_lambda, l_f_lambda;
370 CHKERR VecGhostGetLocalForm(
arcPtr->xLambda, &l_x_lambda);
371 CHKERR VecGhostGetLocalForm(
arcPtr->F_lambda, &l_f_lambda);
372 CHKERR zero_vals(l_x_lambda);
373 CHKERR zero_vals(l_f_lambda);
374 CHKERR VecGhostRestoreLocalForm(
arcPtr->xLambda, &l_x_lambda);
375 CHKERR VecGhostRestoreLocalForm(
arcPtr->F_lambda, &l_f_lambda);
376
377 } break;
378 default:
380 "Lambda can be zeroed ONLY when the right hand side is evaluated.");
381 }
383}
#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)
const FTensor::Tensor2< T, Dim, Dim > Vec