The class contains the addressing required by the lduMatrix: upper, lower and losort. More...
Public Member Functions | |
lduAddressing (const label nEqns) | |
virtual | ~lduAddressing () |
Destructor. More... | |
label | size () const |
Return number of equations. More... | |
virtual const labelUList & | lowerAddr () const =0 |
Return lower addressing. More... | |
virtual const labelUList & | upperAddr () const =0 |
Return upper addressing. More... | |
virtual const labelUList & | patchAddr (const label patchNo) const =0 |
Return patch to internal addressing given patch number. More... | |
virtual const lduSchedule & | patchSchedule () const =0 |
const labelUList & | losortAddr () const |
Return losort addressing. More... | |
const labelUList & | ownerStartAddr () const |
Return owner start addressing. More... | |
const labelUList & | losortStartAddr () const |
Return losort start addressing. More... | |
label | triIndex (const label a, const label b) const |
Return off-diagonal index given owner and neighbour label. More... | |
Tuple2< label, scalar > | band () const |
Calculate bandwidth and profile of addressing. More... | |
Private Member Functions | |
lduAddressing (const lduAddressing &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const lduAddressing &) |
Disallow default bitwise assignment. More... | |
void | calcLosort () const |
Calculate losort. More... | |
void | calcOwnerStart () const |
Calculate owner start. More... | |
void | calcLosortStart () const |
Calculate losort start. More... | |
Private Attributes | |
label | size_ |
Number of equations. More... | |
labelList * | losortPtr_ |
Demand-driven data. More... | |
labelList * | ownerStartPtr_ |
Owner start addressing. More... | |
labelList * | losortStartPtr_ |
Losort start addressing. More... | |
The class contains the addressing required by the lduMatrix: upper, lower and losort.
The addressing can be created in two ways: either with references to upper and lower in which case it stores references or from labelLists, in which case it stores the addressing itself. Additionally, the losort addressing belongs to the class is as on lazy evaluation.
The ordering of owner addresses is such that the labels are in increasing order, with groups of identical labels for edges "owned" by the same point. The neighbour labels are also ordered in ascending order but only for groups of edges belonging to each point. An example is given below:
owner neighbour 0 1 0 20 1 2 1 21 2 3 2 22 3 4 3 23 4 5 4 24 5 6 5 25 6 7 6 26 7 8 7 27 8 9 8 28 9 10 9 29
There exists an alternative way of addressing the owner list: instead of repeating the same label in the owner list, it is possible to address the start of each point neighbours in the neighbour list. This reduces the size of owner addressing from a list over all edges to a list over all points + 1:
Owner start list: 0 2 4 6 8 10 12 14 16 18
We shall use the second form of the addressing for fast lookup of edge label from the known owner and neighbour, using the following algorithm:
While owner start addressing allows us to find the edge owned by the points, it is also necessary to find the edges for which the point is a neighbour. Losort addressing lists the edges neighboured by the point and we shall use the same trick as above to address into this list. Thus, for every point the losort start gives the address of the first face to neighbour this point.
Definition at line 111 of file lduAddressing.H.
|
private |
Disallow default bitwise copy construct.
|
inline |
Definition at line 152 of file lduAddressing.H.
|
virtual |
Destructor.
Definition at line 175 of file lduAddressing.C.
References Foam::deleteDemandDrivenData().
|
private |
Disallow default bitwise assignment.
|
private |
Calculate losort.
Definition at line 32 of file lduAddressing.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, lduAddressing::losortPtr_, List::setSize(), lduAddressing::size(), UList::size(), and lduAddressing::upperAddr().
|
private |
Calculate owner start.
Definition at line 93 of file lduAddressing.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and List::size().
|
private |
Calculate losort start.
Definition at line 130 of file lduAddressing.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, and List::size().
|
inline |
Return number of equations.
Definition at line 168 of file lduAddressing.H.
References lduAddressing::size_.
Referenced by pairGAMGAgglomeration::agglomerate(), MGridGenGAMGAgglomeration::agglomerate(), GAMGAgglomeration::agglomerateLduAddressing(), lduAddressing::calcLosort(), GAMGAgglomeration::checkRestriction(), GAMGAgglomeration::compactLevels(), lduPrimitiveMesh::gather(), MGridGenGAMGAgglomeration::getNbrAgglom(), GAMGProcAgglomeration::globalCellCells(), lduPrimitiveMesh::lduPrimitiveMesh(), LUscalarMatrix::LUscalarMatrix(), MGridGenGAMGAgglomeration::makeCompactCellFaceAddressingAndFaceWeights(), and MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration().
|
pure virtual |
Return lower addressing.
Implemented in lduPrimitiveMesh, and fvMeshLduAddressing.
Referenced by pairGAMGAgglomeration::agglomerate(), GAMGAgglomeration::agglomerateLduAddressing(), TDILUPreconditioner< Type, DType, LUType >::calcInvD(), DICPreconditioner::calcReciprocalD(), DILUPreconditioner::calcReciprocalD(), GAMGAgglomeration::checkRestriction(), GAMGAgglomeration::compactLevels(), LUscalarMatrix::convert(), MGridGenGAMGAgglomeration::detectSharedFaces(), lduPrimitiveMesh::gather(), GAMGProcAgglomeration::globalCellCells(), lduMatrix::H(), lduMatrix::H1(), GAMGSolver::interpolate(), lduPrimitiveMesh::lduPrimitiveMesh(), MGridGenGAMGAgglomeration::makeCompactCellFaceAddressingAndFaceWeights(), fvMesh::owner(), PCGgpu::solve(), PBiCGgpu::solve(), and lduMatrix::sumDiag().
|
pure virtual |
Return upper addressing.
Implemented in lduPrimitiveMesh, and fvMeshLduAddressing.
Referenced by pairGAMGAgglomeration::agglomerate(), GAMGAgglomeration::agglomerateLduAddressing(), TDILUPreconditioner< Type, DType, LUType >::calcInvD(), lduAddressing::calcLosort(), DICPreconditioner::calcReciprocalD(), DILUPreconditioner::calcReciprocalD(), GAMGAgglomeration::checkRestriction(), LUscalarMatrix::convert(), MGridGenGAMGAgglomeration::detectSharedFaces(), lduPrimitiveMesh::gather(), GAMGProcAgglomeration::globalCellCells(), lduMatrix::H(), lduMatrix::H1(), GAMGSolver::interpolate(), lduPrimitiveMesh::lduPrimitiveMesh(), MGridGenGAMGAgglomeration::makeCompactCellFaceAddressingAndFaceWeights(), fvMesh::neighbour(), GaussSeidelSmoother::smooth(), symGaussSeidelSmoother::smooth(), TGaussSeidelSmoother< Type, DType, LUType >::smooth(), nonBlockingGaussSeidelSmoother::smooth(), PCGgpu::solve(), PBiCGgpu::solve(), and lduMatrix::sumDiag().
|
pure virtual |
Return patch to internal addressing given patch number.
Implemented in lduPrimitiveMesh, and fvMeshLduAddressing.
|
pure virtual |
Implemented in lduPrimitiveMesh, and fvMeshLduAddressing.
Referenced by LduMatrix< Type, DType, LUType >::patchSchedule(), and lduMatrix::patchSchedule().
const Foam::labelUList & losortAddr | ( | ) | const |
Return losort addressing.
Definition at line 185 of file lduAddressing.C.
Referenced by PBiCGgpu::solve(), and PCGgpu::solve().
const Foam::labelUList & ownerStartAddr | ( | ) | const |
Return owner start addressing.
Definition at line 196 of file lduAddressing.C.
Referenced by GaussSeidelSmoother::smooth(), symGaussSeidelSmoother::smooth(), TGaussSeidelSmoother< Type, DType, LUType >::smooth(), nonBlockingGaussSeidelSmoother::smooth(), PBiCGgpu::solve(), and PCGgpu::solve().
const Foam::labelUList & losortStartAddr | ( | ) | const |
Return losort start addressing.
Definition at line 207 of file lduAddressing.C.
Referenced by PBiCGgpu::solve(), and PCGgpu::solve().
Foam::label triIndex | ( | const label | a, |
const label | b | ||
) | const |
Return off-diagonal index given owner and neighbour label.
Definition at line 219 of file lduAddressing.C.
References Foam::abort(), Foam::constant::physicoChemical::b, Foam::FatalError, FatalErrorInFunction, Foam::max(), and Foam::min().
Foam::Tuple2< Foam::label, Foam::scalar > band | ( | ) | const |
Calculate bandwidth and profile of addressing.
Definition at line 250 of file lduAddressing.C.
References Foam::diff(), forAll, and Foam::max().
Referenced by GAMGAgglomeration::compactLevels().
|
private |
Number of equations.
Definition at line 116 of file lduAddressing.H.
Referenced by lduAddressing::size().
|
mutableprivate |
Demand-driven data.
Losort addressing
Definition at line 122 of file lduAddressing.H.
Referenced by lduAddressing::calcLosort().
|
mutableprivate |
Owner start addressing.
Definition at line 125 of file lduAddressing.H.
|
mutableprivate |
Losort start addressing.
Definition at line 128 of file lduAddressing.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.