50 for (label levelI = 0; levelI <= agglom.
size(); levelI++)
58 os <<
"Level " << levelI <<
" has no fine mesh:" <<
endl;
72 os <<
"Level " << levelI <<
" agglomeration:" <<
nl 73 <<
" nCoarseCells:" << agglom.
nCells(levelI) <<
nl 74 <<
" nCoarseFaces:" << agglom.
nFaces(levelI) <<
nl 75 <<
" cellRestriction:" 76 <<
" size:" << cellRestrict.size()
77 <<
" max:" <<
max(cellRestrict)
79 <<
" faceRestriction:" 80 <<
" size:" << faceRestrict.size()
81 <<
" max:" <<
max(faceRestrict)
86 forAll(patchFaceRestrict, i)
88 if (patchFaceRestrict[i].size())
93 <<
" size:" << faceRestrict.size()
94 <<
" max:" <<
max(faceRestrict)
131 const globalIndex globalNumbering
142 globalNumbering.localSize(myProcID),
143 globalNumbering.localStart(myProcID)
148 PtrList<labelList> nbrGlobalCells(interfaces.size());
155 if (interfaces.set(inti))
157 interfaces[inti].initInternalFieldTransfer
169 if (interfaces.set(inti))
176 interfaces[inti].internalFieldTransfer
205 if (interfaces.set(inti))
207 const labelUList& faceCells = interfaces[inti].faceCells();
211 nNbrs[faceCells[i]]++;
223 cellCells[celli].setSize(nNbrs[celli], -1);
232 label c0 = own[facei];
233 label
c1 = nbr[facei];
235 cellCells[c0][nNbrs[c0]++] = globalIndices[
c1];
236 cellCells[
c1][nNbrs[
c1]++] = globalIndices[c0];
240 if (interfaces.set(inti))
242 const labelUList& faceCells = interfaces[inti].faceCells();
246 label c0 = faceCells[i];
247 cellCells[c0][nNbrs[c0]++] = nbrGlobalCells[inti][i];
260 cellCells[celli][0] = globalIndices[celli];
269 const label fineLevelIndex,
272 const List<label>& agglomProcIDs,
273 const label procAgglomComm
276 const lduMesh& levelMesh = agglom_.meshLevels_[fineLevelIndex];
277 label levelComm = levelMesh.comm();
284 agglom_.procAgglomerateLduAddressing
297 label levelI = fineLevelIndex+1;
298 levelI < agglom_.meshLevels_.size();
302 agglom_.procAgglomerateRestrictAddressing
315 label levelI = fineLevelIndex;
316 levelI < agglom_.meshLevels_.size();
320 agglom_.agglomerateLduAddressing(levelI);
328 label levelI = fineLevelIndex+1;
329 levelI <= agglom_.size();
333 agglom_.clearLevel(levelI);
345 Foam::GAMGProcAgglomeration::GAMGProcAgglomeration
364 auto* ctorPtr = GAMGAgglomerationConstructorTable(
type);
369 <<
"Unknown GAMGProcAgglomeration type " 370 <<
type <<
" for GAMGAgglomeration " << agglom.type() <<
nl <<
nl 371 <<
"Valid GAMGProcAgglomeration types :" <<
endl 372 << GAMGAgglomerationConstructorTablePtr_->sortedToc()
const labelList & faceRestrictAddressing(const label leveli) const
Return face restrict addressing of given level.
List< labelList > labelListList
A List of labelList.
InfoProxy< lduMesh > info() const
Return info proxy.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const lduMesh & meshLevel(const label leveli) const
Return LDU mesh of given level.
PtrList< labelList > procCellOffsets_
Mapping from processor to procMeshLevel cells.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
static label nRequests() noexcept
Number of outstanding requests.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
void stableSort(UList< T > &list)
Stable sort the list.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
void printStats(Ostream &os, GAMGAgglomeration &agglom) const
Debug: write agglomeration info.
UList< label > labelUList
A UList of labels.
PtrList< labelList > agglomProcIDs_
Per level the set of processors to agglomerate. Element 0 is.
#define forAll(list, i)
Loop across all elements in list.
static autoPtr< GAMGProcAgglomeration > New(const word &type, GAMGAgglomeration &agglom, const dictionary &controlDict)
Return the selected agglomerator.
labelList procCommunicator_
Communicator for given level.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
virtual label comm() const
Return communicator used for parallel communication.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
A class for handling words, derived from Foam::string.
#define DebugInFunction
Report an information message using Foam::Info.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
runTime controlDict().readEntry("adjustTimeStep"
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
PtrList< labelField > restrictAddressing_
Cell restriction addressing array.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
label nFaces(const label leveli) const
Return number of coarse faces (before processor agglomeration)
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
static labelListList globalCellCells(const lduMesh &)
Debug: calculate global cell-cells.
virtual bool agglomerate()=0
Modify agglomeration. Return true if modified.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
Processor agglomeration of GAMGAgglomerations.
PtrList< labelList > procAgglomMap_
Per level, per processor the processor it agglomerates into.
const labelField & restrictAddressing(const label leveli) const
Return cell restrict addressing of given level.
virtual ~GAMGProcAgglomeration()
Destructor.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
"nonBlocking" : (MPI_Isend, MPI_Irecv)
List< label > labelList
A List of labels.
const labelListList & patchFaceRestrictAddressing(const label leveli) const
Geometric agglomerated algebraic multigrid agglomeration class.
bool hasMeshLevel(const label leveli) const
Do we have mesh for given level?
label nCells(const label leveli) const
Return number of coarse cells (before processor agglomeration)