36 namespace decompositionMethods
65 void Foam::decompositionMethods::simple::assignToProcessorGroup
68 const label nProcGroup
71 label jump = processorGroup.size()/nProcGroup;
72 label jumpb = jump + 1;
73 label fstProcessorGroup = processorGroup.size() - jump*nProcGroup;
80 for (j=0; j<fstProcessorGroup; j++)
84 processorGroup[ind++] = j;
89 for (; j<nProcGroup; j++)
93 processorGroup[ind++] = j;
99 void Foam::decompositionMethods::simple::assignToProcessorGroup
102 const label nProcGroup,
105 const scalar summedWeights
118 const scalar jump = summedWeights/nProcGroup;
119 const label nProcGroupM1 = nProcGroup - 1;
120 scalar sumWeights = 0;
125 for (j=0; j<nProcGroupM1; j++)
127 const scalar
limit = jump*scalar(j + 1);
128 while (sumWeights <
limit)
130 sumWeights += weights[indices[ind]];
131 processorGroup[ind++] = j;
135 while (ind < processorGroup.size())
137 processorGroup[ind++] = nProcGroupM1;
171 assignToProcessorGroup(processorGroups, n_.x());
175 finalDecomp[pointIndices[i]] = processorGroups[i];
187 assignToProcessorGroup(processorGroups, n_.y());
191 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
203 assignToProcessorGroup(processorGroups, n_.z());
207 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
244 const scalar summedWeights =
sum(weights);
245 assignToProcessorGroup
256 finalDecomp[pointIndices[i]] = processorGroups[i];
268 assignToProcessorGroup
279 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
291 assignToProcessorGroup
302 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
326 return decomposeOneProc(
points);
337 label nTotalPoints = 0;
340 nTotalPoints +=
points.size();
353 nTotalPoints += nbrPoints.
size();
357 labelList finalDecomp(decomposeOneProc(allPoints));
363 toSlave << SubField<label>
367 globalNumbers.
offset(slave)
407 checkWeights(
points, weights);
411 return decomposeOneProc(
points, weights);
423 label nTotalPoints = 0;
427 nTotalPoints +=
points.size();
447 nTotalPoints += nbrPoints.
size();
451 labelList finalDecomp(decomposeOneProc(allPoints, allWeights));
457 toSlave << SubField<label>
461 globalNumbers.
offset(slave)
478 toMaster<<
points << weights;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Input inter-processor communications stream.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Output inter-processor communications stream.
Pre-declare related SubField type.
static int masterNo()
Process index of the master.
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 bool & parRun()
Is this a parallel run?
Abstract base class for decomposition.
Geometrical domain decomposition.
simple(const dictionary &decompositionDict)
Construct given the decomposition dictionary.
virtual labelList decompose(const pointField &)
Like decompose but with uniform weights on the points.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label localSize() const
My local size.
label size() const
Global sum of localSizes.
label offset(const label proci) const
Start of proci data.
defineTypeNameAndDebug(metis, 0)
addToRunTimeSelectionTable(decompositionMethod, metis, decomposer)
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.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
vectorField pointField
pointField is a vectorField.
complex limit(const complex &, const complex &)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static bool less(const vector &x, const vector &y)
To compare normals.