119 exponents_[MASS] =
mass;
120 exponents_[LENGTH] =
length;
121 exponents_[TIME] =
time;
123 exponents_[MOLES] =
moles;
124 exponents_[CURRENT] = 0;
125 exponents_[LUMINOUS_INTENSITY] = 0;
146 for (
int Dimension=0; Dimension<nDimensions; ++Dimension)
151 exponents_[Dimension] > smallExponent
152 || exponents_[Dimension] < -smallExponent
165 for (
int Dimension=0; Dimension<nDimensions; ++Dimension)
167 exponents_[Dimension] = ds.exponents_[Dimension];
176 return exponents_[
type];
182 return exponents_[
type];
188 return exponents_[
type];
194 return exponents_[
type];
200 for (
int Dimension=0; Dimension < nDimensions; ++Dimension)
204 mag(exponents_[Dimension] - ds.exponents_[Dimension])
224 if (dimensionSet::debug && *
this != ds)
227 <<
"Different dimensions for =" <<
endl
228 <<
" dimensions : " << info() <<
" = " << ds.
info() <<
endl
238 if (dimensionSet::debug && *
this != ds)
241 <<
"Different dimensions for +=" <<
endl
242 <<
" dimensions : " << info() <<
" = " << ds.
info() <<
endl
252 if (dimensionSet::debug && *
this != ds)
255 <<
"Different dimensions for -=" <<
endl
256 <<
" dimensions : " << info() <<
" = " << ds.
info() <<
endl
284 if (dimensionSet::debug && ds1 != ds2)
287 <<
"Arguments of max have different dimensions" <<
endl
288 <<
" dimensions : " << ds1.
info() <<
" and " << ds2.
info()
298 if (dimensionSet::debug && ds1 != ds2)
301 <<
"Arguments of min have different dimensions" <<
endl
302 <<
" dimensions : " << ds1.
info() <<
" and " << ds2.
info()
362 <<
"Exponent of pow is not dimensionless"
395 <<
"Argument or exponent of pow not dimensionless" <<
endl
447 return pow(ds, 1.0/3.0);
516 <<
"Argument of trancendental function not dimensionless"
526 if (dimensionSet::debug && ds1 != ds2)
529 <<
"Arguments of atan2 have different dimensions" <<
endl
530 <<
" dimensions : " << ds1.
info() <<
" and " << ds2.
info()
572 if (dimensionSet::debug && ds1 != ds2)
575 <<
"LHS and RHS of + have different dimensions" <<
endl
576 <<
" dimensions : " << ds1.
info() <<
" + " << ds2.info()
592 if (dimensionSet::debug && ds1 != ds2)
595 <<
"LHS and RHS of - have different dimensions" <<
endl
596 <<
" dimensions : " << ds1.
info() <<
" - " << ds2.info()
600 return dimDifference;
614 dimProduct.exponents_[Dimension] += ds2.exponents_[Dimension];
631 dimQuotient.exponents_[Dimension] -= ds2.exponents_[Dimension];
InfoProxy< IOstream > info() const
Return info proxy.
Initialise the NamedEnum HashTable from the static list of names.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Dimension set for the base types.
bool operator+=(const dimensionSet &) const
InfoProxy< dimensionSet > info() const
Return info proxy.
bool operator==(const dimensionSet &) const
bool operator!=(const dimensionSet &) const
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.
bool operator/=(const dimensionSet &)
bool operator-=(const dimensionSet &) const
scalar operator[](const dimensionType) const
void reset(const dimensionSet &)
static const scalar smallExponent
A small exponent with which to perform inexact comparisons.
bool dimensionless() const
Return true if it is dimensionless.
dimensionType
Define an enumeration for the names of the dimension exponents.
bool operator*=(const dimensionSet &)
bool operator=(const dimensionSet &) const
static const NamedEnum< dimensionType, 7 > & dimensionTypeNames_
Names of the dimensions.
const dimensionSet & dimensions() const
Return const reference to dimensions.
const Type & value() const
Return const reference to value.
A class for handling words, derived from string.
const Foam::autoPtr< Foam::NamedEnum< Foam::dimensionSet::dimensionType, 7 > > dimensionTypeNamesPtr_(new Foam::NamedEnum< Foam::dimensionSet::dimensionType, 7 > { "mass", "length", "time", "temperature", "moles", "current", "luminousIntensity" })
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
HashTable< dimensionSet > table
Table of dimensions.
const dimensionSet dimless
const dimensionSet current
const dimensionSet temperature
const dimensionSet luminousIntensity
const dimensionSet length
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void transform(GeometricField< Type, GeoMesh > &rtf, const GeometricField< tensor, GeoMesh > &trf, const GeometricField< Type, GeoMesh > &tf)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMultiply(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
void pow025(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
errorManip< error > abort(error &err)
void pow4(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
void pow6(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensionedScalar negPart(const dimensionedScalar &ds)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptDivide(const DimensionedField< Type, GeoMesh, PrimitiveField1 > &df1, const DimensionedField< Type, GeoMesh, PrimitiveField2 > &df2)
tmp< DimensionedField< Type, GeoMesh, Field > > operator-(const DimensionedField< Type, GeoMesh, PrimitiveField > &df1)
void inv(pointPatchField< tensor > &, const pointPatchField< tensor > &)
void pow5(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionSet normalised(const dimensionSet &)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
dimensionedScalar neg(const dimensionedScalar &ds)
void cbrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
tmp< DimensionedField< scalar, GeoMesh, Field > > atan2(const DimensionedField< scalar, GeoMesh, PrimitiveField1 > &dsf1, const DimensionedField< scalar, GeoMesh, PrimitiveField2 > &dsf2)
dimensionedScalar neg0(const dimensionedScalar &ds)
tmp< DimensionedField< Type, GeoMesh, Field > > cmptMag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensionSet perpendicular(const dimensionSet &)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
dimensionSet trans(const dimensionSet &)
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.