44 for (
const label newIdx : map)
52 <<
"Inverse location " << newIdx
53 <<
" is out of range. List has size " << len
58 if (inverse[newIdx] >= 0)
61 <<
"Map is not one-to-one. At index " << i
62 <<
" element " << newIdx <<
" has already occurred\n" 63 <<
"Please use invertOneToMany instead" 86 for (
const label newIdx : map)
92 <<
"Inverse location " << newIdx
93 <<
" is out of range. List has size " << len
121 for (
const label newIdx : map)
131 for (label i=0; i < len; ++i)
133 inverse[i].resize(sizes[i]);
138 for (
const label newIdx : map)
142 inverse[newIdx][sizes[newIdx]++] = i;
159 const label len =
input.size();
171 const label newIdx = oldToNew[
pos];
203 void Foam::ListOps::unionEqOp::operator()
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< labelList > labelListList
List of labelList.
UList< label > labelUList
A UList of labels.
Various functions to operate on Lists.
dimensionedScalar pos(const dimensionedScalar &ds)
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
static Istream & input(Istream &is, IntRange< T > &range)
errorManip< error > abort(error &err)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static Ostream & output(Ostream &os, const IntRange< T > &range)
List< label > labelList
A List of labels.
ListType reorder(const labelUList &oldToNew, const ListType &input, const bool prune=false)
Reorder the elements of a list.
label size() const noexcept
Number of entries.
static constexpr const zero Zero
Global zero (0)