50 for (label levelI = 0; levelI <= agglom.
size(); levelI++)
54 os <<
"Level " << levelI <<
" mesh:" 59 os <<
"Level " << levelI <<
" has no fine mesh:" <<
endl;
73 os <<
"Level " << levelI <<
" agglomeration:" <<
nl 74 <<
" nCoarseCells:" << agglom.
nCells(levelI) <<
nl 75 <<
" nCoarseFaces:" << agglom.
nFaces(levelI) <<
nl 76 <<
" cellRestriction:" 77 <<
" size:" << cellRestrict.size()
78 <<
" max:" <<
max(cellRestrict)
80 <<
" faceRestriction:" 81 <<
" size:" << faceRestrict.size()
82 <<
" max:" <<
max(faceRestrict)
87 forAll(patchFaceRestrict, i)
89 if (patchFaceRestrict[i].size())
94 <<
" size:" << faceRestrict.size()
95 <<
" max:" <<
max(faceRestrict)
132 const globalIndex globalNumbering
145 PtrList<labelList> nbrGlobalCells(interfaces.size());
152 if (interfaces.set(inti))
154 interfaces[inti].initInternalFieldTransfer
166 if (interfaces.set(inti))
173 interfaces[inti].internalFieldTransfer
202 if (interfaces.set(inti))
204 const labelUList& faceCells = interfaces[inti].faceCells();
208 nNbrs[faceCells[i]]++;
220 cellCells[celli].setSize(nNbrs[celli], -1);
229 label c0 = own[facei];
230 label
c1 = nbr[facei];
232 cellCells[c0][nNbrs[c0]++] = globalIndices[
c1];
233 cellCells[
c1][nNbrs[
c1]++] = globalIndices[c0];
237 if (interfaces.set(inti))
239 const labelUList& faceCells = interfaces[inti].faceCells();
243 label c0 = faceCells[i];
244 cellCells[c0][nNbrs[c0]++] = nbrGlobalCells[inti][i];
257 cellCells[celli][0] = globalIndices[celli];
266 const label fineLevelIndex,
269 const List<label>& agglomProcIDs,
270 const label procAgglomComm
273 const lduMesh& levelMesh = agglom_.meshLevels_[fineLevelIndex];
274 label levelComm = levelMesh.comm();
281 agglom_.procAgglomerateLduAddressing
294 label levelI = fineLevelIndex+1;
295 levelI < agglom_.meshLevels_.size();
299 agglom_.procAgglomerateRestrictAddressing
312 label levelI = fineLevelIndex;
313 levelI < agglom_.meshLevels_.size();
317 agglom_.agglomerateLduAddressing(levelI);
325 label levelI = fineLevelIndex+1;
326 levelI <= agglom_.size();
330 agglom_.clearLevel(levelI);
361 auto* ctorPtr = GAMGAgglomerationConstructorTable(
type);
366 <<
"Unknown GAMGProcAgglomeration type " 367 <<
type <<
" for GAMGAgglomeration " << agglom.type() <<
nl <<
nl 368 <<
"Valid GAMGProcAgglomeration types :" <<
endl 369 << GAMGAgglomerationConstructorTablePtr_->sortedToc()
381 clearCommunicators();
InfoProxy< lduMesh > info() const noexcept
Return info proxy, used to print mesh information to a stream.
const labelList & faceRestrictAddressing(const label leveli) const
Return face restrict addressing of given level.
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.
static void freeCommunicator(const label communicator, const bool withComponents=true)
Free a previously allocated communicator.
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 (on the internal list of 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)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
List< labelList > labelListList
List of labelList.
void printStats(Ostream &os, GAMGAgglomeration &agglom) const
Debug: write agglomeration info.
static void waitRequests()
Wait for all requests to finish.
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), works like std::iota() but returning a...
void clearCommunicators()
Clear/free allocated communicators.
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.
GAMGProcAgglomeration(const GAMGProcAgglomeration &)=delete
No copy construct.
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 labelListList globalCellCells(const lduMesh &)
Debug: calculate global cell-cells.
virtual bool agglomerate()=0
Modify agglomeration.
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. Clears allocated communicators.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
#define forAllReverse(list, i)
Reverse loop across all elements in list.
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)