167 if (fundamentalUnits.
found(iter().keyword()))
170 <<
"Duplicate-fundamental unit specified"
179 else if (units[j] == 1 && i == -1) i = j;
185 <<
"Non-fundamental unit specified" << units
190 fundamentalUnits.
insert(iter().keyword(), i);
205 const scalar multiplier
218 <<
"Duplicate unit " <<
name
219 <<
" read from dictionary"
237 <<
"Illegal token " << t
238 <<
". Expected character '" <<
p <<
"'."
249 word derivedUnitName;
283 || iter().keyword() ==
"set"
284 || iter().keyword() ==
"unitSet"
285 || fundamentalUnits.
found(iter().keyword())
306 addUnit(iter().keyword(), units, multiplier);
314 const bool ok =
unitsPtr_->insert(iter.key(), iter());
319 <<
"Duplicate unit " << iter.key()
320 <<
" added to dictionary"
348 return table()[unitName];
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
An STL-conforming hash table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
void putBack(const token &)
Put back token.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Dimension set for the base types.
Traits class for primitives.
Istream & stream()
Access the stream.
void putBack(const token &)
...
A token holds items read from Istream.
bool isPunctuation() const
punctuationToken pToken() const
const word & wordToken() const
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
static unitSet newAny()
Return a new "any" unit set.
T toUser(const T &) const
Convert a value to user units.
static unitSet newNone()
Return a new "none" unit set.
static unitSet newUnitless()
Return a new "unitless" unit set.
T toStandard(const T &) const
Convert a value to standard units.
void reset(const unitSet &)
Reset the unit conversion.
A class for handling words, derived from string.
Template functions to aid in the implementation of demand driven data.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
dictionary & switchSet(const char *subDictName, dictionary *&subDictPtr)
Internal function to lookup a sub-dictionary from configDict.
dictionary & configDict()
The central control dictionary.
const HashTable< dimensionSet > table
Table of dimensions.
const dimensionSet length
unitSet length_(dimensionSet(0, 1, 0, 0, 0), 0, 0, 1)
void add(const word &name, const unitSet &unit)
Add a unit conversion.
const HashTable< unitSet > & table()
Get the table of unit conversions.
void setLength(const unitSet &length)
Set the length scale to the given unit set.
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
scalar radToDeg(const scalar rad)
Convert radians to degrees.
const dimensionSet & dimless
scalar degToRad(const scalar deg)
Convert degrees to radians.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet & dimLength
void deleteDemandDrivenData(DataType *&dataPtr)
HashTable< unitSet > * addedUnitsPtr_(nullptr)
HashTable< unitSet > * unitsPtr_(nullptr)
const dictionary & unitsDict()
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dictionary * unitsDictPtr_(nullptr)
deleteUnitsPtr deleteUnitsPtr_