diff --git a/applications/test/sliceRange/Test-sliceRange.C b/applications/test/sliceRange/Test-sliceRange.C index 5b38e93f369add5abba33a9ff1345eebf36edee8..f398c6fbbe5f38febec6240adcb3af60d762e47e 100644 --- a/applications/test/sliceRange/Test-sliceRange.C +++ b/applications/test/sliceRange/Test-sliceRange.C @@ -30,10 +30,9 @@ Description #include "FixedList.H" #include "sliceRange.H" #include "SliceList.H" +#include "IndirectList.H" #include "Random.H" -#include "UIndirectList2.H" - using namespace Foam; @@ -158,6 +157,28 @@ int main(int argc, char *argv[]) // Changed list via slice: Info<< nl << "Changed via slice: " << flatOutput(list1) << nl; + + // Some indirect list + + IndirectList<scalar> indlist + ( + list1, + identity(slice1.size(), list1.size()-slice1.size()) + ); + + Info<< nl << "Indirect slice: " << flatOutput(indlist) << nl; + + indlist = 1000; + Info<< nl << "zeroed slice: " << flatOutput(indlist) << nl; + + slice1 = indlist; + + Info<< nl << "self-copy: " << flatOutput(list1) << nl; + + slice1 = 100000; + + Info<< nl << "set values: " << flatOutput(slice1) << nl + << " = " << flatOutput(list1) << nl; } Info<< "\nEnd\n" << endl; diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H index 1b467d99a7bdcb7fab7a6d0a17cb258f2bb8861e..1e140609531a42eaa64cce066a3f310e9d9e187c 100644 --- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H +++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H @@ -54,7 +54,6 @@ namespace Foam template<class T> class IndirectList -: : private Detail::IndirectListAddressing<labelList>, public UIndirectList<T> diff --git a/src/OpenFOAM/containers/Lists/SliceList/SliceList.H b/src/OpenFOAM/containers/Lists/SliceList/SliceList.H index 5908c6c1cf8500d02966c276df50c23c94aac831..d7fbb996973f66a0c7a7dd78c09e73899ad0f91a 100644 --- a/src/OpenFOAM/containers/Lists/SliceList/SliceList.H +++ b/src/OpenFOAM/containers/Lists/SliceList/SliceList.H @@ -41,8 +41,8 @@ SourceFiles #ifndef SliceList_H #define SliceList_H +#include "IndirectListAddressing.H" #include "IndirectListDetail.H" -#include "IndirectListDetailAddressing.H" #include "sliceRange.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -96,7 +96,7 @@ public: template<class AnyAddr> inline void operator=(const Detail::IndirectList<T, AnyAddr>& rhs) { - copyValues(rhs); + this->copyValues(rhs); }