dimensionSet Class Reference

Dimension set for the base types. More...

Collaboration diagram for dimensionSet:

Public Types

enum  { nDimensions = 7 }
 Define an enumeration for the number of dimensions. More...
 
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 &)
 
IstreamreadNoBegin (Istream &is)
 Read, assuming the '[' has already been read. More...
 
Istreamread (Istream &is)
 Read. More...
 
Ostreamwrite (Ostream &os) const
 Write. More...
 
InfoProxy< dimensionSetinfo () const
 Return info proxy. 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 NamedEnum< dimensionType, 7 > dimensionTypeNames_
 Names of the dimensions. More...
 
static const scalar smallExponent = rootSmall
 A small exponent with which to perform inexact comparisons. More...
 

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 &)
 
dimensionSet normalised (const dimensionSet &)
 
dimensionSet perpendicular (const dimensionSet &)
 
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 &)
 
Ostreamoperator<< (Ostream &, const InfoProxy< 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 124 of file dimensionSet.H.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Define an enumeration for the number of dimensions.

Enumerator
nDimensions 

Definition at line 132 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 138 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 62 of file dimensionSet.C.

References dimensionSet::CURRENT, dimensionSet::LENGTH, dimensionSet::LUMINOUS_INTENSITY, dimensionSet::MASS, dimensionSet::MOLES, dimensionSet::TEMPERATURE, and dimensionSet::TIME.

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 83 of file dimensionSet.C.

◆ dimensionSet() [3/4]

dimensionSet ( const dimensionSet ds)

Copy constructor.

Definition at line 102 of file dimensionSet.C.

◆ dimensionSet() [4/4]

dimensionSet ( Istream is)

Construct from Istream.

Definition at line 56 of file dimensionSetIO.C.

Member Function Documentation

◆ ClassName()

ClassName ( "dimensionSet"  )

◆ clone()

autoPtr<dimensionSet> clone ( ) const
inline

Construct and return a clone.

Definition at line 210 of file dimensionSet.H.

References dimensionSet::dimensionSet().

Here is the call graph for this function:

◆ dimensionless()

bool dimensionless ( ) const

Return true if it is dimensionless.

Definition at line 110 of file dimensionSet.C.

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

Here is the caller graph for this function:

◆ reset()

◆ readNoBegin()

◆ read()

Foam::Istream & read ( Istream is)

Read.

Definition at line 121 of file dimensionSetIO.C.

References token::BEGIN_SQR, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, and IOstream::info().

Referenced by Foam::operator>>(), and UniformDimensionedField< Type >::UniformDimensionedField().

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

◆ write()

Foam::Ostream & write ( Ostream os) const

Write.

Definition at line 138 of file dimensionSetIO.C.

References token::BEGIN_SQR, IOstream::check(), token::END_SQR, dimensionSet::nDimensions, and token::SPACE.

Referenced by Foam::operator<<(), and streamlinesParticle::writeFields().

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

◆ info()

InfoProxy<dimensionSet> info ( ) const
inline

Return info proxy.

Definition at line 239 of file dimensionSet.H.

Referenced by Foam::atan2(), Foam::max(), Foam::min(), dimensionSet::operator+=(), dimensionSet::operator-=(), and dimensionSet::operator=().

Here is the caller graph for this function:

◆ operator[]() [1/4]

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

Definition at line 140 of file dimensionSet.C.

References Foam::type().

Here is the call graph for this function:

◆ operator[]() [2/4]

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

Definition at line 146 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 152 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 158 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 164 of file dimensionSet.C.

References Foam::mag().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const dimensionSet ds) const

Definition at line 182 of file dimensionSet.C.

References Foam::operator==().

Here is the call graph for this function:

◆ operator=()

bool operator= ( const dimensionSet ds) const

Definition at line 188 of file dimensionSet.C.

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

Here is the call graph for this function:

◆ operator+=()

bool operator+= ( const dimensionSet ds) const

Definition at line 202 of file dimensionSet.C.

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

Here is the call graph for this function:

◆ operator-=()

bool operator-= ( const dimensionSet ds) const

Definition at line 216 of file dimensionSet.C.

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

Here is the call graph for this function:

◆ operator*=()

bool operator*= ( const dimensionSet ds)

Definition at line 230 of file dimensionSet.C.

◆ operator/=()

bool operator/= ( const dimensionSet ds)

Definition at line 238 of file dimensionSet.C.

Friends And Related Function Documentation

◆ max

dimensionSet max ( const dimensionSet ,
const dimensionSet  
)
friend

◆ min

dimensionSet min ( const dimensionSet ,
const dimensionSet  
)
friend

◆ cmptMultiply

dimensionSet cmptMultiply ( const dimensionSet ,
const dimensionSet  
)
friend

◆ cmptDivide

dimensionSet cmptDivide ( const dimensionSet ,
const dimensionSet  
)
friend

◆ cmptMag

dimensionSet cmptMag ( const dimensionSet )
friend

◆ 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

◆ pow3

dimensionSet pow3 ( const dimensionSet )
friend

◆ pow4

dimensionSet pow4 ( const dimensionSet )
friend

◆ pow5

dimensionSet pow5 ( const dimensionSet )
friend

◆ pow6

dimensionSet pow6 ( const dimensionSet )
friend

◆ pow025

dimensionSet pow025 ( const dimensionSet )
friend

◆ sqrt

dimensionSet sqrt ( const dimensionSet )
friend

◆ magSqr

dimensionSet magSqr ( const dimensionSet )
friend

◆ mag

dimensionSet mag ( const dimensionSet )
friend

◆ sign

dimensionSet sign ( const dimensionSet )
friend

◆ pos0

dimensionSet pos0 ( const dimensionSet )
friend

◆ neg

dimensionSet neg ( const dimensionSet )
friend

◆ inv

dimensionSet inv ( const dimensionSet )
friend

◆ trans

dimensionSet trans ( const dimensionSet )
friend

Function to check the argument is dimensionless.

for transcendental functions

◆ atan2

dimensionSet atan2 ( const dimensionSet ,
const dimensionSet  
)
friend

◆ transform

◆ normalised

dimensionSet normalised ( const dimensionSet )
friend

◆ perpendicular

dimensionSet perpendicular ( const dimensionSet )
friend

◆ operator- [1/2]

dimensionSet operator- ( const dimensionSet )
friend

◆ 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

◆ operator<< [1/2]

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

◆ operator<< [2/2]

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

Member Data Documentation

◆ dimensionTypeNames_

const Foam::NamedEnum< Foam::dimensionSet::dimensionType, 7 > dimensionTypeNames_
static

Names of the dimensions.

Definition at line 150 of file dimensionSet.H.

Referenced by Foam::operator<<().

◆ smallExponent

const scalar smallExponent = rootSmall
static

A small exponent with which to perform inexact comparisons.

Definition at line 156 of file dimensionSet.H.

Referenced by Foam::operator<<().


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