50Foam::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;
170 if (masterProcs.size())
181 <<
"\tmaster\tnProcs\tprocIDs" <<
endl;
182 for (
const auto&
p : masterToProcs)
185 <<
"\t\t" <<
p.
size()
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_);
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.
static void calculateRegionMaster(const label comm, const labelList &procAgglomMap, labelList &masterProcs, List< label > &agglomProcIDs)
Given fine to coarse processor map determine:
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.
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...
const Mesh & mesh() const noexcept
Reference to the mesh.
A non-owning sub-view of a List (allocated or unallocated storage).
T & back()
Access last element of the list, position [size()-1].
void size(const label n)
Older name for setAddressableSize.
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,...
A class for handling keywords in dictionaries.
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.
virtual const lduAddressing & lduAddr() const =0
Return ldu addressing.
Processor agglomeration of GAMGAgglomerations.
virtual ~masterCoarsestGAMGProcAgglomeration()
Destructor.
virtual bool agglomerate()
Modify agglomeration. Return true if modified.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
runTime controlDict().readEntry("adjustTimeStep"
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Namespace for handling debugging switches.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
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).
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
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.