87 void Foam::simpleGeomDecomp::assignToProcessorGroup
90 const label nProcGroup
93 label jump = processorGroup.size()/nProcGroup;
94 label jumpb = jump + 1;
95 label fstProcessorGroup = processorGroup.size() - jump*nProcGroup;
102 for (j=0; j<fstProcessorGroup; j++)
104 for (label
k=0;
k<jumpb;
k++)
106 processorGroup[ind++] = j;
111 for (; j<nProcGroup; j++)
113 for (label
k=0;
k<jump;
k++)
115 processorGroup[ind++] = j;
121 void Foam::simpleGeomDecomp::assignToProcessorGroup
124 const label nProcGroup,
127 const scalar summedWeights
140 const scalar jump = summedWeights/nProcGroup;
141 const label nProcGroupM1 = nProcGroup - 1;
142 scalar sumWeights = 0;
147 for (j=0; j<nProcGroupM1; j++)
149 const scalar
limit = jump*scalar(j + 1);
150 while (sumWeights <
limit)
152 sumWeights += weights[indices[ind]];
153 processorGroup[ind++] = j;
157 while (ind < processorGroup.size())
159 processorGroup[ind++] = nProcGroupM1;
178 vectorLessOp sorter(rotatedPoints);
186 sorter.setComponent(vector::X);
189 assignToProcessorGroup(processorGroups, n_.x());
193 finalDecomp[pointIndices[i]] = processorGroups[i];
203 assignToProcessorGroup(processorGroups, n_.y());
207 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
214 sorter.setComponent(vector::Z);
217 assignToProcessorGroup(processorGroups, n_.z());
221 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
243 vectorLessOp sorter(rotatedPoints);
251 sorter.setComponent(vector::X);
254 const scalar summedWeights =
sum(weights);
255 assignToProcessorGroup
266 finalDecomp[pointIndices[i]] = processorGroups[i];
276 assignToProcessorGroup
287 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
294 sorter.setComponent(vector::Z);
297 assignToProcessorGroup
308 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
336 return decomposeOneProc(
points);
340 const globalIndex globalNumbers(
points.
size());
351 return globalNumbers.scatter(allDecomp);
369 return decomposeOneProc(
points, weights);
373 const globalIndex globalNumbers(
points.
size());
376 scalarField allWeights(globalNumbers.gather(weights));
381 allDecomp = decomposeOneProc(
allPoints, allWeights);
386 return globalNumbers.scatter(allDecomp);
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
simpleGeomDecomp(const simpleGeomDecomp &)=delete
No copy assignment.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const UList< vector > & values
bool operator()(const label a, const label b) const
static bool & parRun() noexcept
Test if this a parallel run.
label k
Boltzmann constant.
Macros for easy insertion into run-time selection tables.
virtual labelList decompose(const pointField &points) const
Decompose with uniform weights.
#define forAll(list, i)
Loop across all elements in list.
Foam::word regionName(Foam::polyMesh::defaultRegion)
vectorField pointField
pointField is a vectorField.
Base for geometrical domain decomposition methods.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void sort(UList< T > &list)
Sort the list.
complex limit(const complex &c1, const complex &c2)
void setComponent(direction cmpt)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
defineTypeNameAndDebug(combustionModel, 0)
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
vectorLessOp(const UList< vector > &list, direction cmpt=vector::X)
PtrList< volScalarField > & Y
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.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.