mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: uniform 'Test-' prefix for all applications/test
- easier to clean, avoid confusion with 'real' applications, etc.
This commit is contained in:
37
applications/test/vector/Test-vector.C
Normal file
37
applications/test/vector/Test-vector.C
Normal file
@ -0,0 +1,37 @@
|
||||
#include "vector.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
int main()
|
||||
{
|
||||
Info<< vector::zero << endl
|
||||
<< vector::one << endl
|
||||
<< vector::dim << endl
|
||||
<< vector::rank << endl;
|
||||
|
||||
vector d(0.5, 0.5, 0.5);
|
||||
d /= mag(d);
|
||||
|
||||
vector dSmall = (1e-100)*d;
|
||||
dSmall /= mag(dSmall);
|
||||
|
||||
Info<< (dSmall - d) << endl;
|
||||
|
||||
d *= 4.0;
|
||||
|
||||
Info<< d << endl;
|
||||
|
||||
Info<< d + d << endl;
|
||||
|
||||
Info<< magSqr(d) << endl;
|
||||
|
||||
vector d2(0.5, 0.51, -0.5);
|
||||
Info<< cmptMax(d2) << " "
|
||||
<< cmptSum(d2) << " "
|
||||
<< cmptProduct(d2) << " "
|
||||
<< cmptMag(d2)
|
||||
<< endl;
|
||||
Info<< min(d, d2) << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user