Go to the documentation of this file.
47 const label len = this->size();
50 for (label i=0; i < len; ++i)
75 const label len = this->size();
77 if (oldToNew.
size() != len)
80 <<
"Size of map (" << oldToNew.
size()
81 <<
") not equal to list size (" << len
82 <<
") for type " <<
typeid(
T).
name() <<
nl
88 for (label i=0; i<len; ++i)
90 const label idx = oldToNew[i];
92 if (idx < 0 || idx >= len)
95 <<
"Illegal index " << idx <<
nl
96 <<
"Valid indices are [0," << len <<
") for type "
104 <<
"reorder map is not unique; element " << idx
105 <<
" already used for type " <<
typeid(
T).
name()
108 newList[idx] = ptrs_[i];
114 const label idx = newList.
findNull();
118 <<
"Element " << idx <<
" not set after reordering." <<
nl
123 ptrs_.transfer(newList);
134 const label len = this->size();
136 if (order.
size() != len)
139 <<
"Size of map (" << order.
size()
140 <<
") not equal to list size (" << len
141 <<
") for type " <<
typeid(
T).
name() <<
nl
148 for (label i=0; i<len; ++i)
150 const label idx = order[i];
152 if (idx < 0 || idx >= len)
155 <<
"Illegal index " << idx <<
nl
156 <<
"Valid indices are [0," << len <<
") for type "
164 <<
"order map is not unique; element " << idx
165 <<
" already used for type " <<
typeid(
T).
name()
169 guard[idx] = ptrs_[idx];
170 newList[i] = ptrs_[idx];
176 const label idx = newList.
findNull();
180 <<
"Element " << idx <<
" not set after reordering." <<
nl
185 ptrs_.transfer(newList);
label findNull() const
Locate the first null entry, -1 if there are not any.
Detail::PtrListDetail< T > ptrs_
The list of pointers.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
constexpr UPtrList() noexcept
Default construct.
void sortOrder(const labelUList &order, const bool testNull=true)
OBJstream os(runTime.globalPath()/outputName)
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label squeezeNull()
Squeeze out intermediate nullptr entries in the list of pointers.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A rudimentary list of pointers used for PtrList, UPtrList, etc. This class is considered implementati...
void size(const label n)
Older name for setAddressableSize.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void reorder(const labelUList &oldToNew, const bool testNull=true)