distributedDILUPreconditioner Class Reference

Version of DILUpreconditioner that uses preconditioning across processor (and coupled) boundaries. Based on 'Parallel Preconditioners' chapter from 'Iterative Methods for Sparse Linear Systems' by Yousef Saad. More...

Inheritance diagram for distributedDILUPreconditioner:
Collaboration diagram for distributedDILUPreconditioner:

Public Member Functions

 TypeName ("distributedDILU")
 Runtime type information. More...
 
 distributedDILUPreconditioner (const lduMatrix::solver &, const dictionary &solverControlsUnused)
 Construct from matrix components and preconditioner solver controls. More...
 
virtual ~distributedDILUPreconditioner ()
 Destructor. More...
 
virtual void precondition (solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
 Return wA the preconditioned form of residual rA. More...
 
virtual void setFinished (const solverPerformance &perf) const
 Signal end of solver. More...
 
- Public Member Functions inherited from lduMatrix::preconditioner
virtual const wordtype () const =0
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, preconditioner, symMatrix,(const solver &sol, const dictionary &solverControls),(sol, solverControls))
 
 declareRunTimeSelectionTable (autoPtr, preconditioner, asymMatrix,(const solver &sol, const dictionary &solverControls),(sol, solverControls))
 
 preconditioner (const solver &sol)
 Construct for given solver. More...
 
virtual ~preconditioner ()=default
 Destructor. More...
 
virtual void read (const dictionary &)
 Read and reset the preconditioner parameters from the given stream. More...
 
virtual void preconditionT (solveScalarField &wT, const solveScalarField &rT, const direction cmpt=0) const
 Return wT the transpose-matrix preconditioned form of residual rT. More...
 

Protected Member Functions

void updateMatrixInterfaces (const bool add, const FieldField< Field, scalar > &coupleCoeffs, const labelList &selectedInterfaces, const solveScalarField &psiif, solveScalarField &result, const direction cmpt) const
 Variant of lduMatrix::updateMatrixInterfaces on selected interfaces. More...
 
void sendGlobal (const labelList &selectedInterfaces, solveScalarField &psi, const label colouri) const
 Send (and store in colourBufs_[colouri]) the effect of. More...
 
void receive (const labelList &selectedInterfaces, DynamicList< UPstream::Request > &requests) const
 Start receiving in recvBufs_. More...
 
void send (const labelList &selectedInterfaces, const solveScalarField &psiInternal, DynamicList< UPstream::Request > &requests) const
 Start sending sendBufs_. More...
 
void wait (DynamicList< UPstream::Request > &requests, const bool cancel=false) const
 Wait for requests or cancel/free requests. More...
 
virtual void addInterfaceDiag (solveScalarField &rD, const label inti, const Field< solveScalar > &recvBuf) const
 Update diagonal for interface. More...
 
virtual void forwardInternalDiag (solveScalarField &rD, const label colouri) const
 Update diagonal for all faces of a certain colour. More...
 
virtual void addInterface (solveScalarField &wA, const label inti, const Field< solveScalar > &recvBuf) const
 Update preconditioned variable from interface. More...
 
virtual void forwardInternal (solveScalarField &wA, const label colouri) const
 Update preconditioned variable walking forward on internal faces. More...
 
virtual void backwardInternal (solveScalarField &wA, const label colouri) const
 Update preconditioned variable walking backward on internal faces. More...
 
virtual void calcReciprocalD (solveScalarField &rD) const
 Calculate reciprocal of diagonal. More...
 

Protected Attributes

const bool coupled_
 Precondition across global coupled bc. More...
 
FieldField< Field, solveScalar > sendBufs_
 Buffers for sending and receiving data. More...
 
FieldField< Field, solveScalar > recvBufs_
 
DynamicList< UPstream::RequestrecvRequests_
 
DynamicList< label > lowerNbrs_
 Interfaces to lower coloured processors. More...
 
DynamicList< UPstream::RequestlowerSendRequests_
 
DynamicList< UPstream::RequestlowerRecvRequests_
 
DynamicList< label > higherNbrs_
 Interfaces to higher coloured processors. More...
 
DynamicList< UPstream::RequesthigherSendRequests_
 
DynamicList< UPstream::RequesthigherRecvRequests_
 
autoPtr< labelListcellColourPtr_
 Local (cell) colouring from global interfaces. More...
 
label nColours_
 Number of colours (in case of multiple disconnected regions. More...
 
PtrList< FieldField< Field, solveScalar > > colourBufs_
 Global interfaces. Per colour the interfaces that (might) influence it. More...
 
List< DynamicList< label > > lowerGlobalRecv_
 Interfaces to non-processor lower coupled interfaces. More...
 
List< DynamicList< label > > lowerGlobalSend_
 Interfaces to non-processor lower coupled interfaces. More...
 
List< label > lowerColour_
 Corresponding destination colour (for lowerGlobal) More...
 
List< DynamicList< label > > higherGlobalRecv_
 Interfaces to non-processor higher coupled interfaces. More...
 
List< DynamicList< label > > higherGlobalSend_
 Interfaces to non-processor higher coupled interfaces. More...
 
List< label > higherColour_
 Corresponding destination colour (for higherGlobal) More...
 
solveScalarField rD_
 The reciprocal preconditioned diagonal. More...
 
- Protected Attributes inherited from lduMatrix::preconditioner
const solversolver_
 Reference to the base-solver this preconditioner is used with. More...
 

Static Protected Attributes

static const lduMeshmeshPtr_ = nullptr
 Processor interface buffers and colouring. More...
 
static autoPtr< labelListprocColoursPtr_
 Previous processor colours. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from lduMatrix::preconditioner
static word getName (const dictionary &)
 Find the preconditioner name (directly or from a sub-dictionary) More...
 
static autoPtr< preconditionerNew (const solver &sol, const dictionary &solverControls)
 Return a new preconditioner. More...
 

Detailed Description

Version of DILUpreconditioner that uses preconditioning across processor (and coupled) boundaries. Based on 'Parallel Preconditioners' chapter from 'Iterative Methods for Sparse Linear Systems' by Yousef Saad.

Leaves out the handling of boundary nodes after internal nodes since probably not beneficial (so no overlap of comms and internal calculation)

By default preconditions across coupled boundaries (currently only tested for cyclicAMI). This can be disabled with the 'coupled' setting

solver PCG; preconditioner { preconditioner distributedDILU; coupled false; }

The cyclicAMI boundary behaviour will only work if

  • running non-parallel or
  • different sides of cyclicAMI run on different processors i.e. there is no processor which has cells on both owner and neighbour of the patch pair.
See also
Foam::DILUPreconditioner Foam::distributedDICPreconditioner
Source files

Definition at line 74 of file distributedDILUPreconditioner.H.

Constructor & Destructor Documentation

◆ distributedDILUPreconditioner()

distributedDILUPreconditioner ( const lduMatrix::solver sol,
const dictionary solverControlsUnused 
)

◆ ~distributedDILUPreconditioner()

Member Function Documentation

◆ updateMatrixInterfaces()

void updateMatrixInterfaces ( const bool  add,
const FieldField< Field, scalar > &  coupleCoeffs,
const labelList selectedInterfaces,
const solveScalarField psiif,
solveScalarField result,
const direction  cmpt 
) const
protected

Variant of lduMatrix::updateMatrixInterfaces on selected interfaces.

Definition at line 46 of file distributedDILUPreconditioner.C.

References Foam::add().

Here is the call graph for this function:

◆ sendGlobal()

void sendGlobal ( const labelList selectedInterfaces,
solveScalarField psi,
const label  colouri 
) const
protected

Send (and store in colourBufs_[colouri]) the effect of.

doing selectedInterfaces

Definition at line 104 of file distributedDILUPreconditioner.C.

References forAll, psi, and UList< T >::size().

Here is the call graph for this function:

◆ receive()

void receive ( const labelList selectedInterfaces,
DynamicList< UPstream::Request > &  requests 
) const
protected

Start receiving in recvBufs_.

Definition at line 173 of file distributedDILUPreconditioner.C.

References UList< T >::back(), DynamicList< T, SizeMin >::push_back(), and Foam::blockMeshTools::read().

Here is the call graph for this function:

◆ send()

void send ( const labelList selectedInterfaces,
const solveScalarField psiInternal,
DynamicList< UPstream::Request > &  requests 
) const
protected

Start sending sendBufs_.

Definition at line 205 of file distributedDILUPreconditioner.C.

References UList< T >::back(), forAll, DynamicList< T, SizeMin >::push_back(), and Foam::vtk::write().

Here is the call graph for this function:

◆ wait()

void wait ( DynamicList< UPstream::Request > &  requests,
const bool  cancel = false 
) const
protected

Wait for requests or cancel/free requests.

Definition at line 243 of file distributedDILUPreconditioner.C.

References DynamicList< T, SizeMin >::clear().

Referenced by distributedDILUPreconditioner::~distributedDILUPreconditioner().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addInterfaceDiag()

void addInterfaceDiag ( solveScalarField rD,
const label  inti,
const Field< solveScalar > &  recvBuf 
) const
protectedvirtual

Update diagonal for interface.

Definition at line 264 of file distributedDILUPreconditioner.C.

References forAll.

◆ forwardInternalDiag()

void forwardInternalDiag ( solveScalarField rD,
const label  colouri 
) const
protectedvirtual

Update diagonal for all faces of a certain colour.

Reimplemented in distributedDICPreconditioner.

Definition at line 290 of file distributedDILUPreconditioner.C.

◆ addInterface()

void addInterface ( solveScalarField wA,
const label  inti,
const Field< solveScalar > &  recvBuf 
) const
protectedvirtual

Update preconditioned variable from interface.

Definition at line 329 of file distributedDILUPreconditioner.C.

References UList< T >::begin(), and forAll.

Here is the call graph for this function:

◆ forwardInternal()

void forwardInternal ( solveScalarField wA,
const label  colouri 
) const
protectedvirtual

Update preconditioned variable walking forward on internal faces.

Reimplemented in distributedDICPreconditioner.

Definition at line 354 of file distributedDILUPreconditioner.C.

References UList< T >::begin().

Here is the call graph for this function:

◆ backwardInternal()

void backwardInternal ( solveScalarField wA,
const label  colouri 
) const
protectedvirtual

Update preconditioned variable walking backward on internal faces.

Definition at line 398 of file distributedDILUPreconditioner.C.

References UList< T >::begin().

Here is the call graph for this function:

◆ calcReciprocalD()

void calcReciprocalD ( solveScalarField rD) const
protectedvirtual

Calculate reciprocal of diagonal.

Definition at line 441 of file distributedDILUPreconditioner.C.

References UList< T >::begin(), Foam::diag(), List< T >::resize_nocopy(), and UList< T >::size().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "distributedDILU"  )

Runtime type information.

◆ precondition()

void precondition ( solveScalarField wA,
const solveScalarField rA,
const direction  cmpt = 0 
) const
virtual

Return wA the preconditioned form of residual rA.

Implements lduMatrix::preconditioner.

Definition at line 781 of file distributedDILUPreconditioner.C.

References UList< T >::begin(), and UList< T >::size().

Here is the call graph for this function:

◆ setFinished()

void setFinished ( const solverPerformance perf) const
virtual

Signal end of solver.

Reimplemented from lduMatrix::preconditioner.

Definition at line 907 of file distributedDILUPreconditioner.C.

References DebugPout, Foam::endl(), and s.

Here is the call graph for this function:

Member Data Documentation

◆ coupled_

const bool coupled_
protected

Precondition across global coupled bc.

Definition at line 85 of file distributedDILUPreconditioner.H.

◆ meshPtr_

const lduMesh * meshPtr_ = nullptr
staticprotected

Processor interface buffers and colouring.

Previous mesh

Definition at line 95 of file distributedDILUPreconditioner.H.

◆ procColoursPtr_

autoPtr< labelList > procColoursPtr_
staticprotected

Previous processor colours.

Definition at line 100 of file distributedDILUPreconditioner.H.

◆ sendBufs_

FieldField<Field, solveScalar> sendBufs_
mutableprotected

Buffers for sending and receiving data.

Definition at line 105 of file distributedDILUPreconditioner.H.

◆ recvBufs_

FieldField<Field, solveScalar> recvBufs_
mutableprotected

Definition at line 106 of file distributedDILUPreconditioner.H.

◆ recvRequests_

DynamicList<UPstream::Request> recvRequests_
mutableprotected

Definition at line 107 of file distributedDILUPreconditioner.H.

◆ lowerNbrs_

DynamicList<label> lowerNbrs_
protected

Interfaces to lower coloured processors.

Definition at line 112 of file distributedDILUPreconditioner.H.

◆ lowerSendRequests_

DynamicList<UPstream::Request> lowerSendRequests_
mutableprotected

◆ lowerRecvRequests_

DynamicList<UPstream::Request> lowerRecvRequests_
mutableprotected

◆ higherNbrs_

DynamicList<label> higherNbrs_
protected

Interfaces to higher coloured processors.

Definition at line 119 of file distributedDILUPreconditioner.H.

◆ higherSendRequests_

DynamicList<UPstream::Request> higherSendRequests_
mutableprotected

◆ higherRecvRequests_

DynamicList<UPstream::Request> higherRecvRequests_
mutableprotected

◆ cellColourPtr_

autoPtr<labelList> cellColourPtr_
protected

Local (cell) colouring from global interfaces.

Colour/zone per cell

Definition at line 131 of file distributedDILUPreconditioner.H.

◆ nColours_

label nColours_
protected

Number of colours (in case of multiple disconnected regions.

in single mesh)

Definition at line 138 of file distributedDILUPreconditioner.H.

◆ colourBufs_

PtrList<FieldField<Field, solveScalar> > colourBufs_
mutableprotected

Global interfaces. Per colour the interfaces that (might) influence it.

Definition at line 146 of file distributedDILUPreconditioner.H.

◆ lowerGlobalRecv_

List<DynamicList<label> > lowerGlobalRecv_
protected

Interfaces to non-processor lower coupled interfaces.

Definition at line 151 of file distributedDILUPreconditioner.H.

◆ lowerGlobalSend_

List<DynamicList<label> > lowerGlobalSend_
protected

Interfaces to non-processor lower coupled interfaces.

Definition at line 156 of file distributedDILUPreconditioner.H.

◆ lowerColour_

List<label> lowerColour_
protected

Corresponding destination colour (for lowerGlobal)

Definition at line 161 of file distributedDILUPreconditioner.H.

◆ higherGlobalRecv_

List<DynamicList<label> > higherGlobalRecv_
protected

Interfaces to non-processor higher coupled interfaces.

Definition at line 166 of file distributedDILUPreconditioner.H.

◆ higherGlobalSend_

List<DynamicList<label> > higherGlobalSend_
protected

Interfaces to non-processor higher coupled interfaces.

Definition at line 171 of file distributedDILUPreconditioner.H.

◆ higherColour_

List<label> higherColour_
protected

Corresponding destination colour (for higherGlobal)

Definition at line 176 of file distributedDILUPreconditioner.H.

◆ rD_

solveScalarField rD_
protected

The reciprocal preconditioned diagonal.

Definition at line 182 of file distributedDILUPreconditioner.H.


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