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...
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 word & | type () 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::Request > | recvRequests_ |
DynamicList< label > | lowerNbrs_ |
Interfaces to lower coloured processors. More... | |
DynamicList< UPstream::Request > | lowerSendRequests_ |
DynamicList< UPstream::Request > | lowerRecvRequests_ |
DynamicList< label > | higherNbrs_ |
Interfaces to higher coloured processors. More... | |
DynamicList< UPstream::Request > | higherSendRequests_ |
DynamicList< UPstream::Request > | higherRecvRequests_ |
autoPtr< labelList > | cellColourPtr_ |
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 solver & | solver_ |
Reference to the base-solver this preconditioner is used with. More... | |
Static Protected Attributes | |
static const lduMesh * | meshPtr_ = nullptr |
Processor interface buffers and colouring. More... | |
static autoPtr< labelList > | procColoursPtr_ |
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< preconditioner > | New (const solver &sol, const dictionary &solverControls) |
Return a new preconditioner. More... | |
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
Definition at line 74 of file distributedDILUPreconditioner.H.
distributedDILUPreconditioner | ( | const lduMatrix::solver & | sol, |
const dictionary & | solverControlsUnused | ||
) |
Construct from matrix components and preconditioner solver controls.
Definition at line 518 of file distributedDILUPreconditioner.C.
References List< T >::append(), Foam::ensightOutput::debug, Foam::endl(), Foam::flatOutput(), forAll, Foam::incrIndent(), Foam::indent(), Foam::Info, lduMatrix::solver::interfaceBouCoeffs(), lduMatrix::solver::interfaces(), lduMatrix::solver::matrix(), mesh, lduMatrix::mesh(), WarningInFunction, and Foam::Zero.
|
virtual |
Destructor.
Definition at line 759 of file distributedDILUPreconditioner.C.
References DebugPout, Foam::endl(), distributedDILUPreconditioner::higherRecvRequests_, distributedDILUPreconditioner::higherSendRequests_, distributedDILUPreconditioner::lowerRecvRequests_, distributedDILUPreconditioner::lowerSendRequests_, and distributedDILUPreconditioner::wait().
|
protected |
Variant of lduMatrix::updateMatrixInterfaces on selected interfaces.
Definition at line 46 of file distributedDILUPreconditioner.C.
References Foam::add().
|
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().
|
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().
|
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().
|
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().
|
protectedvirtual |
Update diagonal for interface.
Definition at line 264 of file distributedDILUPreconditioner.C.
References forAll.
|
protectedvirtual |
Update diagonal for all faces of a certain colour.
Reimplemented in distributedDICPreconditioner.
Definition at line 290 of file distributedDILUPreconditioner.C.
|
protectedvirtual |
Update preconditioned variable from interface.
Definition at line 329 of file distributedDILUPreconditioner.C.
References UList< T >::begin(), and forAll.
|
protectedvirtual |
Update preconditioned variable walking forward on internal faces.
Reimplemented in distributedDICPreconditioner.
Definition at line 354 of file distributedDILUPreconditioner.C.
References UList< T >::begin().
|
protectedvirtual |
Update preconditioned variable walking backward on internal faces.
Definition at line 398 of file distributedDILUPreconditioner.C.
References UList< T >::begin().
|
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().
TypeName | ( | "distributedDILU" | ) |
Runtime type information.
|
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().
|
virtual |
Signal end of solver.
Reimplemented from lduMatrix::preconditioner.
Definition at line 907 of file distributedDILUPreconditioner.C.
References DebugPout, Foam::endl(), and s.
|
protected |
Precondition across global coupled bc.
Definition at line 85 of file distributedDILUPreconditioner.H.
|
staticprotected |
Processor interface buffers and colouring.
Previous mesh
Definition at line 95 of file distributedDILUPreconditioner.H.
Previous processor colours.
Definition at line 100 of file distributedDILUPreconditioner.H.
|
mutableprotected |
Buffers for sending and receiving data.
Definition at line 105 of file distributedDILUPreconditioner.H.
|
mutableprotected |
Definition at line 106 of file distributedDILUPreconditioner.H.
|
mutableprotected |
Definition at line 107 of file distributedDILUPreconditioner.H.
|
protected |
Interfaces to lower coloured processors.
Definition at line 112 of file distributedDILUPreconditioner.H.
|
mutableprotected |
Definition at line 113 of file distributedDILUPreconditioner.H.
Referenced by distributedDILUPreconditioner::~distributedDILUPreconditioner().
|
mutableprotected |
Definition at line 114 of file distributedDILUPreconditioner.H.
Referenced by distributedDILUPreconditioner::~distributedDILUPreconditioner().
|
protected |
Interfaces to higher coloured processors.
Definition at line 119 of file distributedDILUPreconditioner.H.
|
mutableprotected |
Definition at line 120 of file distributedDILUPreconditioner.H.
Referenced by distributedDILUPreconditioner::~distributedDILUPreconditioner().
|
mutableprotected |
Definition at line 121 of file distributedDILUPreconditioner.H.
Referenced by distributedDILUPreconditioner::~distributedDILUPreconditioner().
Local (cell) colouring from global interfaces.
Colour/zone per cell
Definition at line 131 of file distributedDILUPreconditioner.H.
|
protected |
Number of colours (in case of multiple disconnected regions.
in single mesh)
Definition at line 138 of file distributedDILUPreconditioner.H.
|
mutableprotected |
Global interfaces. Per colour the interfaces that (might) influence it.
Definition at line 146 of file distributedDILUPreconditioner.H.
|
protected |
Interfaces to non-processor lower coupled interfaces.
Definition at line 151 of file distributedDILUPreconditioner.H.
|
protected |
Interfaces to non-processor lower coupled interfaces.
Definition at line 156 of file distributedDILUPreconditioner.H.
|
protected |
Corresponding destination colour (for lowerGlobal)
Definition at line 161 of file distributedDILUPreconditioner.H.
|
protected |
Interfaces to non-processor higher coupled interfaces.
Definition at line 166 of file distributedDILUPreconditioner.H.
|
protected |
Interfaces to non-processor higher coupled interfaces.
Definition at line 171 of file distributedDILUPreconditioner.H.
|
protected |
Corresponding destination colour (for higherGlobal)
Definition at line 176 of file distributedDILUPreconditioner.H.
|
protected |
The reciprocal preconditioned diagonal.
Definition at line 182 of file distributedDILUPreconditioner.H.