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)
106 os <<
" procCellOffsets:" 134 const globalIndex globalNumbering
147 PtrList<labelList> nbrGlobalCells(interfaces.size());
154 if (interfaces.set(inti))
156 interfaces[inti].initInternalFieldTransfer
168 if (interfaces.set(inti))
175 interfaces[inti].internalFieldTransfer
204 if (interfaces.set(inti))
206 const labelUList& faceCells = interfaces[inti].faceCells();
210 nNbrs[faceCells[i]]++;
222 cellCells[celli].setSize(nNbrs[celli], -1);
231 label c0 = own[facei];
232 label
c1 = nbr[facei];
234 cellCells[c0][nNbrs[c0]++] = globalIndices[
c1];
235 cellCells[
c1][nNbrs[
c1]++] = globalIndices[c0];
239 if (interfaces.set(inti))
241 const labelUList& faceCells = interfaces[inti].faceCells();
245 label c0 = faceCells[i];
246 cellCells[c0][nNbrs[c0]++] = nbrGlobalCells[inti][i];
259 cellCells[celli][0] = globalIndices[celli];
268 const label fineLevelIndex,
271 const List<label>& agglomProcIDs,
272 const label procAgglomComm
275 const lduMesh& levelMesh = agglom_.meshLevels_[fineLevelIndex];
276 label levelComm = levelMesh.comm();
283 agglom_.procAgglomerateLduAddressing
296 label levelI = fineLevelIndex+1;
297 levelI < agglom_.meshLevels_.size();
301 agglom_.procAgglomerateRestrictAddressing
314 label levelI = fineLevelIndex;
315 levelI < agglom_.meshLevels_.size();
319 agglom_.agglomerateLduAddressing(levelI);
327 label levelI = fineLevelIndex+1;
328 levelI <= agglom_.size();
332 agglom_.clearLevel(levelI);
363 auto* ctorPtr = GAMGAgglomerationConstructorTable(
type);
368 <<
"Unknown GAMGProcAgglomeration type " 369 <<
type <<
" for GAMGAgglomeration " << agglom.type() <<
nl <<
nl 370 <<
"Valid GAMGProcAgglomeration types :" <<
endl 371 << GAMGAgglomerationConstructorTablePtr_->sortedToc()
383 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.
static int myProcNo(label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
void stableSort(UList< T > &list)
Stable sort the list.
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.
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)
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)
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...
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.