ENH: symbolic units: test app

This commit is contained in:
mattijs 2012-10-08 09:44:08 +01:00
parent bdfba5ce2e
commit 31afe2d5d3

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,6 +41,45 @@ int main(int argc, char *argv[])
Info<< ds*dt << " " << dt*ds << endl;
// dimensionSet
{
Pout<< "dimensionSet construct from is:"
<< dimensionSet(IStringStream("[Pa m^2 s^-2]")())
<< endl;
IStringStream is("[Pa m^2 s^-2]");
dimensionSet dset(dimless);
is >> dset;
Pout<< "dimensionSet read:" << dset << endl;
}
// dimensionedType
{
Pout<< "construct from is:"
<< dimensionedScalar(IStringStream("bla [Pa mm^2 s^-2] 3.0")())
<< endl;
Pout<< "construct from name,is:"
<< dimensionedScalar
(
"ABC",
IStringStream("[Pa mm^2 s^-2] 3.0")()
) << endl;
Pout<< "construct from name,dimensionSet,is:"
<< dimensionedScalar
(
"ABC",
dimLength,
IStringStream("bla [mm] 3.0")()
) << endl;
{
IStringStream is("bla [mm] 3.0");
dimensionedScalar ds;
is >> ds;
Pout<< "read:" << ds << endl;
}
}
Info<< "End\n" << endl;
return 0;