87void Foam::simpleGeomDecomp::assignToProcessorGroup
89 labelList& processorGroup,
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;
121void 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);
189 assignToProcessorGroup(processorGroups, n_.x());
193 finalDecomp[pointIndices[i]] = processorGroups[i];
203 assignToProcessorGroup(processorGroups, n_.y());
207 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
217 assignToProcessorGroup(processorGroups, n_.z());
221 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
243 vectorLessOp sorter(rotatedPoints);
254 const scalar summedWeights =
sum(weights);
255 assignToProcessorGroup
266 finalDecomp[pointIndices[i]] = processorGroups[i];
276 assignToProcessorGroup
287 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
297 assignToProcessorGroup
308 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
336 return decomposeOneProc(
points);
347 allDecomp = decomposeOneProc(allPoints);
351 return globalNumbers.
scatter(allDecomp);
369 return decomposeOneProc(
points, weights);
381 allDecomp = decomposeOneProc(allPoints, allWeights);
386 return globalNumbers.
scatter(allDecomp);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void clear()
Clear the list, i.e. set size to zero.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if this a parallel run.
Abstract base class for domain decomposition.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Base for geometrical domain decomposition methods.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
static void gather(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking)
Collect data in processor order on master (== procIDs[0]).
static void scatter(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const UPstream::commsTypes=UPstream::commsTypes::nonBlocking)
Distribute data in processor order.
Simple geometric decomposition, selectable as simple.
splitCell * master() const
bool decompose() const noexcept
Query the decompose flag (normally off)
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Foam::word regionName(Foam::polyMesh::defaultRegion)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
List< label > labelList
A List of labels.
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.
void sort(UList< T > &list)
Sort the list.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
#define forAll(list, i)
Loop across all elements in list.
void setComponent(direction cmpt)
bool operator()(const label a, const label b) const
vectorLessOp(const UList< vector > &list, direction cmpt=vector::X)
const UList< vector > & values