oomph::TrilinosIFPACKPreconditioner Class Reference

#include <trilinos_preconditioners.h>

+ Inheritance diagram for oomph::TrilinosIFPACKPreconditioner:

Public Member Functions

 TrilinosIFPACKPreconditioner ()
 Constructor. More...
 
virtual ~TrilinosIFPACKPreconditioner ()
 Destructor – empty, cleanup is done in base class. More...
 
 TrilinosIFPACKPreconditioner (const TrilinosIFPACKPreconditioner &)=delete
 Broken copy constructor. More...
 
void set_preconditioner_ILU ()
 Broken assignment operator. More...
 
void set_preconditioner_ILUT ()
 Function to set Preconditioner_type to "ILUT". More...
 
intilu_fill_level ()
 Access function for ILU_fill_level. More...
 
doubleilut_fill_level ()
 Access function for ILUT_fill_level. More...
 
doubleabsolute_threshold ()
 Access function for the absolute threshold. More...
 
doublerelative_threshold ()
 Access function for the relative threshold. More...
 
- Public Member Functions inherited from oomph::TrilinosPreconditionerBase
 TrilinosPreconditionerBase ()
 Constructor. More...
 
virtual ~TrilinosPreconditionerBase ()
 Destructor. More...
 
void clean_up_memory ()
 deletes the preconditioner, matrices and maps More...
 
 TrilinosPreconditionerBase (const TrilinosPreconditionerBase &)=delete
 Broken copy constructor. More...
 
void setup ()
 Broken assignment operator. More...
 
void setup (Epetra_CrsMatrix *epetra_matrix_pt)
 
void preconditioner_solve (const DoubleVector &r, DoubleVector &z)
 applies the preconditioner More...
 
Epetra_Operator *& epetra_operator_pt ()
 
Epetra_Operatorepetra_operator_pt () const
 
- Public Member Functions inherited from oomph::Preconditioner
 Preconditioner ()
 Constructor. More...
 
 Preconditioner (const Preconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const Preconditioner &)=delete
 Broken assignment operator. More...
 
virtual ~Preconditioner ()
 Destructor (empty) More...
 
virtual void preconditioner_solve_transpose (const DoubleVector &r, DoubleVector &z)
 
void setup (DoubleMatrixBase *matrix_pt)
 
void setup (const Problem *problem_pt, DoubleMatrixBase *matrix_pt)
 
void enable_silent_preconditioner_setup ()
 Set up the block preconditioner quietly! More...
 
void disable_silent_preconditioner_setup ()
 Be verbose in the block preconditioner setup. More...
 
virtual DoubleMatrixBasematrix_pt () const
 Get function for matrix pointer. More...
 
virtual void set_matrix_pt (DoubleMatrixBase *matrix_pt)
 Set the matrix pointer. More...
 
virtual const OomphCommunicatorcomm_pt () const
 Get function for comm pointer. More...
 
virtual void set_comm_pt (const OomphCommunicator *const comm_pt)
 Set the communicator pointer. More...
 
double setup_time () const
 Returns the time to setup the preconditioner. More...
 
virtual void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse)
 
virtual void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse, const Vector< Vector< unsigned >> &doftype_coarsen_map_coarse)
 
- Public Member Functions inherited from oomph::DistributableLinearAlgebraObject
 DistributableLinearAlgebraObject ()
 Default constructor - create a distribution. More...
 
 DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete
 Broken copy constructor. More...
 
void operator= (const DistributableLinearAlgebraObject &)=delete
 Broken assignment operator. More...
 
virtual ~DistributableLinearAlgebraObject ()
 Destructor. More...
 
LinearAlgebraDistributiondistribution_pt () const
 access to the LinearAlgebraDistribution More...
 
unsigned nrow () const
 access function to the number of global rows. More...
 
unsigned nrow_local () const
 access function for the num of local rows on this processor. More...
 
unsigned nrow_local (const unsigned &p) const
 access function for the num of local rows on this processor. More...
 
unsigned first_row () const
 access function for the first row on this processor More...
 
unsigned first_row (const unsigned &p) const
 access function for the first row on this processor More...
 
bool distributed () const
 distribution is serial or distributed More...
 
bool distribution_built () const
 
void build_distribution (const LinearAlgebraDistribution *const dist_pt)
 
void build_distribution (const LinearAlgebraDistribution &dist)
 

Protected Member Functions

void setup_trilinos_preconditioner (Epetra_CrsMatrix *epetra_matrix_pt)
 
- Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject
void clear_distribution ()
 

Protected Attributes

string Preconditioner_type
 Type of ILU preconditioner. More...
 
int ILU_fill_level
 Level of fill for "ILU". More...
 
double ILUT_fill_level
 Level of fill for "ILUT". More...
 
int Overlap
 Value of overlap level - used in parallel ILU. More...
 
double Absolute_threshold
 Value of absolute threshold, used to peturb diagonal. More...
 
double Relative_threshold
 Value of relative threshold, used to pertub diagonal. More...
 
- Protected Attributes inherited from oomph::TrilinosPreconditionerBase
Epetra_OperatorEpetra_preconditioner_pt
 
Epetra_CrsMatrix * Epetra_matrix_pt
 
- Protected Attributes inherited from oomph::Preconditioner
bool Silent_preconditioner_setup
 Boolean to indicate whether or not the build should be done silently. More...
 
std::ostream * Stream_pt
 Pointer to the output stream – defaults to std::cout. More...
 

Additional Inherited Members

- Static Public Attributes inherited from oomph::TrilinosPreconditionerBase
static double Cumulative_preconditioner_solve_time = 0.0
 

Detailed Description

An interface to the Trilinos IFPACK class- provides a function to construct an IFPACK object, and functions to modify some of the IFPACK paramaters.

Constructor & Destructor Documentation

◆ TrilinosIFPACKPreconditioner() [1/2]

oomph::TrilinosIFPACKPreconditioner::TrilinosIFPACKPreconditioner ( )
inline

Constructor.

272  {
273  // set default values
274  Preconditioner_type = "ILU";
275  ILU_fill_level = 0;
276  ILUT_fill_level = 1.0;
277  Overlap = 0;
278  Absolute_threshold = 0.0;
279  Relative_threshold = 1.0;
280  }
double Absolute_threshold
Value of absolute threshold, used to peturb diagonal.
Definition: trilinos_preconditioners.h:345
string Preconditioner_type
Type of ILU preconditioner.
Definition: trilinos_preconditioners.h:333
int ILU_fill_level
Level of fill for "ILU".
Definition: trilinos_preconditioners.h:336
double ILUT_fill_level
Level of fill for "ILUT".
Definition: trilinos_preconditioners.h:339
double Relative_threshold
Value of relative threshold, used to pertub diagonal.
Definition: trilinos_preconditioners.h:348
int Overlap
Value of overlap level - used in parallel ILU.
Definition: trilinos_preconditioners.h:342

References Absolute_threshold, ILU_fill_level, ILUT_fill_level, Overlap, Preconditioner_type, and Relative_threshold.

◆ ~TrilinosIFPACKPreconditioner()

virtual oomph::TrilinosIFPACKPreconditioner::~TrilinosIFPACKPreconditioner ( )
inlinevirtual

Destructor – empty, cleanup is done in base class.

283 {}

◆ TrilinosIFPACKPreconditioner() [2/2]

oomph::TrilinosIFPACKPreconditioner::TrilinosIFPACKPreconditioner ( const TrilinosIFPACKPreconditioner )
delete

Broken copy constructor.

Member Function Documentation

◆ absolute_threshold()

double& oomph::TrilinosIFPACKPreconditioner::absolute_threshold ( )
inline

Access function for the absolute threshold.

317  {
318  return Absolute_threshold;
319  }

References Absolute_threshold.

◆ ilu_fill_level()

int& oomph::TrilinosIFPACKPreconditioner::ilu_fill_level ( )
inline

Access function for ILU_fill_level.

305  {
306  return ILU_fill_level;
307  }

References ILU_fill_level.

◆ ilut_fill_level()

double& oomph::TrilinosIFPACKPreconditioner::ilut_fill_level ( )
inline

Access function for ILUT_fill_level.

311  {
312  return ILUT_fill_level;
313  }

References ILUT_fill_level.

◆ relative_threshold()

double& oomph::TrilinosIFPACKPreconditioner::relative_threshold ( )
inline

Access function for the relative threshold.

323  {
324  return Relative_threshold;
325  }

References Relative_threshold.

◆ set_preconditioner_ILU()

void oomph::TrilinosIFPACKPreconditioner::set_preconditioner_ILU ( )
inline

Broken assignment operator.

Function to set Preconditioner_type to "ILU"

293  {
294  Preconditioner_type = "ILU";
295  }

References Preconditioner_type.

◆ set_preconditioner_ILUT()

void oomph::TrilinosIFPACKPreconditioner::set_preconditioner_ILUT ( )
inline

Function to set Preconditioner_type to "ILUT".

299  {
300  Preconditioner_type = "ILUT";
301  }

References Preconditioner_type.

◆ setup_trilinos_preconditioner()

void oomph::TrilinosIFPACKPreconditioner::setup_trilinos_preconditioner ( Epetra_CrsMatrix *  epetra_matrix_pt)
protectedvirtual

Function to set up an IFPACK preconditioner. It is assumed Trilinos_matrix_pt points to a suitable matrix.

//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////

Implements oomph::TrilinosPreconditionerBase.

239  {
240  // set up a parameter list
241  Teuchos::ParameterList ifpack_parameters;
242  ifpack_parameters.set("fact: level-of-fill", ILU_fill_level);
243  ifpack_parameters.set("fact: ilut level-of-fill", ILUT_fill_level);
244  ifpack_parameters.set("fact: absolute threshold", Absolute_threshold);
245  ifpack_parameters.set("fact: relative threshold", Relative_threshold);
246 
247  // create the preconditioner
248  Ifpack ifpack_factory;
249  Ifpack_Preconditioner* tmp_pt =
250  ifpack_factory.Create(Preconditioner_type, epetra_matrix_pt, Overlap);
251 
252  tmp_pt->SetParameters(ifpack_parameters);
253  tmp_pt->Initialize();
254  tmp_pt->Compute();
255 
256  // Now store the pointer to the newly created Ifpack_Preconditioner
257  Epetra_preconditioner_pt = tmp_pt;
258  }
Epetra_Operator * Epetra_preconditioner_pt
Definition: trilinos_preconditioners.h:138

References Absolute_threshold, oomph::TrilinosPreconditionerBase::Epetra_preconditioner_pt, ILU_fill_level, ILUT_fill_level, Overlap, Preconditioner_type, and Relative_threshold.

Member Data Documentation

◆ Absolute_threshold

double oomph::TrilinosIFPACKPreconditioner::Absolute_threshold
protected

Value of absolute threshold, used to peturb diagonal.

Referenced by absolute_threshold(), setup_trilinos_preconditioner(), and TrilinosIFPACKPreconditioner().

◆ ILU_fill_level

int oomph::TrilinosIFPACKPreconditioner::ILU_fill_level
protected

◆ ILUT_fill_level

double oomph::TrilinosIFPACKPreconditioner::ILUT_fill_level
protected

◆ Overlap

int oomph::TrilinosIFPACKPreconditioner::Overlap
protected

Value of overlap level - used in parallel ILU.

Referenced by setup_trilinos_preconditioner(), and TrilinosIFPACKPreconditioner().

◆ Preconditioner_type

string oomph::TrilinosIFPACKPreconditioner::Preconditioner_type
protected

◆ Relative_threshold

double oomph::TrilinosIFPACKPreconditioner::Relative_threshold
protected

Value of relative threshold, used to pertub diagonal.

Referenced by relative_threshold(), setup_trilinos_preconditioner(), and TrilinosIFPACKPreconditioner().


The documentation for this class was generated from the following files: