Dimension set for the base types, which can be used to implement rigorous dimension checking for algebraic manipulation. More...
Public Types | |
enum | dimensionType { MASS, LENGTH, TIME, TEMPERATURE, MOLES, CURRENT, LUMINOUS_INTENSITY } |
typedef FixedList< scalar, 7 > | list_type |
Public Member Functions | |
ClassName ("dimensionSet") | |
dimensionSet () | |
dimensionSet (const scalar mass, const scalar length, const scalar time, const scalar temperature, const scalar moles, const scalar current=0, const scalar luminousIntensity=0) | |
dimensionSet (const FixedList< scalar, 7 > &dimensions) | |
dimensionSet (const dimensionSet &ds) | |
dimensionSet (const word &entryName, const dictionary &dict, const bool mandatory=true) | |
dimensionSet (const dictionary &dict, const word &entryName, const bool mandatory=true) | |
autoPtr< dimensionSet > | clone () const |
dimensionSet (Istream &is) | |
bool | dimensionless () const |
const FixedList< scalar, 7 > & | values () const noexcept |
FixedList< scalar, 7 > & | values () noexcept |
void | clear () |
void | reset (const dimensionSet &ds) |
bool | readEntry (const word &entryName, const dictionary &dict, const bool mandatory=true) |
Istream & | read (Istream &is, scalar &multiplier, const dictionary &) |
Istream & | read (Istream &is, scalar &multiplier, const HashTable< dimensionedScalar > &) |
Istream & | read (Istream &is, scalar &multiplier) |
Ostream & | write (Ostream &os, scalar &multiplier, const dimensionSets &) const |
Ostream & | write (Ostream &os, scalar &multiplier) const |
scalar | operator[] (const dimensionType) const |
scalar & | operator[] (const dimensionType) |
scalar | operator[] (const label) const |
scalar & | operator[] (const label) |
bool | operator== (const dimensionSet &) const |
bool | operator!= (const dimensionSet &) const |
bool | operator= (const dimensionSet &) const |
bool | operator+= (const dimensionSet &) const |
bool | operator-= (const dimensionSet &) const |
bool | operator*= (const dimensionSet &) |
bool | operator/= (const dimensionSet &) |
Static Public Member Functions | |
static bool | checking (const bool on) noexcept |
static bool | checking () noexcept |
Static Public Attributes | |
static constexpr int | nDimensions = 7 |
static const scalar | smallExponent = SMALL |
Dimension set for the base types, which can be used to implement rigorous dimension checking for algebraic manipulation.
The dimensions are specified in the following order (SI units for reference only):
Property | SI Description | SI unit |
---|---|---|
MASS | kilogram | kg |
LENGTH | metre | m |
TIME | second | s |
TEMPERATURE | Kelvin | K |
MOLES | mole | mol |
CURRENT | Ampere | A |
LUMINOUS_INTENSITY | Candela | cd |
Definition at line 104 of file dimensionSet.H.
Definition at line 109 of file dimensionSet.H.
enum dimensionType |
Enumerator | |
---|---|
MASS | kilogram |
LENGTH | metre |
TIME | second |
TEMPERATURE | Kelvin |
MOLES | mole |
CURRENT | Ampere |
LUMINOUS_INTENSITY | Candela |
Definition at line 118 of file dimensionSet.H.
dimensionSet | ( | ) |
Definition at line 64 of file dimensionSet.C.
dimensionSet | ( | const scalar | mass, |
const scalar | length, | ||
const scalar | time, | ||
const scalar | temperature, | ||
const scalar | moles, | ||
const scalar | current = 0 , |
||
const scalar | luminousIntensity = 0 |
||
) |
Definition at line 71 of file dimensionSet.C.
dimensionSet | ( | const FixedList< scalar, 7 > & | dimensions | ) |
Definition at line 93 of file dimensionSet.C.
dimensionSet | ( | const dimensionSet & | ds | ) |
Definition at line 99 of file dimensionSet.C.
dimensionSet | ( | const word & | entryName, |
const dictionary & | dict, | ||
const bool | mandatory = true |
||
) |
entryName | Lookup key. LITERAL (not REGEX) |
Definition at line 31 of file dimensionSetIO.C.
References dict.
dimensionSet | ( | const dictionary & | dict, |
const word & | entryName, | ||
const bool | mandatory = true |
||
) |
entryName | Lookup key. LITERAL (not REGEX) |
Definition at line 44 of file dimensionSetIO.C.
References dict.
|
explicit |
Definition at line 56 of file dimensionSetIO.C.
ClassName | ( | "dimensionSet" | ) |
Definition at line 217 of file dimensionSet.H.
References Foam::expressions::patchExpr::debug.
|
inlinestaticnoexcept |
Definition at line 225 of file dimensionSet.H.
References Foam::expressions::patchExpr::debug.
Referenced by Foam::atan2(), Foam::clip(), Foam::hypot(), Foam::max(), Foam::min(), Foam::operator+(), dimensionSet::operator+=(), Foam::operator-(), dimensionSet::operator-=(), dimensionSet::operator=(), Foam::pow(), and Foam::trans().
|
inline |
Definition at line 272 of file dimensionSet.H.
References autoPtr::New().
bool dimensionless | ( | ) | const |
Definition at line 107 of file dimensionSet.C.
Referenced by Foam::pow(), and Foam::trans().
|
noexcept |
Definition at line 123 of file dimensionSet.C.
Referenced by Foam::operator*(), Foam::operator/(), and dimensionSet::read().
|
noexcept |
void clear | ( | ) |
Definition at line 136 of file dimensionSet.C.
References Foam::Zero.
void reset | ( | const dimensionSet & | ds | ) |
Definition at line 142 of file dimensionSet.C.
Referenced by dimensionSet::read(), and KinematicCloud< Cloud< basicKinematicCollidingParcel > >::SU().
bool readEntry | ( | const word & | entryName, |
const dictionary & | dict, | ||
const bool | mandatory = true |
||
) |
entryName | Lookup key. LITERAL (not REGEX) |
dict | The dictionary |
mandatory | The entry is mandatory |
Definition at line 422 of file dimensionSetIO.C.
References dict, Foam::constant::electromagnetic::e, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::findEntry(), keyType::LITERAL, Foam::nl, and dictionary::relativeName().
Foam::Istream & read | ( | Istream & | is, |
scalar & | multiplier, | ||
const dictionary & | readSet | ||
) |
Definition at line 541 of file dimensionSetIO.C.
References token::BEGIN_SQR, IOstream::check(), dimensionSet::CURRENT, token::END_SQR, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, IOstream::info(), token::isNumber(), token::isWord(), keyType::LITERAL, dictionary::lookup(), dimensionSet::LUMINOUS_INTENSITY, dimensionSet::MASS, dimensionSet::nDimensions, Foam::nl, token::number(), Foam::pow(), dimensionSet::reset(), s, and token::wordToken().
Referenced by Foam::operator>>().
Foam::Istream & read | ( | Istream & | is, |
scalar & | multiplier, | ||
const HashTable< dimensionedScalar > & | readSet | ||
) |
Definition at line 454 of file dimensionSetIO.C.
References token::BEGIN_SQR, IOstream::check(), dimensionSet::CURRENT, dimensioned::dimensions(), token::END_SQR, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, IOstream::info(), token::isNumber(), dimensionSet::LUMINOUS_INTENSITY, dimensionSet::MASS, Foam::nl, token::number(), Istream::putBack(), dimensioned::value(), and dimensionSet::values().
Foam::Istream & read | ( | Istream & | is, |
scalar & | multiplier | ||
) |
Definition at line 531 of file dimensionSetIO.C.
References Foam::read(), and Foam::unitSet().
Foam::Ostream & write | ( | Ostream & | os, |
scalar & | multiplier, | ||
const dimensionSets & | writeUnits | ||
) | const |
Definition at line 665 of file dimensionSetIO.C.
References IOstreamOption::ASCII, token::BEGIN_SQR, IOstream::check(), dimensionSets::coefficients(), token::END_SQR, forAll, IOstreamOption::format(), FUNCTION_NAME, Foam::mag(), dimensioned::name(), dimensionSet::nDimensions, os(), Foam::pow(), OSstream::precision(), token::SPACE, dimensionSets::units(), dimensionSets::valid(), and dimensioned::value().
Referenced by Foam::operator<<().
Foam::Ostream & write | ( | Ostream & | os, |
scalar & | multiplier | ||
) | const |
Definition at line 737 of file dimensionSetIO.C.
References os(), Foam::vtk::write(), and Foam::writeUnitSet().
Foam::scalar operator[] | ( | const dimensionType | type | ) | const |
Definition at line 150 of file dimensionSet.C.
References Foam::type().
Foam::scalar & operator[] | ( | const dimensionType | type | ) |
Definition at line 156 of file dimensionSet.C.
References Foam::type().
Foam::scalar operator[] | ( | const label | type | ) | const |
Definition at line 162 of file dimensionSet.C.
References Foam::type().
Foam::scalar & operator[] | ( | const label | type | ) |
Definition at line 168 of file dimensionSet.C.
References Foam::type().
bool operator== | ( | const dimensionSet & | ds | ) | const |
Definition at line 174 of file dimensionSet.C.
References Foam::mag().
bool operator!= | ( | const dimensionSet & | ds | ) | const |
Definition at line 192 of file dimensionSet.C.
References Foam::operator==().
bool operator= | ( | const dimensionSet & | ds | ) | const |
Definition at line 198 of file dimensionSet.C.
References Foam::checkDims(), and dimensionSet::checking().
bool operator+= | ( | const dimensionSet & | ds | ) | const |
Definition at line 209 of file dimensionSet.C.
References Foam::checkDims(), and dimensionSet::checking().
bool operator-= | ( | const dimensionSet & | ds | ) | const |
Definition at line 220 of file dimensionSet.C.
References Foam::checkDims(), and dimensionSet::checking().
bool operator*= | ( | const dimensionSet & | ds | ) |
Definition at line 231 of file dimensionSet.C.
References reset().
bool operator/= | ( | const dimensionSet & | ds | ) |
Definition at line 239 of file dimensionSet.C.
References reset().
|
staticconstexpr |
Definition at line 115 of file dimensionSet.H.
Referenced by dimensionSet::read(), and dimensionSet::write().
|
static |
Definition at line 133 of file dimensionSet.H.
Referenced by Foam::operator>>().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.