mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: return UList range slice as a SubList
- previously returned the range slice as a UList,
but this prevents convenient assignment.
Apply similar handling for Field/SubField
Allows the following
labelRange range(...);
fullList.slice(range) = identity(range.size());
and
fullList.slice(range) = UIndirectList<T>(other, addr);
ENH: create SubList from full FixedList (simplifies interface)
- allow default constructed SubList. Use shallowCopy to 'reset' later
This commit is contained in:
@ -79,7 +79,7 @@ inline const Foam::labelList& Foam::ensightCells::cellIds() const
|
||||
inline const Foam::labelUList
|
||||
Foam::ensightCells::cellIds(const elemType etype) const
|
||||
{
|
||||
return addressing()[range(etype)];
|
||||
return addressing().slice(range(etype));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ inline const Foam::labelList& Foam::ensightFaces::faceIds() const noexcept
|
||||
inline const Foam::labelUList
|
||||
Foam::ensightFaces::faceIds(const elemType etype) const
|
||||
{
|
||||
return addressing()[range(etype)];
|
||||
return addressing().slice(range(etype));
|
||||
}
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ Foam::ensightFaces::faceOrder() const noexcept
|
||||
inline const Foam::labelUList
|
||||
Foam::ensightFaces::faceOrder(const elemType etype) const
|
||||
{
|
||||
return faceOrder_[range(etype)];
|
||||
return faceOrder_.slice(range(etype));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user