54 void Foam::simpleGeomDecomp::assignToProcessorGroup
57 const label nProcGroup
60 label jump = processorGroup.size()/nProcGroup;
61 label jumpb = jump + 1;
62 label fstProcessorGroup = processorGroup.size() - jump*nProcGroup;
69 for (j=0; j<fstProcessorGroup; j++)
73 processorGroup[ind++] = j;
78 for (; j<nProcGroup; j++)
82 processorGroup[ind++] = j;
88 void Foam::simpleGeomDecomp::assignToProcessorGroup
91 const label nProcGroup,
94 const scalar summedWeights
107 const scalar jump = summedWeights/nProcGroup;
108 const label nProcGroupM1 = nProcGroup - 1;
109 scalar sumWeights = 0;
114 for (j=0; j<nProcGroupM1; j++)
116 const scalar limit = jump*scalar(j + 1);
117 while (sumWeights < limit)
119 sumWeights += weights[indices[ind]];
120 processorGroup[ind++] = j;
124 while (ind < processorGroup.size())
126 processorGroup[ind++] = nProcGroupM1;
139 labelList processorGroups(points.size());
147 const pointField rotatedPoints(rotDelta_ & points);
160 assignToProcessorGroup(processorGroups, n_.x());
164 finalDecomp[pointIndices[i]] = processorGroups[i];
176 assignToProcessorGroup(processorGroups, n_.y());
180 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
192 assignToProcessorGroup(processorGroups, n_.z());
196 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
212 labelList processorGroups(points.size());
220 const pointField rotatedPoints(rotDelta_ & points);
233 const scalar summedWeights =
sum(weights);
234 assignToProcessorGroup
245 finalDecomp[pointIndices[i]] = processorGroups[i];
257 assignToProcessorGroup
268 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
280 assignToProcessorGroup
291 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
315 return decomposeOneProc(points);
326 label nTotalPoints = 0;
329 nTotalPoints += points.
size();
342 nTotalPoints += nbrPoints.
size();
346 labelList finalDecomp(decomposeOneProc(allPoints));
352 toSlave << SubField<label>
355 globalNumbers.localSize(slave),
356 globalNumbers.offset(slave)
398 return decomposeOneProc(points, weights);
410 label nTotalPoints = 0;
414 nTotalPoints += points.
size();
434 nTotalPoints += nbrPoints.
size();
438 labelList finalDecomp(decomposeOneProc(allPoints, allWeights));
444 toSlave << SubField<label>
447 globalNumbers.localSize(slave),
448 globalNumbers.offset(slave)
465 toMaster<< points << weights;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static int masterNo()
Process index of the master.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
static bool master(const label communicator=0)
Am I the master process.
label k
Boltzmann constant.
Pre-declare related SubField type.
static bool less(const vector &x, const vector &y)
To compare normals.
Macros for easy insertion into run-time selection tables.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Input inter-processor communications stream.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
vectorField pointField
pointField is a vectorField.
Geometrical domain decomposition.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< label > labelList
A List of labels.
virtual labelList decompose(const pointField &)
Like decompose but with uniform weights on the points.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
Output inter-processor communications stream.
void setSize(const label)
Reset size of List.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
simpleGeomDecomp(const dictionary &decompositionDict)
Construct given the decomposition dictionary.