47 forAll(transformElements_, i)
49 if (!transformElements_[i].empty())
51 os <<
"transform " << i <<
':' <<
nl 52 <<
" start : " << transformStart_[i] <<
nl 53 <<
" size : " << transformElements_[i].
size() <<
endl;
61 const UPtrList<const mapDistribute>& maps
64 UPtrList<const mapDistributeBase> baseMaps(maps.size());
68 baseMaps.set(i, maps.get(i));
97 transformElements_(map.transformElements_),
98 transformStart_(map.transformStart_)
112 const label constructSize,
117 const bool subHasFlip,
118 const bool constructHasFlip,
126 std::move(constructMap),
131 transformElements_(
std::move(transformElements)),
132 transformStart_(
std::move(transformStart))
163 for (
const labelPair& elem : transformedElements)
165 label proci = globalTransforms.
processor(elem);
168 label index = globalTransforms.
index(elem);
169 compactMap[proci].insert(index, compactMap[proci].size());
192 for (
const labelPair& elem : transformedElements)
195 nPerTransform[trafoI]++;
200 forAll(transformStart_, trafoI)
202 const label
count = nPerTransform[trafoI];
212 transformedIndices.
resize_nocopy(transformedElements.size());
213 forAll(transformedElements, i)
215 const labelPair& elem = transformedElements[i];
216 label proci = globalTransforms.
processor(elem);
217 label index = globalTransforms.
index(elem);
225 : compactMap[proci][index]
228 label&
n = nPerTransform[trafoI];
230 transformElements_[trafoI][
n] = rawElemI;
232 transformedIndices[i] = transformStart_[trafoI]+
n;
245 const globalIndex& globalNumbering,
247 const globalIndexAndTransform& globalTransforms,
248 const List<labelPairList>& transformedElements,
250 List<Map<label>>& compactMap,
255 mapDistributeBase(comm)
274 label proci = globalTransforms.processor(elem);
277 label index = globalTransforms.index(elem);
278 compactMap[proci].insert(index, compactMap[proci].size());
300 const label nTrafo = globalTransforms.transformPermutations().size();
306 label trafoI = globalTransforms.transformIndex(elem);
307 nPerTransform[trafoI]++;
313 forAll(transformStart_, trafoI)
315 const label
count = nPerTransform[trafoI];
325 transformedIndices.resize_nocopy(transformedElements.size());
326 forAll(transformedElements, celli)
329 transformedIndices[celli].resize_nocopy(elems.size());
333 label proci = globalTransforms.processor(elems[i]);
334 label index = globalTransforms.index(elems[i]);
335 label trafoI = globalTransforms.transformIndex(elems[i]);
342 : compactMap[proci][index]
345 label&
n = nPerTransform[trafoI];
347 transformElements_[trafoI][
n] = rawElemI;
349 transformedIndices[celli][i] = transformStart_[trafoI]+
n;
363 const UPtrList<const mapDistribute>& maps,
369 List<Map<label>>& compactMaps
397 return findLower(transformStart_, index+1);
404 transformElements_.clear();
405 transformStart_.clear();
417 transformElements_.transfer(rhs.transformElements_);
418 transformStart_.transfer(rhs.transformStart_);
432 transformElements_ = rhs.transformElements_;
433 transformStart_ = rhs.transformStart_;
void calcCompactAddressing(const globalIndex &globalNumbering, const labelUList &elements, List< Map< label >> &compactMap) const
Construct per processor compact addressing of the global elements.
void size(const label n)
Older name for setAddressableSize.
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
Binary search to find the index of the last element in a sorted list that is less than value...
void clear()
Reset to zero size, only retaining communicator.
constexpr char nl
The newline '\n' character (0x0a)
label whichTransform(const label index) const
Find transform from transformElements.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label constructSize() const noexcept
Constructed data size.
label comm() const noexcept
The communicator used.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
List< labelPair > labelPairList
List of labelPair.
void printLayout(Ostream &os) const
Debug: print layout. Can only be used on maps with sorted.
void operator=(const mapDistribute &rhs)
Copy assignment.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
List< labelList > labelListList
List of labelList.
#define forAll(list, i)
Loop across all elements in list.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
void printLayout(Ostream &os) const
Debug: print layout. Can only be used on maps with sorted.
autoPtr< mapDistribute > clone() const
Clone.
void transfer(mapDistributeBase &rhs)
Transfer the contents of the argument and annul the argument.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
void operator=(const mapDistributeBase &rhs)
Copy assignment.
Class containing processor-to-processor mapping information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
int debug
Static debugging option.
Pair< label > labelPair
A pair of labels.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
Class containing processor-to-processor mapping information.
void exchangeAddressing(const int tag, const globalIndex &globalNumbering, labelList &elements, List< Map< label >> &compactMap, labelList &compactStart)
void transfer(mapDistribute &map)
Transfer the contents of the argument and annul the argument.
void clear()
Reset to zero size, only retaining communicator.
List< label > labelList
A List of labels.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
mapDistribute() noexcept
Default construct - uses worldComm.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Inter-processor communications stream.
static constexpr const zero Zero
Global zero (0)