93 const label nProcGroup
96 const label jump = processorGroup.
size()/nProcGroup;
97 const label jumpb = jump + 1;
98 const label fstProcessorGroup = processorGroup.
size() - jump*nProcGroup;
105 for (j=0; j<fstProcessorGroup; j++)
107 for (label
k=0;
k<jumpb;
k++)
109 processorGroup[ind++] = j;
114 for (; j<nProcGroup; j++)
116 for (label
k=0;
k<jump;
k++)
118 processorGroup[ind++] = j;
127 const label nProcGroup,
130 const scalar summedWeights
143 const scalar jump = summedWeights/nProcGroup;
144 const label nProcGroupM1 = nProcGroup - 1;
146 scalar sumWeights = 0;
151 for (j=0; j<nProcGroupM1; j++)
153 const scalar
limit = jump*scalar(j + 1);
154 while (sumWeights <
limit)
156 sumWeights += weights[indices[ind]];
157 processorGroup[ind++] = j;
161 while (ind < processorGroup.size())
163 processorGroup[ind++] = nProcGroupM1;
186 vectorLessOp sorter(rotatedPoints);
194 sorter.setComponent(vector::X);
201 finalDecomp[pointIndices[i]] = processorGroups[i];
215 finalDecomp[pointIndices[i]] +=
n_.
x()*processorGroups[i];
222 sorter.setComponent(vector::Z);
229 finalDecomp[pointIndices[i]] +=
n_.
x()*
n_.
y()*processorGroups[i];
244 return decomposeOneProc(
points);
256 vectorLessOp sorter(rotatedPoints);
264 sorter.setComponent(vector::X);
267 const scalar summedWeights =
sum(weights);
279 finalDecomp[pointIndices[i]] = processorGroups[i];
300 finalDecomp[pointIndices[i]] += n_.x()*processorGroups[i];
307 sorter.setComponent(vector::Z);
321 finalDecomp[pointIndices[i]] += n_.x()*n_.y()*processorGroups[i];
361 return decomposeOneProc(
points, weights);
365 return decomposeOneProc(
points);
371 const globalIndex globalNumbers(
points.
size());
380 allWeights = globalNumbers.gather(weights);
387 allDecomp = decomposeOneProc(
allPoints, allWeights);
397 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 construct.
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
Vector< label > n_
The divisions.
static bool & parRun() noexcept
Test if this a parallel run.
virtual labelList decompose(const pointField &points, const scalarField &weights=scalarField::null()) const
Return for every coordinate the wanted processor number. using uniform or specified point weights...
const Cmpt & y() const noexcept
Access to the vector y component.
label k
Boltzmann constant.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
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), works like std::iota() but returning a...
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)
static void assignToProcessorGroup(labelList &processorGroup, const label nProcGroup)
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...
const Cmpt & x() const noexcept
Access to the vector x component.
defineTypeNameAndDebug(combustionModel, 0)
tmp< pointField > adjustPoints(const pointField &) const
Apply delta (jitter) or rotation to coordinates.
const Cmpt & z() const noexcept
Access to the vector z component.
vectorLessOp(const UList< vector > &list, direction cmpt=vector::X)
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
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.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)