Public Member Functions | Private Member Functions | Private Attributes | Friends
Constant Class Reference

Templated basic entry that holds a constant value. More...

Collaboration diagram for Constant:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("constant")
 
 Constant (const word &entryName, const Type &value, const dimensionSet &dimensions=dimless)
 Construct from components. More...
 
 Constant (const word &entryName, const dictionary &dict)
 Construct from entry name and dictionary. More...
 
 Constant (const Constant< Type > &cnst)
 Copy constructor. More...
 
virtual tmp< DataEntry< Type > > clone () const
 Construct and return a clone. More...
 
virtual ~Constant ()
 Destructor. More...
 
Type value (const scalar) const
 Return constant value. More...
 
Type integrate (const scalar x1, const scalar x2) const
 Integrate between two values. More...
 
dimensioned< Type > dimValue (const scalar) const
 Return dimensioned constant value. More...
 
dimensioned< Type > dimIntegrate (const scalar x1, const scalar x2) const
 Integrate between two values and return dimensioned type. More...
 
virtual void writeData (Ostream &os) const
 Write in dictionary format. More...
 

Private Member Functions

void operator= (const Constant< Type > &)
 Disallow default bitwise assignment. More...
 

Private Attributes

Type value_
 Constant value. More...
 
dimensionSet dimensions_
 The dimension set. More...
 

Friends

Ostreamoperator (Ostream &os, const Constant< Type > &cnst)
 Ostream Operator. More...
 

Detailed Description

Templated basic entry that holds a constant value.

Usage - for entry <entryName> having the value

:

    <entryName>    constant  <value>
Source files

Definition at line 51 of file Constant.H.

Constructor & Destructor Documentation

◆ Constant() [1/3]

Constant ( const word entryName,
const Type &  value,
const dimensionSet dimensions = dimless 
)

Construct from components.

◆ Constant() [2/3]

Constant ( const word entryName,
const dictionary dict 
)

Construct from entry name and dictionary.

Definition at line 31 of file Constant.C.

References token::BEGIN_SQR, dict, Constant::dimensions_, token::isWord(), Istream::putBack(), and Constant::value_.

Here is the call graph for this function:

◆ Constant() [3/3]

Constant ( const Constant< Type > &  cnst)

Copy constructor.

Definition at line 73 of file Constant.C.

◆ ~Constant()

~Constant ( )
virtual

Destructor.

Definition at line 84 of file Constant.C.

Member Function Documentation

◆ operator=()

void operator= ( const Constant< Type > &  )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "constant"  )

◆ clone()

virtual tmp<DataEntry<Type> > clone ( ) const
inlinevirtual

Construct and return a clone.

Definition at line 103 of file Constant.H.

◆ value()

Type value ( const scalar  x) const

Return constant value.

Definition at line 91 of file Constant.C.

◆ integrate()

Type integrate ( const scalar  x1,
const scalar  x2 
) const

Integrate between two values.

Definition at line 98 of file Constant.C.

◆ dimValue()

Foam::dimensioned< Type > dimValue ( const scalar  x) const

Return dimensioned constant value.

Definition at line 105 of file Constant.C.

◆ dimIntegrate()

Foam::dimensioned< Type > dimIntegrate ( const scalar  x1,
const scalar  x2 
) const

Integrate between two values and return dimensioned type.

Definition at line 113 of file Constant.C.

◆ writeData()

void writeData ( Ostream os) const
virtual

Write in dictionary format.

Definition at line 63 of file ConstantIO.C.

References Foam::nl, and writeData().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream os,
const Constant< Type > &  cnst 
)
friend

Ostream Operator.

Field Documentation

◆ value_

Type value_
private

Constant value.

Definition at line 68 of file Constant.H.

Referenced by Constant::Constant().

◆ dimensions_

dimensionSet dimensions_
private

The dimension set.

Definition at line 71 of file Constant.H.

Referenced by Constant::Constant().


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