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
143 globalNumbering.localSize(myProcID),
144 globalNumbering.localStart(myProcID)
149 PtrList<labelList> nbrGlobalCells(interfaces.size());
156 if (interfaces.set(inti))
158 interfaces[inti].initInternalFieldTransfer
170 if (interfaces.set(inti))
177 interfaces[inti].internalFieldTransfer
206 if (interfaces.set(inti))
208 const labelUList& faceCells = interfaces[inti].faceCells();
212 nNbrs[faceCells[i]]++;
224 cellCells[celli].setSize(nNbrs[celli], -1);
233 label c0 = own[facei];
234 label
c1 = nbr[facei];
236 cellCells[c0][nNbrs[c0]++] = globalIndices[
c1];
237 cellCells[
c1][nNbrs[
c1]++] = globalIndices[c0];
241 if (interfaces.set(inti))
243 const labelUList& faceCells = interfaces[inti].faceCells();
247 label c0 = faceCells[i];
248 cellCells[c0][nNbrs[c0]++] = nbrGlobalCells[inti][i];
261 cellCells[celli][0] = globalIndices[celli];
270 const label fineLevelIndex,
273 const List<label>& agglomProcIDs,
274 const label procAgglomComm
277 const lduMesh& levelMesh = agglom_.meshLevels_[fineLevelIndex];
278 label levelComm = levelMesh.comm();
285 agglom_.procAgglomerateLduAddressing
298 label levelI = fineLevelIndex+1;
299 levelI < agglom_.meshLevels_.size();
303 agglom_.procAgglomerateRestrictAddressing
316 label levelI = fineLevelIndex;
317 levelI < agglom_.meshLevels_.size();
321 agglom_.agglomerateLduAddressing(levelI);
329 label levelI = fineLevelIndex+1;
330 levelI <= agglom_.size();
334 agglom_.clearLevel(levelI);
365 auto* ctorPtr = GAMGAgglomerationConstructorTable(
type);
370 <<
"Unknown GAMGProcAgglomeration type " 371 <<
type <<
" for GAMGAgglomeration " << agglom.type() <<
nl <<
nl 372 <<
"Valid GAMGProcAgglomeration types :" <<
endl 373 << GAMGAgglomerationConstructorTablePtr_->sortedToc()
385 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" : (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)