41 GAMGProcAgglomeration,
42 masterCoarsestGAMGProcAgglomeration,
50 Foam::masterCoarsestGAMGProcAgglomeration::masterCoarsestGAMGProcAgglomeration
61 "nProcessorsPerMaster",
68 controlDict.getOrDefault<label>(
"nCellsInMasterLevel", -1)
74 if (nProcessorsPerMaster_ > 0)
77 <<
"Cannot specify both \"nMasters\" and" 81 const label nMasters(
readLabel(ePtr->stream()));
86 <<
"Illegal value \"nMasters\" " 90 nProcessorsPerMaster_ =
95 if (nProcessorsPerMaster_ < 0)
98 <<
"Illegal value \"nProcessorsPerMaster\" " 117 Pout<<
nl <<
"Starting mesh overview" <<
endl;
118 printStats(
Pout, agglom_);
121 if (agglom_.size() >= 1)
125 label fineLevelIndex = agglom_.size()-1;
127 if (agglom_.hasMeshLevel(fineLevelIndex))
130 const lduMesh& levelMesh = agglom_.meshLevel(fineLevelIndex);
131 label levelComm = levelMesh.comm();
139 if (nProcessorsPerMaster_ > 0)
141 forAll(procAgglomMap, fineProci)
143 procAgglomMap[fineProci] =
146 / nProcessorsPerMaster_
152 procAgglomMap =
Zero;
159 List<label> agglomProcIDs;
170 if (masterProcs.size())
180 Info<< typeName <<
" : agglomerating" <<
nl 181 <<
"\tmaster\tnProcs\tprocIDs" <<
endl;
182 for (
const auto&
p : masterToProcs)
216 if (nCellsInMasterLevel_ > 0)
218 const label levelI = agglom_.size();
219 if (agglom_.hasMeshLevel(levelI))
221 const lduMesh& fineMesh = agglom_.meshLevel(levelI);
222 const auto& addr = fineMesh.lduAddr();
225 addr.lowerAddr().size(),
230 nCellsInMasterLevel_,
250 Pout<<
nl <<
"Agglomerated mesh overview" <<
endl;
251 printStats(
Pout, agglom_);
A class for handling keywords in dictionaries.
virtual bool agglomerate()
Modify agglomeration. Return true if modified.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
virtual ~masterCoarsestGAMGProcAgglomeration()
Destructor.
virtual label comm() const =0
Return communicator used for parallel communication.
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.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
const Mesh & mesh() const noexcept
Reference to the mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
runTime controlDict().readEntry("adjustTimeStep"
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
virtual bool agglomerate()=0
Modify agglomeration.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Processor agglomeration of GAMGAgglomerations.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
Geometric agglomerated algebraic multigrid agglomeration class.
static void calculateRegionMaster(const label comm, const labelList &procAgglomMap, labelList &masterProcs, List< label > &agglomProcIDs)
Given fine to coarse processor map determine:
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
static label allocateCommunicator(const label parent, const labelRange &subRanks, const bool withComponents=true)
Allocate new communicator with contiguous sub-ranks on the parent communicator.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)