Go to the documentation of this file.
89 label oldSize = size();
95 else if (newSize < oldSize)
97 ptrs_.setSize(newSize);
99 else if (newSize > oldSize)
101 ptrs_.setSize(newSize);
104 for (
label i=oldSize; i<newSize; i++)
122 ptrs_.transfer(a.
ptrs_);
129 if (oldToNew.
size() != size())
132 <<
"Size of map (" << oldToNew.
size()
133 <<
") not equal to list size (" << size()
137 List<T*> newPtrs_(ptrs_.size(),
reinterpret_cast<T*
>(0));
141 label newI = oldToNew[i];
143 if (newI < 0 || newI >= size())
146 <<
"Illegal index " << newI <<
nl
147 <<
"Valid indices are 0.." << size()-1
154 <<
"reorder map is not unique; element " << newI
157 newPtrs_[newI] = ptrs_[i];
165 <<
"Element " << i <<
" not set after reordering." <<
nl
170 ptrs_.transfer(newPtrs_);
const Foam::edgeFaceCirculator Foam::edgeFaceCirculator::endConstIter * reinterpret_cast(0), -1, false, -1, false
void clear()
Clear the UPtrList, i.e. set size to zero.
#define forAll(list, i)
Loop across all elements in list.
UPtrList()
Null Constructor.
void setSize(const label)
Reset size of UPtrList. This can only be used to set the size.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
void reorder(const labelUList &)
Reorders elements. Ordering does not have to be done in.
errorManip< error > abort(error &err)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const
Return the number of elements in the UList.
void transfer(UPtrList< T > &)
Transfer the contents of the argument UPtrList into this.