Public Member Functions | Private Member Functions | Private Attributes | List of all members
oomph::PreconditionerArray Class Reference

PreconditionerArray - NOTE - first implementation, a number of assumptions / simplifications were made: More...

#include <preconditioner_array.h>

Public Member Functions

void setup_preconditioners (Vector< CRDoubleMatrix * > matrix_pt, Vector< Preconditioner * > prec_pt, const OomphCommunicator *comm_pt)
 Setup the preconditioners. Sets up each preconditioner in the array for the corresponding matrix in the vector matrix_pt. The number of preconditioners in the array is taken to be the length of prec_pt. More...
 
void solve_preconditioners (const Vector< DoubleVector > &r, Vector< DoubleVector > &z)
 Applies each preconditioner to the corresponding vector in r and z. More...
 
 PreconditionerArray ()
 Constructor (empty) More...
 
 PreconditionerArray (const PreconditionerArray &)=delete
 Broken copy constructor. More...
 
void operator= (const PreconditionerArray &)=delete
 Broken assignment operator. More...
 
 ~PreconditionerArray ()
 Destructor (empty) More...
 
void setup_preconditioners (Vector< CRDoubleMatrix * > matrix_pt, Vector< Preconditioner * > prec_pt, const OomphCommunicator *comm_pt)
 Setup the preconditioners. Sets up each preconditioner in the array for the corresponding matrix in the vector matrix_pt. The number of preconditioners in the array is taken to be the length of prec_pt The preconditioners that are not used on this processor are deleted. More...
 
void solve_preconditioners (const Vector< DoubleVector > &r, Vector< DoubleVector > &z)
 Applies each preconditioner to the corresponding vector in r and z. More...
 
void clean_up_memory ()
 Clean up memory. More...
 
unsigned & method ()
 

Private Member Functions

int compute_tag (const int &nproc, const int &source, const int &dest, const int &type)
 helper method for computing the MPI_Isend and MPI_Irecv tags More...
 

Private Attributes

unsigned Nprec
 the number of preconditioner in the array More...
 
PreconditionerPreconditioner_pt
 The pointer to the local preconditioner on this processor. More...
 
Vector< unsigned > First_proc_for_prec
 The first_row component of the distribution of the processors over the preconditioners. More...
 
Vector< unsigned > Nproc_for_prec
 The nrow_local component of the distribution of the processors over the preconditioners. More...
 
Vector< Vector< unsigned > > First_row_for_proc
 Storage (indexed [i][j]) for the first row that will be sent from this processor to processor j for preconditioner i. More...
 
Vector< Vector< unsigned > > Nrow_local_for_proc
 Storage (indexed [i][j]) for the nrow_local that will be sent from this processor to processor j for preconditioner i. More...
 
Vector< Vector< unsigned > > First_row_from_proc
 Storage (indexed [i][j]) for the first row that will be received by this processor from processor j for preconditioner i. More...
 
Vector< Vector< unsigned > > Nrow_local_from_proc
 Storage (indexed [i][j]) for the nrow_local that will be received by this processor from processor j for preconditioner i. More...
 
unsigned Color
 the Color of this processor (or the preconditioner number) More...
 
OomphCommunicatorGlobal_communicator_pt
 pointer to the global communicator for this preconditioner array More...
 
OomphCommunicatorLocal_communicator_pt
 Vector of communicators for the preconditioners. More...
 
Vector< LinearAlgebraDistribution * > Distribution_pt
 
unsigned Method
 the communication method in the setup_preconditioners(...) method More...
 

Detailed Description

PreconditionerArray - NOTE - first implementation, a number of assumptions / simplifications were made:

  1. Only works with CRDoubleMatrices
  2. The number of processors must be greater than the number of preconditioners
  3. Currently only very crude load balancing - each preconditioner will be setup and applied with the same number of processors (or as near to as possible to the same number of processors)
  4. This class will, at the appropriate time, delete the all the Preconditioners passed setup_preconditioners(...)
  5. (but) Deletion of matrices passed to setup_preconditioners(...) is NOT performed by this class
  6. It is assumed that preconditioners do not require access to matrix once setup(...) is called
  7. The matrix on the subset of processors will be the same type (distributed or global) as the matrix passed to setup_preconditioners(...)
  8. If the matrix is a distributed matrix - it will be assembled with a uniform distribution on the subset of processors.

Definition at line 49 of file preconditioner_array.h.

Constructor & Destructor Documentation

◆ PreconditionerArray() [1/2]

oomph::PreconditionerArray::PreconditionerArray ( )
inline

Constructor (empty)

Definition at line 105 of file preconditioner_array.h.

References Method, and Nprec.

◆ PreconditionerArray() [2/2]

oomph::PreconditionerArray::PreconditionerArray ( const PreconditionerArray )
delete

Broken copy constructor.

◆ ~PreconditionerArray()

oomph::PreconditionerArray::~PreconditionerArray ( )
inline

Destructor (empty)

Definition at line 121 of file preconditioner_array.h.

References clean_up_memory().

Member Function Documentation

◆ clean_up_memory()

void oomph::PreconditionerArray::clean_up_memory ( )
inline

◆ compute_tag()

int oomph::PreconditionerArray::compute_tag ( const int &  nproc,
const int &  source,
const int &  dest,
const int &  type 
)
inlineprivate

helper method for computing the MPI_Isend and MPI_Irecv tags

Definition at line 182 of file preconditioner_array.h.

◆ method()

unsigned& oomph::PreconditionerArray::method ( )
inline

Definition at line 175 of file preconditioner_array.h.

References Method.

◆ operator=()

void oomph::PreconditionerArray::operator= ( const PreconditionerArray )
delete

Broken assignment operator.

◆ setup_preconditioners() [1/2]

void oomph::PreconditionerArray::setup_preconditioners ( Vector< CRDoubleMatrix * >  matrix_pt,
Vector< Preconditioner * >  prec_pt,
const OomphCommunicator comm_pt 
)
inline

Setup the preconditioners. Sets up each preconditioner in the array for the corresponding matrix in the vector matrix_pt. The number of preconditioners in the array is taken to be the length of prec_pt.

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

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

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

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

Definition at line 52 of file preconditioner_array.h.

◆ setup_preconditioners() [2/2]

void oomph::PreconditionerArray::setup_preconditioners ( Vector< CRDoubleMatrix * >  matrix_pt,
Vector< Preconditioner * >  prec_pt,
const OomphCommunicator comm_pt 
)

Setup the preconditioners. Sets up each preconditioner in the array for the corresponding matrix in the vector matrix_pt. The number of preconditioners in the array is taken to be the length of prec_pt The preconditioners that are not used on this processor are deleted.

◆ solve_preconditioners() [1/2]

void oomph::PreconditionerArray::solve_preconditioners ( const Vector< DoubleVector > &  r,
Vector< DoubleVector > &  z 
)
inline

Applies each preconditioner to the corresponding vector in r and z.

Definition at line 61 of file preconditioner_array.h.

◆ solve_preconditioners() [2/2]

void oomph::PreconditionerArray::solve_preconditioners ( const Vector< DoubleVector > &  r,
Vector< DoubleVector > &  z 
)

Applies each preconditioner to the corresponding vector in r and z.

Member Data Documentation

◆ Color

unsigned oomph::PreconditionerArray::Color
private

the Color of this processor (or the preconditioner number)

Definition at line 221 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ Distribution_pt

Vector<LinearAlgebraDistribution*> oomph::PreconditionerArray::Distribution_pt
private

Definition at line 231 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ First_proc_for_prec

Vector<unsigned> oomph::PreconditionerArray::First_proc_for_prec
private

The first_row component of the distribution of the processors over the preconditioners.

Definition at line 198 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ First_row_for_proc

Vector<Vector<unsigned> > oomph::PreconditionerArray::First_row_for_proc
private

Storage (indexed [i][j]) for the first row that will be sent from this processor to processor j for preconditioner i.

Definition at line 206 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ First_row_from_proc

Vector<Vector<unsigned> > oomph::PreconditionerArray::First_row_from_proc
private

Storage (indexed [i][j]) for the first row that will be received by this processor from processor j for preconditioner i.

Definition at line 214 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ Global_communicator_pt

OomphCommunicator* oomph::PreconditionerArray::Global_communicator_pt
private

pointer to the global communicator for this preconditioner array

Definition at line 224 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ Local_communicator_pt

OomphCommunicator* oomph::PreconditionerArray::Local_communicator_pt
private

Vector of communicators for the preconditioners.

Definition at line 227 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ Method

unsigned oomph::PreconditionerArray::Method
private

the communication method in the setup_preconditioners(...) method

  1. Non-blocking Send with Blocking Recv
  2. MPI_Datatypes with Non-blocking sends and receives

Definition at line 237 of file preconditioner_array.h.

Referenced by method(), and PreconditionerArray().

◆ Nprec

unsigned oomph::PreconditionerArray::Nprec
private

the number of preconditioner in the array

Definition at line 191 of file preconditioner_array.h.

Referenced by clean_up_memory(), and PreconditionerArray().

◆ Nproc_for_prec

Vector<unsigned> oomph::PreconditionerArray::Nproc_for_prec
private

The nrow_local component of the distribution of the processors over the preconditioners.

Definition at line 202 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ Nrow_local_for_proc

Vector<Vector<unsigned> > oomph::PreconditionerArray::Nrow_local_for_proc
private

Storage (indexed [i][j]) for the nrow_local that will be sent from this processor to processor j for preconditioner i.

Definition at line 210 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ Nrow_local_from_proc

Vector<Vector<unsigned> > oomph::PreconditionerArray::Nrow_local_from_proc
private

Storage (indexed [i][j]) for the nrow_local that will be received by this processor from processor j for preconditioner i.

Definition at line 218 of file preconditioner_array.h.

Referenced by clean_up_memory().

◆ Preconditioner_pt

Preconditioner* oomph::PreconditionerArray::Preconditioner_pt
private

The pointer to the local preconditioner on this processor.

Definition at line 194 of file preconditioner_array.h.

Referenced by clean_up_memory().


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