MCPcopy Create free account
hub / github.com/IBAMR/IBAMR / FormFunction_SAMRAI

Method FormFunction_SAMRAI

ibtk/src/solvers/impls/PETScNewtonKrylovSolver.cpp:572–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572PetscErrorCode
573PETScNewtonKrylovSolver::FormFunction_SAMRAI(SNES /*snes*/, Vec x, Vec f, void* p_ctx)
574{
575 PetscFunctionBeginUser;
576 auto newton_solver = static_cast<PETScNewtonKrylovSolver*>(p_ctx);
577#if !defined(NDEBUG)
578 TBOX_ASSERT(newton_solver);
579 TBOX_ASSERT(newton_solver->d_F);
580#endif
581 Pointer<SAMRAIVectorReal<NDIM, double>> samrai_x, samrai_f;
582 PETScSAMRAIVectorReal::getSAMRAIVectorRead(x, &samrai_x);
583 PETScSAMRAIVectorReal::getSAMRAIVector(f, &samrai_f);
584 newton_solver->d_F->apply(*samrai_x, *samrai_f);
585 PETScSAMRAIVectorReal::restoreSAMRAIVectorRead(x, &samrai_x);
586 PETScSAMRAIVectorReal::restoreSAMRAIVector(f, &samrai_f);
587 PetscFunctionReturn(0);
588}
589
590PetscErrorCode
591PETScNewtonKrylovSolver::FormJacobian_SAMRAI(SNES snes, Vec x, Mat A, Mat /*B*/, void* p_ctx)

Callers

nothing calls this directly

Calls 1

applyMethod · 0.45

Tested by

no test coverage detected