Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
|
#include <AbstractNonlinearSolver.hpp>
Public Member Functions | |
virtual Vec | Solve (PetscErrorCode(*pComputeResidual)(SNES, Vec, Vec, void *), PetscErrorCode(*pComputeJacobian)(SNES, Vec, Mat *, Mat *, MatStructure *, void *), Vec initialGuess, unsigned fill, void *pContext)=0 |
virtual | ~AbstractNonlinearSolver () |
Abstract Nonlinear equation system solver, dictates that each solver must have a Solve function.
Definition at line 46 of file AbstractNonlinearSolver.hpp.
|
inlinevirtual |
Destructor.
Definition at line 88 of file AbstractNonlinearSolver.hpp.
|
pure virtual |
Pure virtual Solve() method.
pComputeResidual | points to the function which computes the residual, it must take arguments SNES (a PETSc nonlinear solver object), Vec (current guess - a vector of the correct size), Vec (a Vec of the correct size in which the residual is returned), void* (a pointer to anything you may need to refer to when calculating the residual) |
pComputeJacobian | points to the function which computes the Jacobian, it must take arguments SNES (a PETSc nonlinear solver * object), Mat* (a pointer to the Jacobian matrix) ,Mat* (a pointer to a preconditioner matrix), MatStructure* (points to the PETSc matrix type e.g. AIJ), void* (a pointer to anything you may need to refer to when calculating the residual). |
initialGuess | A PETSc Vec of the correct size, containing initial guesses for the nonlinear solver. |
pContext | [optional] A pointer to a class that may have to be used in the ComputeResidual and ComputeJacobian functions |
fill | the expected maximum number of nonzeros in a row of the Jacobian matrix |
Implemented in SimpleNewtonNonlinearSolver, and SimplePetscNonlinearSolver.