39 #ifndef dimensionedConstants_H 40 #define dimensionedConstants_H 72 if (unitDict.found(group))
75 if (groupDict.
found(varName))
81 groupDict.
add(varName, defaultValue);
88 unitDict.subDict(group).add(varName, defaultValue);
96 #define defineDimensionedConstant(Group,Switch,Tag,Name) \ 97 const Foam::dimensionedScalar Switch; \ 98 class add##Tag##ToDimensionedConstant \ 100 public Foam::simpleRegIOobject \ 103 add##Tag##ToDimensionedConstant(const char* name) \ 105 Foam::simpleRegIOobject \ 106 (Foam::debug::addDimensionedConstantObject,name) \ 108 Foam::dimensionedScalar ds \ 110 Foam::dimensionedConstant \ 116 Foam::dimensionedScalar& s = const_cast<Foam::dimensionedScalar&> \ 120 s.dimensions().reset(ds.dimensions()); \ 123 virtual ~add##Tag##ToDimensionedConstant() \ 125 virtual void readData(Foam::Istream& is) \ 127 const_cast<Foam::dimensionedScalar&>(Switch) = \ 128 Foam::dimensionedConstant \ 134 virtual void writeData(Foam::Ostream& os) const \ 139 add##Tag##ToDimensionedConstant add##Tag##ToDimensionedConstant_(Name) 143 #define defineDimensionedConstantWithDefault\ 144 (Group,Switch,DefaultExpr,Tag,Name) \ 145 const Foam::dimensionedScalar Switch; \ 146 class add##Tag##ToDimensionedConstantWithDefault \ 148 public Foam::simpleRegIOobject \ 151 add##Tag##ToDimensionedConstantWithDefault(const char* name) \ 153 Foam::simpleRegIOobject \ 154 (Foam::debug::addDimensionedConstantObject,name) \ 156 Foam::dimensionedScalar ds \ 158 Foam::dimensionedConstant \ 162 Foam::dimensionedScalar(Name,DefaultExpr) \ 165 Foam::dimensionedScalar& s = const_cast<Foam::dimensionedScalar&> \ 169 s.dimensions().reset(ds.dimensions()); \ 172 virtual ~add##Tag##ToDimensionedConstantWithDefault() \ 174 virtual void readData(Foam::Istream& is) \ 176 const_cast<Foam::dimensionedScalar&>(Switch) = \ 177 Foam::dimensionedConstant \ 181 Foam::dimensionedScalar(Name,DefaultExpr) \ 184 virtual void writeData(Foam::Ostream& os) const \ 189 add##Tag##ToDimensionedConstantWithDefault \ 190 add##Tag##ToDimensionedConstantWithDefault_(Name) const char *const group
Group name for atomic constants.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
A list of keyword definitions, which are a keyword followed by any number of values (e...
static const dictionary null
Null dictionary.
Traits class for primitives.
dictionary & dimensionedConstants()
bool add(entry *, bool mergeEntry=false)
Add a new entry.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
A class for handling words, derived from string.
const HashTable< dimensionedScalar > & unitSet()
Set of all dimensions.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedScalar dimensionedConstant(const word &group, const word &varName)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.