MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / main

Function main

applications/test/vector/Test-vector.C:6–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace Foam;
5
6int main()
7{
8 Info<< vector::zero << endl
9 << vector::one << endl
10 << vector::dim << endl
11 << vector::rank << endl;
12
13 vector d(0.5, 0.5, 0.5);
14 d /= mag(d);
15
16 vector dSmall = (1e-100)*d;
17 dSmall /= mag(dSmall);
18
19 Info<< (dSmall - d) << endl;
20
21 d *= 4.0;
22
23 Info<< d << endl;
24
25 Info<< d + d << endl;
26
27 Info<< magSqr(d) << endl;
28
29 vector d2(0.5, 0.51, -0.5);
30 Info<< cmptMax(d2) << " "
31 << cmptSum(d2) << " "
32 << cmptProduct(d2) << " "
33 << cmptMag(d2)
34 << endl;
35 Info<< min(d, d2) << endl;
36 return 0;
37}

Callers

nothing calls this directly

Calls 7

cmptSumFunction · 0.85
cmptProductFunction · 0.85
minFunction · 0.85
magClass · 0.50
magSqrFunction · 0.50
cmptMaxFunction · 0.50
cmptMagFunction · 0.50

Tested by

no test coverage detected