dimensionSet Class Reference

Dimension set for the base types. More...

Public Types

enum  { nDimensions = 7 }
 
enum  dimensionType {
  MASS, LENGTH, TIME, TEMPERATURE,
  MOLES, CURRENT, LUMINOUS_INTENSITY
}
 Define an enumeration for the names of the dimension exponents. More...
 

Public Member Functions

 ClassName ("dimensionSet")
 
 dimensionSet (const scalar mass, const scalar length, const scalar time, const scalar temperature, const scalar moles, const scalar current, const scalar luminousIntensity)
 Construct given individual dimension exponents for all. More...
 
 dimensionSet (const scalar mass, const scalar length, const scalar time, const scalar temperature, const scalar moles)
 Construct given individual dimension exponents for first. More...
 
 dimensionSet (const dimensionSet &ds)
 Copy constructor. More...
 
autoPtr< dimensionSetclone () const
 Construct and return a clone. More...
 
 dimensionSet (Istream &)
 Construct from Istream. More...
 
bool dimensionless () const
 Return true if it is dimensionless. More...
 
void reset (const dimensionSet &)
 
Istreamread (Istream &is, scalar &multiplier, const dictionary &)
 Read using provided units. Used only in initial parsing. More...
 
Istreamread (Istream &is, scalar &multiplier, const HashTable< dimensionedScalar > &)
 Read using provided units. More...
 
Istreamread (Istream &is, scalar &multiplier)
 Read using system units. More...
 
Ostreamwrite (Ostream &os, scalar &multiplier, const dimensionSets &) const
 Write using provided units. More...
 
Ostreamwrite (Ostream &os, scalar &multiplier) const
 Write using system units. More...
 
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 Attributes

static const scalar smallExponent = small
 

Friends

dimensionSet max (const dimensionSet &, const dimensionSet &)
 
dimensionSet min (const dimensionSet &, const dimensionSet &)
 
dimensionSet cmptMultiply (const dimensionSet &, const dimensionSet &)
 
dimensionSet cmptDivide (const dimensionSet &, const dimensionSet &)
 
dimensionSet cmptMag (const dimensionSet &)
 
dimensionSet pow (const dimensionSet &, const scalar)
 
dimensionSet pow (const dimensionSet &, const dimensionedScalar &)
 
dimensionSet pow (const dimensionedScalar &, const dimensionSet &)
 
dimensionSet sqr (const dimensionSet &)
 
dimensionSet pow3 (const dimensionSet &)
 
dimensionSet pow4 (const dimensionSet &)
 
dimensionSet pow5 (const dimensionSet &)
 
dimensionSet pow6 (const dimensionSet &)
 
dimensionSet pow025 (const dimensionSet &)
 
dimensionSet sqrt (const dimensionSet &)
 
dimensionSet magSqr (const dimensionSet &)
 
dimensionSet mag (const dimensionSet &)
 
dimensionSet sign (const dimensionSet &)
 
dimensionSet pos0 (const dimensionSet &)
 
dimensionSet neg (const dimensionSet &)
 
dimensionSet inv (const dimensionSet &)
 
dimensionSet trans (const dimensionSet &)
 Function to check the argument is dimensionless. More...
 
dimensionSet atan2 (const dimensionSet &, const dimensionSet &)
 
dimensionSet transform (const dimensionSet &)
 Return the argument; transformations do not change the dimensions. More...
 
dimensionSet operator- (const dimensionSet &)
 
dimensionSet operator+ (const dimensionSet &, const dimensionSet &)
 
dimensionSet operator- (const dimensionSet &, const dimensionSet &)
 
dimensionSet operator* (const dimensionSet &, const dimensionSet &)
 
dimensionSet operator/ (const dimensionSet &, const dimensionSet &)
 
dimensionSet operator & (const dimensionSet &, const dimensionSet &)
 
dimensionSet operator^ (const dimensionSet &, const dimensionSet &)
 
dimensionSet operator && (const dimensionSet &, const dimensionSet &)
 
Istreamoperator>> (Istream &, dimensionSet &)
 
Ostreamoperator<< (Ostream &, const dimensionSet &)
 

Detailed Description

Dimension set for the base types.

This type may be used to implement rigorous dimension checking for algebraic manipulation.

Source files

Definition at line 121 of file dimensionSet.H.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
nDimensions 

Definition at line 128 of file dimensionSet.H.

◆ dimensionType

Define an enumeration for the names of the dimension exponents.

Enumerator
MASS 
LENGTH 
TIME 
TEMPERATURE 
MOLES 
CURRENT 
LUMINOUS_INTENSITY 

Definition at line 134 of file dimensionSet.H.

Constructor & Destructor Documentation

◆ dimensionSet() [1/4]

dimensionSet ( const scalar  mass,
const scalar  length,
const scalar  time,
const scalar  temperature,
const scalar  moles,
const scalar  current,
const scalar  luminousIntensity 
)

Construct given individual dimension exponents for all.

seven dimensions

Definition at line 42 of file dimensionSet.C.

Referenced by dimensionSet::clone().

Here is the caller graph for this function:

◆ dimensionSet() [2/4]

dimensionSet ( const scalar  mass,
const scalar  length,
const scalar  time,
const scalar  temperature,
const scalar  moles 
)

Construct given individual dimension exponents for first.

five dimensions

Definition at line 63 of file dimensionSet.C.

◆ dimensionSet() [3/4]

dimensionSet ( const dimensionSet ds)

Copy constructor.

Definition at line 81 of file dimensionSet.C.

◆ dimensionSet() [4/4]

Member Function Documentation

◆ ClassName()

ClassName ( "dimensionSet"  )

◆ clone()

◆ dimensionless()

bool dimensionless ( ) const

Return true if it is dimensionless.

Definition at line 89 of file dimensionSet.C.

Referenced by dimensionSet::clone(), Foam::pow(), and Foam::trans().

Here is the caller graph for this function:

◆ reset()

void reset ( const dimensionSet ds)

Definition at line 108 of file dimensionSet.C.

Referenced by dimensionSet::clone(), dimensionSet::dimensionSet(), Foam::New(), and dimensionSet::read().

Here is the caller graph for this function:

◆ read() [1/3]

◆ read() [2/3]

◆ read() [3/3]

Foam::Istream & read ( Istream is,
scalar &  multiplier 
)

Read using system units.

Definition at line 488 of file dimensionSetIO.C.

References dimensionSet::read(), and Foam::unitSet().

Here is the call graph for this function:

◆ write() [1/2]

◆ write() [2/2]

Foam::Ostream & write ( Ostream os,
scalar &  multiplier 
) const

Write using system units.

Definition at line 702 of file dimensionSetIO.C.

References dimensionSet::write(), and Foam::writeUnitSet().

Here is the call graph for this function:

◆ operator[]() [1/4]

Foam::scalar operator[] ( const dimensionType  type) const

Definition at line 119 of file dimensionSet.C.

References Foam::type().

Referenced by dimensionSet::clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [2/4]

Foam::scalar & operator[] ( const dimensionType  type)

Definition at line 125 of file dimensionSet.C.

References Foam::type().

Here is the call graph for this function:

◆ operator[]() [3/4]

Foam::scalar operator[] ( const label  type) const

Definition at line 131 of file dimensionSet.C.

References Foam::type().

Here is the call graph for this function:

◆ operator[]() [4/4]

Foam::scalar & operator[] ( const label  type)

Definition at line 137 of file dimensionSet.C.

References Foam::type().

Here is the call graph for this function:

◆ operator==()

bool operator== ( const dimensionSet ds) const

Definition at line 143 of file dimensionSet.C.

References Foam::mag().

Referenced by dimensionSet::clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

bool operator!= ( const dimensionSet ds) const

Definition at line 161 of file dimensionSet.C.

References Foam::operator==().

Referenced by dimensionSet::clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

bool operator= ( const dimensionSet ds) const

Definition at line 167 of file dimensionSet.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Referenced by dimensionSet::clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+=()

bool operator+= ( const dimensionSet ds) const

Definition at line 181 of file dimensionSet.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Referenced by dimensionSet::clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator-=()

bool operator-= ( const dimensionSet ds) const

Definition at line 195 of file dimensionSet.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorInFunction.

Referenced by dimensionSet::clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator*=()

bool operator*= ( const dimensionSet ds)

Definition at line 209 of file dimensionSet.C.

Referenced by dimensionSet::clone().

Here is the caller graph for this function:

◆ operator/=()

bool operator/= ( const dimensionSet ds)

Definition at line 217 of file dimensionSet.C.

Referenced by dimensionSet::clone().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ max

dimensionSet max ( const dimensionSet ,
const dimensionSet  
)
friend

Referenced by dimensionSet::clone().

◆ min

dimensionSet min ( const dimensionSet ,
const dimensionSet  
)
friend

Referenced by dimensionSet::clone().

◆ cmptMultiply

dimensionSet cmptMultiply ( const dimensionSet ,
const dimensionSet  
)
friend

Referenced by dimensionSet::clone().

◆ cmptDivide

dimensionSet cmptDivide ( const dimensionSet ,
const dimensionSet  
)
friend

Referenced by dimensionSet::clone().

◆ cmptMag

dimensionSet cmptMag ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ pow [1/3]

dimensionSet pow ( const dimensionSet ,
const scalar   
)
friend

◆ pow [2/3]

dimensionSet pow ( const dimensionSet ,
const dimensionedScalar  
)
friend

◆ pow [3/3]

dimensionSet pow ( const dimensionedScalar ,
const dimensionSet  
)
friend

◆ sqr

dimensionSet sqr ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ pow3

dimensionSet pow3 ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ pow4

dimensionSet pow4 ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ pow5

dimensionSet pow5 ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ pow6

dimensionSet pow6 ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ pow025

dimensionSet pow025 ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ sqrt

dimensionSet sqrt ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ magSqr

dimensionSet magSqr ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ mag

◆ sign

dimensionSet sign ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ pos0

dimensionSet pos0 ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ neg

dimensionSet neg ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ inv

dimensionSet inv ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ trans

dimensionSet trans ( const dimensionSet )
friend

Function to check the argument is dimensionless.

for transcendental functions

Referenced by dimensionSet::clone().

◆ atan2

dimensionSet atan2 ( const dimensionSet ,
const dimensionSet  
)
friend

Referenced by dimensionSet::clone().

◆ transform

◆ operator- [1/2]

dimensionSet operator- ( const dimensionSet )
friend

Referenced by dimensionSet::clone().

◆ operator+

dimensionSet operator+ ( const dimensionSet ,
const dimensionSet  
)
friend

◆ operator- [2/2]

dimensionSet operator- ( const dimensionSet ,
const dimensionSet  
)
friend

◆ operator*

dimensionSet operator* ( const dimensionSet ,
const dimensionSet  
)
friend

◆ operator/

dimensionSet operator/ ( const dimensionSet ,
const dimensionSet  
)
friend

◆ operator &

dimensionSet operator& ( const dimensionSet ,
const dimensionSet  
)
friend

◆ operator^

dimensionSet operator^ ( const dimensionSet ,
const dimensionSet  
)
friend

◆ operator &&

dimensionSet operator&& ( const dimensionSet ,
const dimensionSet  
)
friend

◆ operator>>

Istream& operator>> ( Istream ,
dimensionSet  
)
friend

Referenced by dimensionSet::clone().

◆ operator<<

Ostream& operator<< ( Ostream ,
const dimensionSet  
)
friend

Referenced by dimensionSet::clone().

Member Data Documentation

◆ smallExponent

const scalar smallExponent = small
static

The documentation for this class was generated from the following files: