40 ptrs_(
s, reinterpret_cast<
T*>(0))
54 ptrs_(lst.begin(), lst.end())
63 label oldSize = size();
69 else if (newSize < oldSize)
71 ptrs_.setSize(newSize);
73 else if (newSize > oldSize)
75 ptrs_.setSize(newSize);
78 for (
label i=oldSize; i<newSize; i++)
96 ptrs_.transfer(a.ptrs_);
103 if (oldToNew.
size() != size())
106 <<
"Size of map (" << oldToNew.
size()
107 <<
") not equal to list size (" << size()
111 List<T*> newPtrs_(ptrs_.size(),
reinterpret_cast<T*
>(0));
115 label newI = oldToNew[i];
117 if (newI < 0 || newI >= size())
120 <<
"Illegal index " << newI <<
nl
121 <<
"Valid indices are 0.." << size()-1
128 <<
"reorder map is not unique; element " << newI
131 newPtrs_[newI] = ptrs_[i];
139 <<
"Element " << i <<
" not set after reordering." <<
nl
144 ptrs_.transfer(newPtrs_);
157 if (oldI >= 0 && oldI < this->size())
159 newPtrs_[newI] = this->ptrs_[oldI];
174 result.
set(i, ptrs_[i]);
187 result.
set(i, ptrs_[i]);
#define forAll(list, i)
Loop across all elements in list.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
label size() const
Return the number of elements in the UList.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
UPtrList< T2 > convert()
Convert to list of different pointer type.
bool set(const label) const
Is element set.
void transfer(UPtrList< T > &)
Transfer the contents of the argument UPtrList into this.
UPtrList()
Null Constructor.
void reorder(const labelUList &oldToNew)
Reorders elements. Ordering does not have to be done in.
void shuffle(const labelUList &newToOld)
Reorders elements. Ordering does not have to be done in.
void clear()
Clear the UPtrList, i.e. set size to zero.
void setSize(const label)
Reset size of UPtrList. This can only be used to set the size.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)