53 Foam::procFacesGAMGProcAgglomeration::singleCellMesh
55 const label singleCellMeshComm,
68 if (interfaces.set(intI))
70 const processorLduInterface& pp =
71 refCast<const processorLduInterface>
75 label size = interfaces[intI].faceCells().size();
76 myNeighbours.insert(pp.neighbProcNo(), size);
84 autoPtr<lduPrimitiveMesh> singleCellMeshPtr;
91 DynamicList<label> l(3*nCells);
92 DynamicList<label> u(3*nCells);
93 DynamicList<scalar> weight(3*nCells);
95 DynamicList<label> nbrs;
96 DynamicList<scalar> weights;
100 const Map<label>& neighbours = procFaces[proci];
107 if (iter.key() > proci)
109 nbrs.append(iter.key());
110 weights.append(iter());
117 weight.append(weights[i]);
124 PtrList<const lduInterface> primitiveInterfaces(0);
127 singleCellMeshPtr.reset
140 return singleCellMeshPtr;
145 Foam::procFacesGAMGProcAgglomeration::processorAgglomeration
157 autoPtr<lduPrimitiveMesh> singleCellMeshPtr
167 tmp<labelField> tfineToCoarse(
new labelField(0));
168 labelField& fineToCoarse = tfineToCoarse.ref();
170 if (singleCellMeshPtr.valid())
173 const lduPrimitiveMesh& singleCellMesh = singleCellMeshPtr();
184 forAll(fineToCoarse, celli)
186 label coarseI = fineToCoarse[celli];
187 coarseToMaster[coarseI] =
min(coarseToMaster[coarseI], celli);
195 fineToCoarse = UIndirectList<label>(oldToNew, fineToCoarse)();
201 return tfineToCoarse;
205 bool Foam::procFacesGAMGProcAgglomeration::doProcessorAgglomeration
250 Pout<<
nl <<
"Starting mesh overview" <<
endl;
251 printStats(
Pout, agglom_);
254 if (agglom_.size() >= 1)
260 label fineLevelIndex = 2;
261 fineLevelIndex < agglom_.size();
265 if (agglom_.hasMeshLevel(fineLevelIndex))
268 const lduMesh& levelMesh = agglom_.meshLevel(fineLevelIndex);
273 if (nProcs > 1 && doProcessorAgglomeration(levelMesh))
277 processorAgglomeration(levelMesh)
279 const labelField& procAgglomMap = tprocAgglomMap();
324 Pout<<
nl <<
"Agglomerated mesh overview" <<
endl;
325 printStats(
Pout, agglom_);
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
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. Return true if modified.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
T & last()
Return the last element of the list.
static void freeCommunicator(const label communicator, const bool doPstream=true)
Free a previously allocated communicator.
static bool master(const label communicator=0)
Am I the master process.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static label allocateCommunicator(const label parent, const labelList &subRanks, const bool doPstream=true)
Allocate a new communicator.
static int & msgType()
Message tag of standard messages.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
virtual const lduAddressing & lduAddr() const
Return ldu addressing.
virtual label comm() const
Return communicator used for parallel communication.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch.
label size() const
Return number of equations.
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.
void reduce(T &Value, const BinaryOp &bop) const
Helper: reduce with current communicator.
void agglomerate(const lduMesh &mesh, const scalarField &faceWeights)
Agglomerate all levels starting from the given face weights.
Processor agglomeration of GAMGAgglomerations. Needs nAgglomeratingCells which is when to start agglo...
procFacesGAMGProcAgglomeration(GAMGAgglomeration &agglom, const dictionary &controlDict)
Construct given agglomerator and controls.
virtual bool agglomerate()
Modify agglomeration. Return true if modified.
virtual ~procFacesGAMGProcAgglomeration()
Destructor.
A class for managing temporary objects.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volScalarField scalarField(fieldObject, mesh)
tmp< scalarField > faceWeights(const polyMesh &mesh, const vectorField &fCtrs, const vectorField &fAreas, const vectorField &cellCtrs)
Generate interpolation factors field.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
List< lduScheduleEntry > lduSchedule
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
UPtrList< const lduInterface > lduInterfacePtrsList
List of coupled interface fields to be used in coupling.
defineTypeNameAndDebug(combustionModel, 0)
Field< label > labelField
Specialisation of Field<T> for label.
prefixOSstream Pout(cout, "Pout")
static const label labelMax
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
randomGenerator rndGen(653213)