74 printStats(
Pout, agglom_);
77 if (agglom_.size() >= 1)
81 const label fineLevelIndex = procAgglomMaps_[i].first();
83 if (fineLevelIndex >= agglom_.size())
86 <<
"Ignoring specification for level " << fineLevelIndex
87 <<
" since outside agglomeration." <<
endl;
92 if (agglom_.hasMeshLevel(fineLevelIndex))
95 const lduMesh& levelMesh = agglom_.meshLevel(fineLevelIndex);
104 procAgglomMaps_[i].second();
107 labelList coarseToMaster(clusters.size());
119 const labelList& cluster = clusters[coarseI];
120 coarseToMaster[coarseI] = cluster[0];
124 procAgglomMap[cluster[i]] = coarseI;
127 const label masterIndex =
128 cluster.find(coarseToMaster[coarseI]);
130 if (masterIndex == -1)
133 <<
"At level " << fineLevelIndex
134 <<
" the master processor "
135 << coarseToMaster[coarseI]
136 <<
" is not in the cluster "
141 if (cluster.found(myProcID))
145 agglomProcIDs = cluster;
149 agglomProcIDs[masterIndex]
156 if (procAgglomMap.found(-1))
159 <<
"At level " << fineLevelIndex
161 << procAgglomMap.find(-1)
162 <<
" is not in any cluster"
197 Pout<<
nl <<
"Agglomerated mesh overview" <<
endl;
198 printStats(
Pout, agglom_);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Geometric agglomerated algebraic multigrid agglomeration class.
Processor agglomeration of GAMGAgglomerations.
virtual bool agglomerate()=0
Modify agglomeration.
GAMGAgglomeration & agglom_
Reference to agglomeration.
void printStats(Ostream &os, GAMGAgglomeration &agglom) const
Debug: write agglomeration info.
DynamicList< label > comms_
Allocated communicators.
GAMGProcAgglomeration(const GAMGProcAgglomeration &)=delete
No copy construct.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool found(const T &val, label pos=0) const
Same as contains().
void size(const label n)
Older name for setAddressableSize.
label find(const T &val) const
Find index of the first occurrence of the value.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
static label newCommunicator(const label parent, const labelRange &subRanks, const bool withComponents=true)
Create new communicator with sub-ranks on the parent communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
virtual label comm() const =0
Return communicator used for parallel communication.
Manual processor agglomeration of GAMGAgglomerations.
manualGAMGProcAgglomeration(const manualGAMGProcAgglomeration &)=delete
No copy construct.
virtual ~manualGAMGProcAgglomeration()
Destructor.
virtual bool agglomerate()
Modify agglomeration. Return true if modified.
Lookup type of boundary radiation properties.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
runTime controlDict().readEntry("adjustTimeStep"
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.