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;
59Foam::UPtrList<const Foam::mapDistributeBase> Foam::mapDistribute::extractBase
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),
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]++;
198 transformStart_.resize_nocopy(nTrafo);
199 transformElements_.resize_nocopy(nTrafo);
200 forAll(transformStart_, trafoI)
202 const label
count = nPerTransform[trafoI];
205 transformElements_[trafoI].resize_nocopy(count);
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]++;
311 transformStart_.resize_nocopy(nTrafo);
312 transformElements_.resize_nocopy(nTrafo);
313 forAll(transformStart_, trafoI)
315 const label
count = nPerTransform[trafoI];
318 transformElements_[trafoI].resize_nocopy(count);
325 transformedIndices.resize_nocopy(transformedElements.size());
326 forAll(transformedElements, celli)
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_;
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void size(const label n)
Older name for setAddressableSize.
Inter-processor communications stream.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T * get(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
label size() const noexcept
The number of entries in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Class containing processor-to-processor mapping information.
void operator=(const mapDistributeBase &rhs)
Copy assignment.
void printLayout(Ostream &os) const
Debug: print layout. Can only be used on maps with sorted.
const labelListList & constructMap() const noexcept
From subsetted data to new reconstructed data.
void transfer(mapDistributeBase &rhs)
Transfer the contents of the argument and annul the argument.
bool constructHasFlip() const noexcept
Does constructMap include a sign.
const labelListList & subMap() const noexcept
From subsetted data back to original data.
void calcCompactAddressing(const globalIndex &globalNumbering, const labelUList &elements, List< Map< label > > &compactMap) const
Construct per processor compact addressing of the global elements.
bool subHasFlip() const noexcept
Does subMap include a sign.
void exchangeAddressing(const int tag, const globalIndex &globalNumbering, labelList &elements, List< Map< label > > &compactMap, labelList &compactStart)
label comm() const noexcept
The communicator used.
void clear()
Reset to zero size, only retaining communicator.
label constructSize() const noexcept
Constructed data size.
Class containing processor-to-processor mapping information.
mapDistributeBase() noexcept
Inherit constructors.
label whichTransform(const label index) const
Find transform from transformElements.
void operator=(const mapDistribute &rhs)
Copy assignment.
void printLayout(Ostream &os) const
Debug: print layout. Can only be used on maps with sorted.
const labelListList & transformElements() const noexcept
For every globalIndexAndTransform::transformPermutations gives the elements that need to be transform...
mapDistribute() noexcept
Default construct - uses worldComm.
void transfer(mapDistribute &map)
Transfer the contents of the argument and annul the argument.
const labelList & transformStart() const noexcept
Destination in constructMap for transformed elements.
autoPtr< mapDistribute > clone() const
Clone.
void clear()
Reset to zero size, only retaining communicator.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Namespace for handling debugging switches.
Pair< label > labelPair
A pair of labels.
List< labelPair > labelPairList
List of labelPair.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
static constexpr const zero Zero
Global zero (0).
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.