ENH: patchCloud: return pTraits<Type>::max for unfound points
[OpenFOAM-1.7.x.git] / applications / test / speed / vectorSpeedTest / vectorSpeedTest.C
blobda802bab20e7c39767f97318d484536f127f5a40
1 #include "primitiveFields.H"
2 #include "cpuTime.H"
3 #include "IOstreams.H"
4 #include "OFstream.H"
6 using namespace Foam;
8 int main()
10     const label nIter = 100;
11     const label size = 1000000;
13     Info<< "Initialising fields" << endl;
15     vectorField
16         vf1(size, vector::one),
17         vf2(size, vector::one),
18         vf3(size, vector::one),
19         vf4(size);
21     Info<< "Done\n" << endl;
23     {
24         cpuTime executionTime;
26         Info<< "vectorField algebra" << endl;
28         for (register int j=0; j<nIter; j++)
29         {
30             vf4 = vf1 + vf2 - vf3;
31         }
33         Info<< "ExecutionTime = "
34             << executionTime.elapsedCpuTime()
35             << " s\n" << endl;
37         Snull<< vf4[1] << endl << endl;
38     }