47 if (!compare(*
this,
units,
false))
50 <<
"The units " <<
units.info() <<
" provided do not match "
51 <<
"the required units " << info()
71 if (!compare(*
this,
units,
false))
74 <<
"The units " <<
units.info() <<
" provided do not match "
75 <<
"the required units " << info()
88 <<
"Optional entry '" << keyword <<
"' is not present,"
89 <<
" the default value '" << info() <<
"' will be used."
107 if (!unitConversion::compare(u, *
this,
false))
110 <<
"The units " << u.
info() <<
" provided do not match "
111 <<
"the required units " << info()
115 if (debug && (
any() || !unitConversion::compare(u, *
this,
true)))
118 <<
" of file " << is.
name()
119 <<
" with factor " << u.multiplier_ <<
endl;
142 if (!unitConversion::compare(u, *
this,
false))
145 <<
"The units " << u.
info() <<
" of " << keyword
146 <<
" in dictionary " <<
dict.
name() <<
" do not match "
147 <<
"the required units " << info()
151 if (debug && (
any() || !unitConversion::compare(u, *
this,
true)))
153 Info<<
"Unit conversion of " << keyword
155 <<
" with factor " << u.multiplier_ <<
endl;
169 token startToken(is);
175 <<
endl <<
"in stream " << is.
info()
191 units.dimensions_.readNoBegin(is);
203 is >>
units.exponents_[i];
212 <<
" in unitConversion " <<
endl <<
"in stream "
224 is >>
units.multiplier_;
232 <<
" in unitConversion " <<
endl <<
"in stream "
238 units.multiplier_ = 1;
249 units.exponents_[i] = 0;
251 units.multiplier_ = 1;
260 is.
check(
"Istream& operator>>(Istream&, unitConversion&)");
269 os <<
units.dimensions_;
272 bool nonZeroDimlessUnits =
false;
275 nonZeroDimlessUnits =
281 bool nonUnityMultiplier =
units.multiplier_ != 1;
285 if (nonZeroDimlessUnits || nonUnityMultiplier)
291 os <<
units.exponents_[i];
297 if (nonUnityMultiplier)
303 os.
check(
"Ostream& operator<<(Ostream&, const unitConversion&)");
328 os <<
units.dimensions_.info();
331 bool nonZeroDimlessUnits =
false;
334 nonZeroDimlessUnits =
340 bool nonUnityMultiplier =
units.multiplier_ != 1;
344 if (nonZeroDimlessUnits || nonUnityMultiplier)
361 if (
units.exponents_[i] != 1)
363 os <<
'^' <<
units.exponents_[i];
374 if (nonUnityMultiplier)
380 os.check(
"Ostream& operator<<(Ostream&, const InfoProxy<unitConversion>&)");
label lineNumber() const
Return current stream line number.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
virtual const fileName & name() const
Return the name of the stream.
InfoProxy< IOstream > info() const
Return info proxy.
bool eof() const
Return true if end of input seen.
A helper class for outputting values to Ostream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &)
Put back token.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const fileName & name() const
Return the dictionary name.
A list of keyword definitions, which are a keyword followed by any number of values (e....
static bool writeOptionalEntries
If true write optional keywords and values.
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
A keyword and a list of tokens is an 'entry'.
virtual ITstream & stream() const =0
Return token stream if this entry is a primitive entry.
A token holds items read from Istream.
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
bool readIfPresent(const word &keyword, const dictionary &)
Update if found in the dictionary.
static const NamedEnum< dimlessUnitType, 2 > dimlessUnitTypeNames_
Names of the dimensionless units.
static const scalar smallExponent
A small exponent with which to perform inexact comparisons.
unitConversion(const dimensionSet &, const scalar fraction, const scalar angle, const scalar multiplier)
Construct from components.
InfoProxy< unitConversion > info() const
Return info proxy.
void read(const word &keyword, const dictionary &)
Update.
dimlessUnitType
Define an enumeration for the names of the dimensionless unit.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define IOInfoInFunction(ios)
Report an IO information message using Foam::Info.
Type parseNoBegin(const label lastPrior, tokeniser &tis, const Type &identity, const HashTable< Type > &table)
Parse tokens into a dimension set or unit conversion, assuming that the '['.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
const dimensionSet dimless
labelList first(const UList< labelPair > &p)
const HashTable< unitConversion > & units()
Get the table of unit conversions.
Istream & operator>>(Istream &, pistonPointEdgeData &)
dimensioned< scalar > mag(const dimensioned< Type > &)
bool any(const boolList &l)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
const unitConversion unitless