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
86 Detail::PtrListDetail<T> newList(len);
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
145 Detail::PtrListDetail<T> newList(len);
146 Detail::PtrListDetail<T> guard(len);
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);
Detail::PtrListDetail< T > ptrs_
Ostream & operator<<(Ostream &, const boundaryPatch &p)
constexpr UPtrList() noexcept
void sortOrder(const labelUList &order, const bool testNull=true)
OBJstream os(runTime.globalPath()/outputName)
virtual bool write(const token &tok)=0
errorManip< error > abort(error &err)
#define FatalErrorInFunction
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
word name(const expressions::valueTypeCode typeCode)
A rudimentary list of pointers used for PtrList, UPtrList, etc. This class is considered implementati...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void reorder(const labelUList &oldToNew, const bool testNull=true)