diff --git a/applications/test/HashTable1/Test-HashTable1.C b/applications/test/HashTable1/Test-HashTable1.C index a7daa43750263038e48ab780eb617fdb4e0bc562..3fa46376d439ffa0e398dc5b8a70a9906371cd56 100644 --- a/applications/test/HashTable1/Test-HashTable1.C +++ b/applications/test/HashTable1/Test-HashTable1.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,11 +28,12 @@ License #include "HashTable.H" #include "List.H" -#include "SortableList.H" #include "DynamicList.H" #include "FlatOutput.H" #include "IOstreams.H" #include "StringStream.H" +#include "ListOps.H" +#include "flipOp.H" using namespace Foam; @@ -209,12 +210,16 @@ int main() << "/" << table1.keys().size() << nl; - SortableList<word> sortKeys - // DynamicList<word> sortKeys + List<word> sortKeys ( - table1.keys().begin(), - table1.keys().end() + ListOps::create<word> + ( + table1.keys().begin(), + table1.keys().end(), + noOp{} + ) ); + sort(sortKeys); Info<<"sortKeys: " << flatOutput(sortKeys) << nl; } diff --git a/applications/test/ITstream/Test-ITstream.C b/applications/test/ITstream/Test-ITstream.C index aad746cd9aeaf3ae8ee1434831ce33fd14b249b7..2066cfbf96ca70020d1a65b85306281a15411227 100644 --- a/applications/test/ITstream/Test-ITstream.C +++ b/applications/test/ITstream/Test-ITstream.C @@ -33,6 +33,8 @@ Description #include "IOstreams.H" #include "argList.H" #include "ITstream.H" +#include "ListOps.H" +#include "flipOp.H" using namespace Foam; @@ -109,7 +111,7 @@ void doTest << nl << "====" << nl << endl; - ITstream its(name, input); + ITstream its(input); Info<< "got " << its.size() << " tokens - index at " << its.tokenIndex() << endl; @@ -164,7 +166,15 @@ int main(int argc, char *argv[]) string stringInput("( string ; input \"string\" to tokenize )"); - List<char> listInput(stringInput.cbegin(), stringInput.cend()); + List<char> listInput + ( + ListOps::create<char> + ( + stringInput.cbegin(), + stringInput.cend(), + Foam::noOp{} + ) + ); doTest("empty", "", true, true); diff --git a/applications/test/alloc/Make/files b/applications/test/alloc/Make/files deleted file mode 100644 index 5b51a06854ebf152c54ba25e237c0e175a66c99a..0000000000000000000000000000000000000000 --- a/applications/test/alloc/Make/files +++ /dev/null @@ -1,8 +0,0 @@ -Test-alloc.C -/* -Test-new.C -Test-malloc.C -Test.C -*/ - -EXE = $(FOAM_USER_APPBIN)/Test-alloc diff --git a/applications/test/alloc/Make/options b/applications/test/alloc/Make/options deleted file mode 100644 index 4e772fdf9d7bc94221d127458f9d2ca32850fe69..0000000000000000000000000000000000000000 --- a/applications/test/alloc/Make/options +++ /dev/null @@ -1,2 +0,0 @@ -/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */ -/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/alloc/Test-alloc.C b/applications/test/alloc/Test-alloc.C deleted file mode 100644 index db4318475b5202fdff9326f4ab55f678a6293f2d..0000000000000000000000000000000000000000 --- a/applications/test/alloc/Test-alloc.C +++ /dev/null @@ -1,27 +0,0 @@ -#include <iostream> -#include <unistd.h> - -using namespace std; - -int main() -{ - int *ptrs[500000]; - -// for (;;); - - cerr << "allocating ints\n"; - - for (int i=0; i<500000; i++) - { - ptrs[i] = new int[1]; - delete[] ptrs[i]; - } - - for (;;); - - cerr << "allocating double\n"; - - double* array = new double[500000]; - - for (;;); -} diff --git a/applications/test/alloc/Test-malloc.C b/applications/test/alloc/Test-malloc.C deleted file mode 100644 index 4bfc18a20ed9447277caed16bc48a19015541a22..0000000000000000000000000000000000000000 --- a/applications/test/alloc/Test-malloc.C +++ /dev/null @@ -1,30 +0,0 @@ -#include "stream.h" -#include <unistd.h> -#include <cstdlib> - -main() -{ - int *ptrs[500000]; - - cerr << "allocating ints\n"; - - for (int i=0; i<500000; i++) - { - ptrs[i] = (int*)malloc(sizeof(int)); - } - -// for (;;); - - cerr << "deallocating ints\n"; - - for (i=0; i<500000; i++) - { - free(ptrs[i]); - } - - cerr << "allocating double\n"; - - double* array = (double*)malloc(500000*sizeof(double)); - - for (;;); -} diff --git a/applications/test/alloc/Test-new.C b/applications/test/alloc/Test-new.C deleted file mode 100644 index 7609172b006fb317182511d35c0b3e564c98df07..0000000000000000000000000000000000000000 --- a/applications/test/alloc/Test-new.C +++ /dev/null @@ -1,30 +0,0 @@ -#include <stream.h> - -main() -{ - int* intPtrs[500000]; - - cerr << "allocating ints\n"; - - for (int i=0; i<500000; i++) - { - intPtrs[i] = new int[1]; - } - - cerr << "allocated ints\n"; - - cerr << "deallocating ints\n"; - - for (i=0; i<500000; i++) - { - delete[] intPtrs[i]; - } - - cerr << "deallocated ints\n"; - - cerr << "alloacting doubles\n"; - - double* doubles = new double[500000]; - - for (;;); -} diff --git a/applications/test/alloc/Test.C b/applications/test/alloc/Test.C deleted file mode 100644 index a2de8b24df83c9a29894e76c40dd92930a627797..0000000000000000000000000000000000000000 --- a/applications/test/alloc/Test.C +++ /dev/null @@ -1,64 +0,0 @@ -#include <cstdlib> - -class Int -{ - int I; - -public: - - Int(){} - - operator int() - { - return I; - } -}; - - -template<class T> -class List : public T -{ - T* v; - int sz; - -public: - - List() - { - v = new T[sz=10]; - } - - List(int s) - { - v = new T[sz=s]; - } - - ~List() - { - delete[] v; - } - - inline int size() const; - -}; - - -template<class T> -inline int List<T>::size() const -{ - return sz; -} - - -#include <stream.h> - -main() -{ - typedef List<Int> intList; - - intList list(10); - - cout << list.size() << "\n"; - - return 0; -} diff --git a/applications/test/bitSet2/Test-bitSet2.C b/applications/test/bitSet2/Test-bitSet2.C index df3bd8f938e5341051b211378fb131f492959ae1..df04f3ce0f91dca9cc9d532c56ce3d48947f0543 100644 --- a/applications/test/bitSet2/Test-bitSet2.C +++ b/applications/test/bitSet2/Test-bitSet2.C @@ -390,7 +390,7 @@ int main(int argc, char *argv[]) // Info<< list5 << " indices: " << list5.toc() << nl; Info<< "\nassign from indices\n"; - list4.read + list4.readList ( IStringStream ( diff --git a/applications/test/cyclic/Test-cyclic.C b/applications/test/cyclic/Test-cyclic.C index 3c7daa70836be1133794c04824f7b3e4062274dd..8952f34e117c257f80d46966fbe37b29e0605291 100644 --- a/applications/test/cyclic/Test-cyclic.C +++ b/applications/test/cyclic/Test-cyclic.C @@ -58,6 +58,8 @@ int main(int argc, char *argv[]) Info<< fvc::div(U); Info<< "End\n" << endl; + + return 0; } diff --git a/applications/test/field1/Test-field1.C b/applications/test/field1/Test-field1.C index 2cd6bc6c01d9f6ede80ea2d8f32097b5e2d25597..8808c5d4255402d1b26a75639762c36b93b88396 100644 --- a/applications/test/field1/Test-field1.C +++ b/applications/test/field1/Test-field1.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -187,9 +187,7 @@ int main(int argc, char *argv[]) Sout.precision(16); const scalar SMALLS(1e-6); - const vector SMALLV(SMALLS, SMALLS, SMALLS); const scalar GREATS(1e6); - const vector GREATV(GREATS, GREATS, GREATS); // scalarField summation { @@ -203,9 +201,9 @@ int main(int argc, char *argv[]) } // vectorField summation { - vectorField vfield(10, SMALLV); + vectorField vfield(10, vector::uniform(SMALLS)); - vfield[8] = GREATV; + vfield[8] = vector::uniform(GREATS); vfield[9] = -vfield[8]; Info<< "vectorField:" << vfield.size() << nl << " sum :" << sum(vfield) << nl @@ -213,9 +211,9 @@ int main(int argc, char *argv[]) } // sphericalTensorField summation { - sphericalTensorField tfield(10, SMALLS); + sphericalTensorField tfield(10, sphericalTensor(SMALLS)); - tfield[8] = GREATS; + tfield[8] = sphericalTensor(GREATS); tfield[9] = -tfield[8]; Info<< "sphericalTensorField:" << tfield.size() << nl << " sum :" << sum(tfield) << nl @@ -243,7 +241,6 @@ int main(int argc, char *argv[]) } - return 0; } diff --git a/applications/test/fvc/Test-fvc.C b/applications/test/fvc/Test-fvc.C index 14cac2e277545037a2a209d6d42147c68a8721cd..3b51e2204cbce1ca36927f9cadad509ebbe05770 100644 --- a/applications/test/fvc/Test-fvc.C +++ b/applications/test/fvc/Test-fvc.C @@ -60,6 +60,8 @@ int main(int argc, char *argv[]) } Info<< "End\n" << endl; + + return 0; } diff --git a/applications/test/fvc2D/Test-fvc2D.C b/applications/test/fvc2D/Test-fvc2D.C index f4f00c713383d61090b5214b3eb6f770151c8c59..fb9053bddaca188b60aab0cbe0051f5b74af305f 100644 --- a/applications/test/fvc2D/Test-fvc2D.C +++ b/applications/test/fvc2D/Test-fvc2D.C @@ -68,6 +68,8 @@ int main(int argc, char *argv[]) ); Info<< "End\n" << endl; + + return 0; } diff --git a/applications/test/graph/Test-graph.C b/applications/test/graph/Test-graph.C index 30739da80c6fc77d9d0e137298ba496d999d2fff..1b3811abddfbb14aff0a23ab622a7420d991248d 100644 --- a/applications/test/graph/Test-graph.C +++ b/applications/test/graph/Test-graph.C @@ -68,6 +68,8 @@ int main() phi.write("phi", "xmgr"); Info<< "End\n" << endl; + + return 0; } diff --git a/applications/test/graph/graphTest2.C b/applications/test/graph/graphTest2.C index 2e80e019b51832082646036211292a943f3bcec7..5564af67195c6c0d2f51ad761e609323e256796d 100644 --- a/applications/test/graph/graphTest2.C +++ b/applications/test/graph/graphTest2.C @@ -60,6 +60,8 @@ int main() ); Info<< "End\n" << endl; + + return 0; } diff --git a/applications/test/hashedWordList/Test-hashedWordList.C b/applications/test/hashedWordList/Test-hashedWordList.C index d23de96f780f4515f55615d8521ae24a3518c991..db2617eb2e17aea75f8416caf9665e1614de2405 100644 --- a/applications/test/hashedWordList/Test-hashedWordList.C +++ b/applications/test/hashedWordList/Test-hashedWordList.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -157,7 +157,6 @@ int main(int argc, char *argv[]) { ITstream input ( - "input", "(plain list with some with list duplicates)" ); diff --git a/applications/test/io/Test-io.C b/applications/test/io/Test-io.C index 2dbfcca89ec07450fbaaabde27ffb33e8dee9af4..8aabf294097694b2639dfaa85fbe1e2ab61b30ed 100644 --- a/applications/test/io/Test-io.C +++ b/applications/test/io/Test-io.C @@ -74,6 +74,9 @@ int main(void) Info.operator Foam::OSstream&() << "stop" << endl; static_cast<OSstream&>(Info) << "\nEnd\n" << nl; + + return 0; } + // ************************************************************************* // diff --git a/applications/test/predicates/Test-predicates.C b/applications/test/predicates/Test-predicates.C index 2fb27cac95ea8839ea4daa27b9c2c4f308129c3d..246e6fccebd3ec291d9866c3587a2582915cb518 100644 --- a/applications/test/predicates/Test-predicates.C +++ b/applications/test/predicates/Test-predicates.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -79,8 +79,7 @@ int main(int argc, char *argv[]) "hij_", }; - labelRange range(-10, 40); - labelList values(range.begin(), range.end()); + labelList values(identity(40, -10)); Info<<"words: " << flatOutput(words) << endl; Info<<"values: " << flatOutput(values) << endl; diff --git a/applications/test/readDir/Test-readDir.C b/applications/test/readDir/Test-readDir.C index 451828bd2dc96b7a73c373f3414df245194668ea..69af65411d84eb36b9aba1592f1ad50b31f89ec3 100644 --- a/applications/test/readDir/Test-readDir.C +++ b/applications/test/readDir/Test-readDir.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2019 OpenCFD Ltd. + Copyright (C) 2019-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) { Info<< nl; - for (const word& item : readDir(".", listType)) + for (const auto& item : readDir(".", listType)) { Info<< " " << item << nl; } diff --git a/applications/test/reconstructedDistanceFunction/Make/options b/applications/test/reconstructedDistanceFunction/Make/options index c2d01bb839c31916921da3f0af09d140daf1aa42..11a6714782cabea0edb76143a03fbe840f764176 100644 --- a/applications/test/reconstructedDistanceFunction/Make/options +++ b/applications/test/reconstructedDistanceFunction/Make/options @@ -1,11 +1,13 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/transportModels/geometricVoF/lnInclude EXE_LIBS = \ -lfiniteVolume \ + -lsurfMesh \ -lmeshTools \ -lsampling \ -lgeometricVoF diff --git a/applications/test/reconstructedDistanceFunction/Test-reconstructedDistanceFunction.C b/applications/test/reconstructedDistanceFunction/Test-reconstructedDistanceFunction.C index 612419f6fd56842f1ca2291b63f5456730a40526..efa5a33b454aeefe147c65ce8a8fff0f808ca85e 100755 --- a/applications/test/reconstructedDistanceFunction/Test-reconstructedDistanceFunction.C +++ b/applications/test/reconstructedDistanceFunction/Test-reconstructedDistanceFunction.C @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) ); Info<< "create field phi\n" << endl; - surfaceScalarField phi = fvc::interpolate(U) & mesh.Sf(); + surfaceScalarField phi(fvc::interpolate(U) & mesh.Sf()); dictionary dict = mesh.solverDict(alpha1.name()); @@ -120,6 +120,7 @@ int main(int argc, char *argv[]) Info<< "Time " << runTime.cpuTimeIncrement() << endl; + #if 0 distFunc.constructRDF ( surf->interfaceCell(), @@ -128,6 +129,7 @@ int main(int argc, char *argv[]) 2, exchangeFields_ ); + #endif } runTime.write(); diff --git a/applications/test/refPtr/Test-refPtr.C b/applications/test/refPtr/Test-refPtr.C index 5a5b872610192f4ac5fb48067a061e5f592b8b44..b2594d186c3a4496a46fcc6b4f38003985a04afc 100644 --- a/applications/test/refPtr/Test-refPtr.C +++ b/applications/test/refPtr/Test-refPtr.C @@ -94,6 +94,8 @@ int main() } Info<< "\nEnd" << endl; + + return 0; } diff --git a/applications/test/scalarOps/Test-scalarOps.C b/applications/test/scalarOps/Test-scalarOps.C index 63df21317707b501dca1d4014b984388373edc20..18d06fa9be5c540116798c7cc081120e329cae12 100644 --- a/applications/test/scalarOps/Test-scalarOps.C +++ b/applications/test/scalarOps/Test-scalarOps.C @@ -72,7 +72,7 @@ void testDivide(const List<Tuple2<T, scalar>>& list) void testModulo(const List<Tuple2<scalar, scalar>>& list) { - const scalarModuloOp<> bop; + const scalarModuloOp<scalar> bop; for (const auto& pair : list) { diff --git a/applications/test/speed/scalarSpeed/Test-scalarSpeed.C b/applications/test/speed/scalarSpeed/Test-scalarSpeed.C index d6aa317209b7ca64fc908572ab660be561fc8ca3..1e1307c775f682b4b8dd8640acdf94ce0ea82d86 100644 --- a/applications/test/speed/scalarSpeed/Test-scalarSpeed.C +++ b/applications/test/speed/scalarSpeed/Test-scalarSpeed.C @@ -189,4 +189,6 @@ int main() Snull<< sf4[1] << endl << endl; } + + return 0; } diff --git a/applications/test/speed/vectorSpeed/Test-vectorSpeed.C b/applications/test/speed/vectorSpeed/Test-vectorSpeed.C index 2eaa85b40e42c35a0a147a8accaad6ec46160241..2ab430d34a8af17586e7d45c227abbf94cfe6622 100644 --- a/applications/test/speed/vectorSpeed/Test-vectorSpeed.C +++ b/applications/test/speed/vectorSpeed/Test-vectorSpeed.C @@ -36,4 +36,6 @@ int main() Snull<< vf4[1] << endl << endl; } + + return 0; } diff --git a/applications/test/tmp/Test-tmp.C b/applications/test/tmp/Test-tmp.C index 52cbde670e6adc4a5e7048fc9aa6205b93d9931b..366fcb109982dbb7e68d0a516abc92fce40a1904 100644 --- a/applications/test/tmp/Test-tmp.C +++ b/applications/test/tmp/Test-tmp.C @@ -119,6 +119,8 @@ int main() } Info<< "\nEnd" << endl; + + return 0; } diff --git a/applications/test/wordRe/Test-wordRe.C b/applications/test/wordRe/Test-wordRe.C index f91258511da77eb3c7408c2ccb240bdf4c990edc..bf6551e3a15efdfc9e7dd08a03b8b2d8b5235c08 100644 --- a/applications/test/wordRe/Test-wordRe.C +++ b/applications/test/wordRe/Test-wordRe.C @@ -91,7 +91,7 @@ void exptl_reading(Istream& is, wordRes& list) bool testReadList_wordRes(const std::string& input) { - ITstream is("input", input); + ITstream is(input); wordRes list; exptl_reading(is, list);