Feel++ 0.91.0
|
Petsc non linear solvers interface. More...
#include <solvernonlinearpetsc.hpp>
Public Types | |
Typedefs | |
typedef SolverNonLinearPetsc< T > | self_type |
typedef super::value_type | value_type |
typedef super::real_type | real_type |
typedef super::sparse_matrix_ptrtype | sparse_matrix_ptrtype |
typedef super::vector_ptrtype | vector_ptrtype |
typedef super::dense_matrix_type | dense_matrix_type |
typedef super::dense_vector_type | dense_vector_type |
Public Member Functions | |
Constructors, destructor | |
SolverNonLinearPetsc () | |
SolverNonLinearPetsc (SolverNonLinearPetsc const &) | |
~SolverNonLinearPetsc () | |
virtual void | init () |
Methods | |
virtual void | clear () |
virtual std::pair< unsigned int, real_type > | solve (sparse_matrix_ptrtype &, vector_ptrtype &, vector_ptrtype &, const double, const unsigned int) |
virtual std::pair< unsigned int, real_type > | solve (dense_matrix_type &, dense_vector_type &, dense_vector_type &, const double, const unsigned int) |
Petsc non linear solvers interface.
This class provides an interface to PETSc iterative solvers that is compatible with the SolverNonLinear<>
base class
Feel::SolverNonLinearPetsc< T >::SolverNonLinearPetsc | ( | ) | [inline] |
Constructor. Initializes Petsc data structures
Feel::SolverNonLinearPetsc< T >::~SolverNonLinearPetsc | ( | ) | [inline] |
Destructor.
void Feel::SolverNonLinearPetsc< T >::clear | ( | ) | [virtual] |
Release all memory and clear data structures.
Reimplemented from Feel::SolverNonLinear< T >.
void Feel::SolverNonLinearPetsc< T >::init | ( | ) | [virtual] |
Initialize data structures if not done so already.
Implements Feel::SolverNonLinear< T >.
std::pair< unsigned int, typename SolverNonLinearPetsc< T >::real_type > Feel::SolverNonLinearPetsc< T >::solve | ( | sparse_matrix_ptrtype & | jac_in, |
vector_ptrtype & | x_in, | ||
vector_ptrtype & | r_in, | ||
const double | , | ||
const unsigned | int | ||
) | [virtual] |
Call the Petsc solver. It calls the method below, using the same matrix for the system and preconditioner matrices.
Implements Feel::SolverNonLinear< T >.
References __feel_petsc_snes_jacobian(), __feel_petsc_snes_monitor(), Feel::MatrixPetsc< T >::mat(), and Feel::VectorPetsc< T >::vec().
std::pair< unsigned int, typename SolverNonLinearPetsc< T >::real_type > Feel::SolverNonLinearPetsc< T >::solve | ( | dense_matrix_type & | , |
dense_vector_type & | , | ||
dense_vector_type & | , | ||
const double | , | ||
const unsigned | int | ||
) | [virtual] |
Solves a sparse nonlinear system.
Implements Feel::SolverNonLinear< T >.
References __feel_petsc_snes_dense_jacobian().