46 GAMGProcAgglomeration,
47 procFacesGAMGProcAgglomeration,
56 Foam::procFacesGAMGProcAgglomeration::singleCellMesh
58 const label singleCellMeshComm,
71 if (interfaces.set(intI))
73 const processorLduInterface&
pp =
74 refCast<const processorLduInterface>
78 label size = interfaces[intI].faceCells().size();
79 myNeighbours.insert(
pp.neighbProcNo(), size);
86 autoPtr<lduPrimitiveMesh> singleCellMeshPtr;
93 DynamicList<label> l(3*nCells);
94 DynamicList<label> u(3*nCells);
95 DynamicList<scalar> weight(3*nCells);
97 DynamicList<label> nbrs;
98 DynamicList<scalar> weights;
102 const Map<label>& neighbours = procFaces[proci];
109 if (iter.key() > proci)
111 nbrs.append(iter.key());
112 weights.append(iter());
119 weight.append(weights[i]);
124 faceWeights.transfer(weight);
126 PtrList<const lduInterface> primitiveInterfaces(0);
129 singleCellMeshPtr.reset
142 return singleCellMeshPtr;
147 Foam::procFacesGAMGProcAgglomeration::processorAgglomeration
152 UPstream::communicator singleCellMeshComm
159 autoPtr<lduPrimitiveMesh> singleCellMeshPtr
163 singleCellMeshComm.comm(),
170 auto& fineToCoarse = tfineToCoarse.ref();
172 if (singleCellMeshPtr)
175 const lduPrimitiveMesh& singleCellMesh = *singleCellMeshPtr;
186 forAll(fineToCoarse, celli)
188 label coarseI = fineToCoarse[celli];
189 coarseToMaster[coarseI] =
min(coarseToMaster[coarseI], celli);
201 return tfineToCoarse;
205 bool Foam::procFacesGAMGProcAgglomeration::doProcessorAgglomeration
226 nAgglomeratingCells_(
controlDict.
get<label>(
"nAgglomeratingCells"))
242 Pout<<
nl <<
"Starting mesh overview" <<
endl;
243 printStats(
Pout, agglom_);
246 if (agglom_.size() >= 1)
252 label fineLevelIndex = 2;
253 fineLevelIndex < agglom_.size();
257 if (agglom_.hasMeshLevel(fineLevelIndex))
260 const lduMesh& levelMesh = agglom_.meshLevel(fineLevelIndex);
262 label levelComm = levelMesh.comm();
265 if (nProcs > 1 && doProcessorAgglomeration(levelMesh))
267 tmp<labelField> tprocAgglomMap
269 processorAgglomeration(levelMesh)
271 const labelField& procAgglomMap = tprocAgglomMap();
277 List<label> agglomProcIDs;
314 Pout<<
nl <<
"Agglomerated mesh overview" <<
endl;
315 printStats(
Pout, agglom_);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Field< label > labelField
Specialisation of Field<T> for label.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
procFacesGAMGProcAgglomeration(const procFacesGAMGProcAgglomeration &)=delete
No copy construct.
constexpr char nl
The newline '\n' character (0x0a)
UIndirectList< label > labelUIndList
UIndirectList of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void reduceOr(bool &value, const label communicator=worldComm)
Logical (or) reduction (MPI_AllReduce)
static int & msgType() noexcept
Message tag of standard messages.
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
Macros for easy insertion into run-time selection tables.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
#define forAll(list, i)
Loop across all elements in list.
static tmp< labelField > agglomerate(label &nCoarseCells, const lduAddressing &fineMatrixAddressing, const scalarField &faceWeights)
Calculate and return agglomeration.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
virtual label comm() const
Return communicator used for parallel communication.
label size() const noexcept
Return number of equations.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void sort(UList< T > &list)
Sort the list.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
runTime controlDict().readEntry("adjustTimeStep"
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
virtual ~procFacesGAMGProcAgglomeration()
Destructor.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
virtual bool agglomerate()
Modify agglomeration. Return true if modified.
static void allGatherList(UList< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses MPI_Allgather or manual linear/tree communicat...
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
virtual bool agglomerate()=0
Modify agglomeration.
Processor agglomeration of GAMGAgglomerations.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
List< label > labelList
A List of labels.
A class for managing temporary objects.
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.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
forAllConstIters(mixture.phases(), phase)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)