Loading...
Searching...
No Matches
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...

#include <distributedDILUPreconditioner.H>

Inheritance diagram for distributedDILUPreconditioner:
Collaboration diagram for distributedDILUPreconditioner:

Public Member Functions

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

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

Protected Attributes

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

Static Protected Attributes

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

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).
static autoPtr< preconditionerNew (const solver &sol, const dictionary &solverControls)
 Return a new preconditioner.

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()

Destructor.

Definition at line 755 of file distributedDILUPreconditioner.C.

References DebugPout, Foam::endl(), higherRecvRequests_, higherSendRequests_, lowerRecvRequests_, lowerSendRequests_, and wait().

Here is the call graph for this function:

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 45 of file distributedDILUPreconditioner.C.

References Foam::add(), UPstream::incrMsgType(), UPstream::msgType(), UPstream::nonBlocking, UPstream::nRequests(), lduMatrix::preconditioner::solver_, and UPstream::waitRequests().

Referenced by sendGlobal().

Here is the call graph for this function:
Here is the caller 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 103 of file distributedDILUPreconditioner.C.

References colourBufs_, forAll, psi, PtrList< T >::set(), UList< T >::size(), lduMatrix::preconditioner::solver_, and updateMatrixInterfaces().

Referenced by calcReciprocalD(), and precondition().

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

◆ receive()

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

Start receiving in recvBufs_.

Definition at line 172 of file distributedDILUPreconditioner.C.

References DynamicList< T, SizeMin >::emplace_back(), Foam::isA(), UIPstream::read(), recvBufs_, and lduMatrix::preconditioner::solver_.

Referenced by calcReciprocalD(), and precondition().

Here is the call graph for this function:
Here is the caller 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 202 of file distributedDILUPreconditioner.C.

References DynamicList< T, SizeMin >::emplace_back(), forAll, Foam::isA(), sendBufs_, lduMatrix::preconditioner::solver_, and UOPstream::write().

Referenced by calcReciprocalD(), and precondition().

Here is the call graph for this function:
Here is the caller 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 238 of file distributedDILUPreconditioner.C.

References UPstream::cancelRequests(), DynamicList< T, SizeMin >::clear(), and UPstream::waitRequests().

Referenced by calcReciprocalD(), precondition(), setFinished(), and ~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 259 of file distributedDILUPreconditioner.C.

References forAll, and lduMatrix::preconditioner::solver_.

Referenced by calcReciprocalD().

Here is the caller graph for this function:

◆ 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 285 of file distributedDILUPreconditioner.C.

References cellColourPtr_, and lduMatrix::preconditioner::solver_.

Referenced by calcReciprocalD().

Here is the caller graph for this function:

◆ addInterface()

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

Update preconditioned variable from interface.

Definition at line 324 of file distributedDILUPreconditioner.C.

References UList< T >::begin(), forAll, rD_, and lduMatrix::preconditioner::solver_.

Referenced by precondition().

Here is the call graph for this function:
Here is the caller 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 349 of file distributedDILUPreconditioner.C.

References UList< T >::begin(), cellColourPtr_, rD_, and lduMatrix::preconditioner::solver_.

Referenced by precondition().

Here is the call graph for this function:
Here is the caller 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 393 of file distributedDILUPreconditioner.C.

References UList< T >::begin(), cellColourPtr_, rD_, and lduMatrix::preconditioner::solver_.

Referenced by precondition().

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

◆ calcReciprocalD()

void calcReciprocalD ( solveScalarField & rD) const
protectedvirtual

◆ TypeName()

TypeName ( "distributedDILU" )

Runtime type information.

◆ precondition()

◆ setFinished()

void setFinished ( const solverPerformance & perf) const
virtual

Signal end of solver.

Reimplemented from lduMatrix::preconditioner.

Definition at line 902 of file distributedDILUPreconditioner.C.

References DebugPout, Foam::endl(), higherRecvRequests_, higherSendRequests_, lowerRecvRequests_, lowerSendRequests_, s(), and wait().

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.

Referenced by distributedDILUPreconditioner().

◆ meshPtr_

const lduMesh * meshPtr_ = nullptr
staticprotected

Processor interface buffers and colouring.

Previous mesh

Definition at line 95 of file distributedDILUPreconditioner.H.

Referenced by distributedDILUPreconditioner().

◆ procColoursPtr_

autoPtr< labelList > procColoursPtr_
staticprotected

Previous processor colours.

Definition at line 100 of file distributedDILUPreconditioner.H.

Referenced by distributedDILUPreconditioner().

◆ sendBufs_

FieldField<Field, solveScalar> sendBufs_
mutableprotected

Buffers for sending and receiving data.

Definition at line 105 of file distributedDILUPreconditioner.H.

Referenced by distributedDILUPreconditioner(), and send().

◆ recvBufs_

FieldField<Field, solveScalar> recvBufs_
mutableprotected

◆ 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.

Referenced by calcReciprocalD(), distributedDILUPreconditioner(), and precondition().

◆ 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.

Referenced by calcReciprocalD(), distributedDILUPreconditioner(), and precondition().

◆ higherSendRequests_

DynamicList<UPstream::Request> higherSendRequests_
mutableprotected

◆ higherRecvRequests_

DynamicList<UPstream::Request> higherRecvRequests_
mutableprotected

◆ cellColourPtr_

◆ nColours_

label nColours_
protected

Number of colours (in case of multiple disconnected regions.

in single mesh)

Definition at line 138 of file distributedDILUPreconditioner.H.

Referenced by calcReciprocalD(), distributedDILUPreconditioner(), and precondition().

◆ 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.

Referenced by calcReciprocalD(), distributedDILUPreconditioner(), precondition(), and sendGlobal().

◆ lowerGlobalRecv_

List<DynamicList<label> > lowerGlobalRecv_
protected

Interfaces to non-processor lower coupled interfaces.

Definition at line 151 of file distributedDILUPreconditioner.H.

Referenced by calcReciprocalD(), distributedDILUPreconditioner(), and precondition().

◆ lowerGlobalSend_

List<DynamicList<label> > lowerGlobalSend_
protected

Interfaces to non-processor lower coupled interfaces.

Definition at line 156 of file distributedDILUPreconditioner.H.

Referenced by distributedDILUPreconditioner(), and precondition().

◆ lowerColour_

List<label> lowerColour_
protected

Corresponding destination colour (for lowerGlobal).

Definition at line 161 of file distributedDILUPreconditioner.H.

Referenced by distributedDILUPreconditioner(), and precondition().

◆ higherGlobalRecv_

List<DynamicList<label> > higherGlobalRecv_
protected

Interfaces to non-processor higher coupled interfaces.

Definition at line 166 of file distributedDILUPreconditioner.H.

Referenced by distributedDILUPreconditioner(), and precondition().

◆ higherGlobalSend_

List<DynamicList<label> > higherGlobalSend_
protected

Interfaces to non-processor higher coupled interfaces.

Definition at line 171 of file distributedDILUPreconditioner.H.

Referenced by calcReciprocalD(), distributedDILUPreconditioner(), and precondition().

◆ higherColour_

List<label> higherColour_
protected

Corresponding destination colour (for higherGlobal).

Definition at line 176 of file distributedDILUPreconditioner.H.

Referenced by calcReciprocalD(), distributedDILUPreconditioner(), and precondition().

◆ rD_


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