Feel++  0.91.0
Public Member Functions
Feel::SolverNonLinearPetsc< T > Class Template Reference

Petsc non linear solvers interface. More...

#include <solvernonlinearpetsc.hpp>

Inheritance diagram for Feel::SolverNonLinearPetsc< T >:
Feel::SolverNonLinear< T >

List of all members.

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

DataMap const & mapRow () const
DataMap const & mapCol () const
void setMapRow (DataMap const &d)
void setMapCol (DataMap const &d)
Constructors, destructor
 SolverNonLinearPetsc ()
 SolverNonLinearPetsc (SolverNonLinearPetsc const &)
 ~SolverNonLinearPetsc ()
virtual void init ()
Mutators
void setReuse (int jac=1, int prec=1)
Methods
virtual void clear ()
virtual std::pair< 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)

Detailed Description

template<typename T>
class Feel::SolverNonLinearPetsc< T >

Petsc non linear solvers interface.

This class provides an interface to PETSc iterative solvers that is compatible with the SolverNonLinear<> base class

Author:
Christophe Prud'homme

Constructor & Destructor Documentation

template<typename T >
Feel::SolverNonLinearPetsc< T >::SolverNonLinearPetsc ( ) [inline]

Constructor. Initializes Petsc data structures

template<typename T >
Feel::SolverNonLinearPetsc< T >::~SolverNonLinearPetsc ( ) [inline]

Destructor.


Member Function Documentation

template<typename T >
void Feel::SolverNonLinearPetsc< T >::clear ( ) [virtual]

Release all memory and clear data structures.

Reimplemented from Feel::SolverNonLinear< T >.

template<typename T >
void Feel::SolverNonLinearPetsc< T >::init ( ) [virtual]

Initialize data structures if not done so already.

Implements Feel::SolverNonLinear< T >.

References Feel::__feel_petsc_preconditioner_setup(), and __feel_petsc_snes_monitor().

template<typename T >
void Feel::SolverNonLinearPetsc< T >::setReuse ( int  jac = 1,
int  prec = 1 
) [virtual]

set reuse jacobian and/or preconditioner

  • jac=-1: means never rebuilt (preconditioner is not rebuit either)
  • jac=-2: build at each new nonlinear iterations (preconditioner is not rebuit either)
  • jac= 1: build at each new nonlinear iterations (rebuild jacobian every single nonlinear iteration)
  • jac= <n> (n>1): build every n iterations when jac >= n, prec=-1 (rebuilt once at each new nonlinear iteration) when jac >= n, prec=-1 (rebuilt once at each new nonlinear iteration)

Reimplemented from Feel::SolverNonLinear< T >.

template<typename T >
std::pair< 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(), and Feel::VectorPetsc< T >::vec().

template<typename T >
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().