From 2268ea38a01d13632a258908d7a935f2ee94137b Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 4 Nov 2009 11:40:12 +0000 Subject: [PATCH] Added Container template argument for e.g. construct from faceList --- .../CompactListList/CompactListListTest.C | 13 ++ .../Lists/CompactListList/CompactListList.C | 72 +++++----- .../Lists/CompactListList/CompactListList.H | 38 +++--- .../Lists/CompactListList/CompactListListI.H | 124 ++++++++++-------- .../Lists/CompactListList/CompactListListIO.C | 12 +- .../polyTopoChange/polyTopoChange.C | 1 + .../polyTopoChange/polyTopoChange.H | 16 +-- .../polyTopoChange/polyTopoChangeI.H | 1 + 8 files changed, 160 insertions(+), 117 deletions(-) diff --git a/applications/test/CompactListList/CompactListListTest.C b/applications/test/CompactListList/CompactListListTest.C index bdc043814b..cd3270a169 100644 --- a/applications/test/CompactListList/CompactListListTest.C +++ b/applications/test/CompactListList/CompactListListTest.C @@ -34,6 +34,7 @@ Description #include "IOstreams.H" #include "OStringStream.H" #include "IStringStream.H" +#include "faceList.H" using namespace Foam; @@ -139,6 +140,18 @@ int main(int argc, char *argv[]) Info<< "cll5 = " << cll5 << endl; } + { + faceList fcs(2); + fcs[0] = face(labelList(1, 111)); + fcs[1] = face(labelList(2, 222)); + + CompactListList compactFcs(fcs); + Info<< "comactFcs:" << compactFcs << endl; + + faceList fcs2 = compactFcs(); + Info<< "fcs2:" << fcs2 << endl; + } + return 0; } diff --git a/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C b/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C index 0ce02f7e81..e91b725624 100644 --- a/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C +++ b/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C @@ -28,8 +28,8 @@ License // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // -template -Foam::CompactListList::CompactListList(const List >& ll) +template +Foam::CompactListList::CompactListList(const List& ll) : size_(ll.size()), offsets_(ll.size()+1) @@ -47,7 +47,7 @@ Foam::CompactListList::CompactListList(const List >& ll) label k = 0; forAll(ll, i) { - const List& lli = ll[i]; + const Container& lli = ll[i]; forAll(lli, j) { @@ -57,8 +57,8 @@ Foam::CompactListList::CompactListList(const List >& ll) } -template -Foam::CompactListList::CompactListList +template +Foam::CompactListList::CompactListList ( const UList