Commit d5acd22a authored by Mark Olesen's avatar Mark Olesen

STYLE: use labelUList typedef instead of UList<label> or unallocLabelList

parent 0b6b6ce1
......@@ -325,8 +325,8 @@ void Foam::MULES::limiter
const fvMesh& mesh = psi.mesh();
const unallocLabelList& owner = mesh.owner();
const unallocLabelList& neighb = mesh.neighbour();
const labelUList& owner = mesh.owner();
const labelUList& neighb = mesh.neighbour();
tmp<volScalarField::DimensionedInternalField> tVsc = mesh.Vsc();
const scalarField& V = tVsc();
......
......@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
(list3 |= list2).printBits(Info);
}
Info<< "\noperator|= with UList<label>\n";
Info<< "\noperator|= with labelUList\n";
{
PackedBoolList list3 = list1;
(list3 |= list2Labels).printBits(Info);
......@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
(list3 += list2).printBits(Info);
}
Info<< "\noperator+= with UList<label>\n";
Info<< "\noperator+= with labelUList\n";
{
PackedBoolList list3 = list1;
(list3 += list2Labels).printBits(Info);
......@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
(list3 -= list2).printBits(Info);
}
Info<< "\noperator-= with UList<label>\n";
Info<< "\noperator-= with labelUList\n";
{
PackedBoolList list3 = list1;
(list3 -= list2Labels).printBits(Info);
......
......@@ -124,8 +124,8 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile
<< "))" << std::endl << std::endl;
const unallocLabelList& own = owner();
const unallocLabelList& nei = neighbour();
const labelUList& own = owner();
const labelUList& nei = neighbour();
const faceList& fcs = faces();
......
......@@ -138,7 +138,7 @@ Foam::label Foam::checkTopology
{
if (patches[patchI].coupled())
{
const unallocLabelList& owners = patches[patchI].faceCells();
const labelUList& owners = patches[patchI].faceCells();
forAll(owners, i)
{
......
......@@ -128,7 +128,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
// Distribute internal faces
labelListList newCellFaces(oldCells.size());
const unallocLabelList& oldOwnerStart = lduAddr().ownerStartAddr();
const labelUList& oldOwnerStart = lduAddr().ownerStartAddr();
forAll(newCellFaces, cellI)
{
......@@ -168,7 +168,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
curInsBouFace = false;
// Get faceCells for face insertion
const unallocLabelList& curFaceCells = curPatch.faceCells();
const labelUList& curFaceCells = curPatch.faceCells();
const label curStart = curPatch.start();
forAll(curPatch, faceI)
......
......@@ -164,7 +164,7 @@ void Foam::domainDecomposition::decomposeMesh()
// Normal patch. Add faces to processor where the cell
// next to the face lives
const unallocLabelList& patchFaceCells =
const labelUList& patchFaceCells =
patches[patchi].faceCells();
forAll(patchFaceCells, facei)
......@@ -185,9 +185,9 @@ void Foam::domainDecomposition::decomposeMesh()
patches[patchi]
);
// cyclic: check opposite side on this processor
const unallocLabelList& patchFaceCells = pp.faceCells();
const labelUList& patchFaceCells = pp.faceCells();
const unallocLabelList& nbrPatchFaceCells =
const labelUList& nbrPatchFaceCells =
pp.neighbPatch().faceCells();
forAll(patchFaceCells, facei)
......@@ -259,8 +259,8 @@ void Foam::domainDecomposition::decomposeMesh()
);
// cyclic: check opposite side on this processor
const unallocLabelList& patchFaceCells = pp.faceCells();
const unallocLabelList& nbrPatchFaceCells =
const labelUList& patchFaceCells = pp.faceCells();
const labelUList& nbrPatchFaceCells =
pp.neighbPatch().faceCells();
// Store old sizes. Used to detect which inter-proc patches
......
......@@ -30,7 +30,7 @@ License
Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
(
const unallocLabelList& addressingSlice,
const labelUList& addressingSlice,
const label addressingOffset
)
:
......@@ -48,7 +48,7 @@ Foam::fvFieldDecomposer::processorVolPatchFieldDecomposer::
processorVolPatchFieldDecomposer
(
const fvMesh& mesh,
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
)
:
directAddressing_(addressingSlice.size())
......@@ -95,7 +95,7 @@ processorVolPatchFieldDecomposer
Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
processorSurfacePatchFieldDecomposer
(
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
)
:
addressing_(addressingSlice.size()),
......@@ -171,7 +171,7 @@ Foam::fvFieldDecomposer::fvFieldDecomposer
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
new processorSurfacePatchFieldDecomposer
(
static_cast<const unallocLabelList&>
static_cast<const labelUList&>
(
procMesh_.boundary()[patchi].patchSlice
(
......
......@@ -71,7 +71,7 @@ public:
//- Construct given addressing
patchFieldDecomposer
(
const unallocLabelList& addressingSlice,
const labelUList& addressingSlice,
const label addressingOffset
);
......@@ -88,7 +88,7 @@ public:
return true;
}
const unallocLabelList& directAddressing() const
const labelUList& directAddressing() const
{
return directAddressing_;
}
......@@ -112,7 +112,7 @@ public:
processorVolPatchFieldDecomposer
(
const fvMesh& mesh,
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
);
......@@ -128,7 +128,7 @@ public:
return true;
}
const unallocLabelList& directAddressing() const
const labelUList& directAddressing() const
{
return directAddressing_;
}
......@@ -149,7 +149,7 @@ public:
//- Construct given addressing
processorSurfacePatchFieldDecomposer
(
const unallocLabelList& addressingSlice
const labelUList& addressingSlice
);
......
......@@ -88,7 +88,7 @@ public:
return true;
}
const unallocLabelList& directAddressing() const
const labelUList& directAddressing() const
{
return directAddressing_;
}
......
......@@ -79,7 +79,7 @@ public:
inline static List<Keyed<T> > createList
(
const List<T>&,
const List<label>& keys
const labelUList& keys
);
......
......@@ -90,13 +90,13 @@ Foam::Keyed<T>::createList(const List<T>& lst, const label key)
template<class T>
inline Foam::List<Foam::Keyed<T> >
Foam::Keyed<T>::createList(const List<T>& lst, const List<label>& keys)
Foam::Keyed<T>::createList(const List<T>& lst, const labelUList& keys)
{
if (lst.size() != keys.size())
{
FatalErrorIn
(
"Foam::Keyed<T>::createList(const List<T>&, const List<label>&)"
"Foam::Keyed<T>::createList(const List<T>&, const labelUList&)"
)
<< "size mismatch adding keys to a list:" << nl
<< "List has size " << lst.size()
......
......@@ -65,7 +65,7 @@ public:
(
const UList<T>& posList,
const UList<T>& negList,
const UList<label>&
const labelUList&
);
//- Construct given the complete list and by transferring addressing
......@@ -100,7 +100,7 @@ public:
// Edit
//- Reset addressing
inline void resetAddressing(const UList<label>&);
inline void resetAddressing(const labelUList&);
inline void resetAddressing(const Xfer<List<label> >&);
......
......@@ -30,7 +30,7 @@ inline Foam::BiIndirectList<T>::BiIndirectList
(
const UList<T>& posList,
const UList<T>& negList,
const UList<label>& addr
const labelUList& addr
)
:
posList_(const_cast<UList<T>&>(posList)),
......@@ -94,7 +94,7 @@ inline const Foam::List<Foam::label>& Foam::BiIndirectList<T>::addressing()
template<class T>
inline void Foam::BiIndirectList<T>::resetAddressing
(
const UList<label>& addr
const labelUList& addr
)
{
addressing_ = addr;
......
......@@ -59,7 +59,7 @@ Foam::CompactListList<T, Container>::CompactListList(const List<Container>& ll)
template<class T, class Container>
Foam::CompactListList<T, Container>::CompactListList
(
const UList<label>& rowSizes
const labelUList& rowSizes
)
:
size_(rowSizes.size()),
......@@ -80,7 +80,7 @@ Foam::CompactListList<T, Container>::CompactListList
template<class T, class Container>
Foam::CompactListList<T, Container>::CompactListList
(
const UList<label>& rowSizes,
const labelUList& rowSizes,
const T& t
)
:
......@@ -178,7 +178,7 @@ void Foam::CompactListList<T, Container>::setSize
template<class T, class Container>
void Foam::CompactListList<T, Container>::setSize(const UList<label>& rowSizes)
void Foam::CompactListList<T, Container>::setSize(const labelUList& rowSizes)
{
size_ = rowSizes.size();
offsets_.setSize(rowSizes.size()+1);
......
......@@ -114,10 +114,10 @@ public:
inline CompactListList(const label nRows, const label nData, const T&);
//- Construct given list of row-sizes.
explicit CompactListList(const UList<label>& rowSizes);
explicit CompactListList(const labelUList& rowSizes);
//- Construct given list of row-sizes
CompactListList(const UList<label>& rowSizes, const T&);
CompactListList(const labelUList& rowSizes, const T&);
//- Construct by transferring the parameter contents
explicit CompactListList(const Xfer<CompactListList<T, Container> >&);
......@@ -168,7 +168,7 @@ public:
void setSize(const label nRows, const label nData, const T&);
//- Reset size of CompactListList.
void setSize(const UList<label>& rowSizes);
void setSize(const labelUList& rowSizes);
//- Reset size of CompactListList.
// This form only allows contraction of the CompactListList.
......@@ -181,7 +181,7 @@ public:
inline void resize(const label nRows, const label nData, const T&);
//- Reset size of CompactListList.
inline void resize(const UList<label>& rowSizes);
inline void resize(const labelUList& rowSizes);
//- Clear the CompactListList, i.e. set sizes to zero.
void clear();
......
......@@ -207,7 +207,7 @@ inline void Foam::CompactListList<T, Container>::resize
template<class T, class Container>
inline void Foam::CompactListList<T, Container>::resize
(
const UList<label>& rowSizes
const labelUList& rowSizes
)
{
this->setSize(rowSizes);
......
......@@ -73,7 +73,7 @@ protected:
// Constructors
//- Construct by copying the addressing array
explicit inline IndirectListAddressing(const UList<label>& addr);
explicit inline IndirectListAddressing(const labelUList& addr);
//- Construct by transferring addressing array
explicit inline IndirectListAddressing(const Xfer<List<label> >& addr);
......@@ -89,7 +89,7 @@ protected:
// Edit
//- Reset addressing
inline void resetAddressing(const UList<label>&);
inline void resetAddressing(const labelUList&);
inline void resetAddressing(const Xfer<List<label> >&);
};
......@@ -119,7 +119,7 @@ public:
// Constructors
//- Construct given the complete list and the addressing array
inline IndirectList(const UList<T>&, const UList<label>&);
inline IndirectList(const UList<T>&, const labelUList&);
//- Construct given the complete list and by transferring addressing
inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
......
......@@ -28,7 +28,7 @@ License
inline Foam::IndirectListAddressing::IndirectListAddressing
(
const UList<label>& addr
const labelUList& addr
)
:
addressing_(addr)
......@@ -48,7 +48,7 @@ template<class T>
inline Foam::IndirectList<T>::IndirectList
(
const UList<T>& completeList,
const UList<label>& addr
const labelUList& addr
)
:
IndirectListAddressing(addr),
......@@ -117,7 +117,7 @@ Foam::IndirectListAddressing::addressing() const
inline void Foam::IndirectListAddressing::resetAddressing
(
const UList<label>& addr
const labelUList& addr
)
{
addressing_ = addr;
......
......@@ -155,7 +155,7 @@ Foam::List<T>::List(List<T>& a, bool reUse)
// Construct as subset
template<class T>
Foam::List<T>::List(const UList<T>& a, const unallocLabelList& map)
Foam::List<T>::List(const UList<T>& a, const labelUList& map)
:
UList<T>(NULL, map.size())
{
......
......@@ -115,7 +115,7 @@ public:
List(List<T>&, bool reUse);
//- Construct as subset.
List(const UList<T>&, const unallocLabelList& mapAddressing);
List(const UList<T>&, const labelUList& mapAddressing);
//- Construct given start and end iterators.
template<class InputIterator>
......
......@@ -36,7 +36,7 @@ const Foam::labelList Foam::emptyLabelList = Foam::labelList(0);
Foam::labelList Foam::invert
(
const label len,
const UList<label>& map
const labelUList& map
)
{
labelList inverse(len, -1);
......@@ -49,7 +49,7 @@ Foam::labelList Foam::invert
{
if (inverse[newPos] >= 0)
{
FatalErrorIn("invert(const label, const UList<label>&)")
FatalErrorIn("invert(const label, const labelUList&)")
<< "Map is not one-to-one. At index " << i
<< " element " << newPos << " has already occurred before"
<< nl << "Please use invertOneToMany instead"
......@@ -66,7 +66,7 @@ Foam::labelList Foam::invert
Foam::labelListList Foam::invertOneToMany
(
const label len,
const UList<label>& map
const labelUList& map
)
{
labelList nElems(len, 0);
......
......@@ -56,23 +56,23 @@ static const List<Type>& emptyList()
//- Renumber the values (not the indices) of a list.
// Negative ListType elements are left as is.
template<class ListType>
ListType renumber(const UList<label>& oldToNew, const ListType&);
ListType renumber(const labelUList& oldToNew, const ListType&);
//- Inplace renumber the values of a list.
// Negative ListType elements are left as is.
template<class ListType>
void inplaceRenumber(const UList<label>& oldToNew, ListType&);
void inplaceRenumber(const labelUList& oldToNew, ListType&);
//- Reorder the elements (indices, not values) of a list.
// Negative ListType elements are left as is.
template<class ListType>
ListType reorder(const UList<label>& oldToNew, const ListType&);
ListType reorder(const labelUList& oldToNew, const ListType&);
//- Inplace reorder the elements of a list.
// Negative ListType elements are left as is.
template<class ListType>
void inplaceReorder(const UList<label>& oldToNew, ListType&);
void inplaceReorder(const labelUList& oldToNew, ListType&);
// Variants to work with iterators and sparse tables.
......@@ -80,11 +80,11 @@ void inplaceReorder(const UList<label>& oldToNew, ListType&);
//- Map values. Do not map negative values.
template<class Container>
void inplaceMapValue(const UList<label>& oldToNew, Container&);
void inplaceMapValue(const labelUList& oldToNew, Container&);
//- Recreate with mapped keys. Do not map elements with negative key.
template<class Container>
void inplaceMapKey(const UList<label>& oldToNew, Container&);
void inplaceMapKey(const labelUList& oldToNew, Container&);
//- Generate the (stable) sort order for the list
......@@ -126,10 +126,10 @@ template<class BoolListType, class ListType>
void inplaceSubset(const BoolListType& select, ListType&);
//- Invert one-to-one map. Unmapped elements will be -1.
labelList invert(const label len, const UList<label>&);
labelList invert(const label len, const labelUList&);
//- Invert one-to-many map. Unmapped elements will be size 0.
labelListList invertOneToMany(const label len, const UList<label>&);
labelListList invertOneToMany(const label len, const labelUList&);
//- Invert many-to-many.
// Input and output types need to be inherited from List.
......@@ -172,7 +172,7 @@ template<class ListType>
void setValues
(
ListType&,
const UList<label>& indices,
const labelUList& indices,
typename ListType::const_reference
);
......@@ -182,7 +182,7 @@ ListType createWithValues
(
const label sz,
typename ListType::const_reference initValue,
const UList<label>& indices,
const labelUList& indices,
typename ListType::const_reference setValue
);
......
......@@ -30,7 +30,7 @@ License
template<class ListType>
ListType Foam::renumber
(
const UList<label>& oldToNew,
const labelUList& oldToNew,
const ListType& lst
)
{
......@@ -55,7 +55,7 @@ ListType Foam::renumber
template<class ListType>
void Foam::inplaceRenumber
(
const UList<label>& oldToNew,
const labelUList& oldToNew,
ListType& lst
)
{
......@@ -72,7 +72,7 @@ void Foam::inplaceRenumber
template<class ListType>
ListType Foam::reorder
(
const UList<label>& oldToNew,
const labelUList& oldToNew,
const ListType& lst
)
{
......@@ -100,7 +100,7 @@ ListType Foam::reorder
template<class ListType>