91 exponents_[MASS] =
mass;
92 exponents_[LENGTH] =
length;
93 exponents_[TIME] =
time;
95 exponents_[MOLES] =
moles;
96 exponents_[CURRENT] = 0;
97 exponents_[LUMINOUS_INTENSITY] = 0;
111 for (
int Dimension=0; Dimension<nDimensions; ++Dimension)
116 exponents_[Dimension] > smallExponent
117 || exponents_[Dimension] < -smallExponent
130 for (
int Dimension=0; Dimension<nDimensions; ++Dimension)
132 exponents_[Dimension] = ds.exponents_[Dimension];
141 return exponents_[
type];
147 return exponents_[
type];
153 return exponents_[
type];
159 return exponents_[
type];
165 for (
int Dimension=0; Dimension < nDimensions; ++Dimension)
169 mag(exponents_[Dimension] - ds.exponents_[Dimension])
189 if (dimensionSet::debug && *
this != ds)
192 <<
"Different dimensions for =" <<
endl
193 <<
" dimensions : " << info() <<
" = " << ds.
info() <<
endl
203 if (dimensionSet::debug && *
this != ds)
206 <<
"Different dimensions for +=" <<
endl
207 <<
" dimensions : " << info() <<
" = " << ds.
info() <<
endl
217 if (dimensionSet::debug && *
this != ds)
220 <<
"Different dimensions for -=" <<
endl
221 <<
" dimensions : " << info() <<
" = " << ds.
info() <<
endl
249 if (dimensionSet::debug && ds1 != ds2)
252 <<
"Arguments of max have different dimensions" <<
endl
253 <<
" dimensions : " << ds1.
info() <<
" and " << ds2.
info()
263 if (dimensionSet::debug && ds1 != ds2)
266 <<
"Arguments of min have different dimensions" <<
endl
267 <<
" dimensions : " << ds1.
info() <<
" and " << ds2.
info()
327 <<
"Exponent of pow is not dimensionless"
360 <<
"Argument or exponent of pow not dimensionless" <<
endl
412 return pow(ds, 1.0/3.0);
481 <<
"Argument of trancendental function not dimensionless"
491 if (dimensionSet::debug && ds1 != ds2)
494 <<
"Arguments of atan2 have different dimensions" <<
endl
495 <<
" dimensions : " << ds1.
info() <<
" and " << ds2.
info()
537 if (dimensionSet::debug && ds1 != ds2)
540 <<
"LHS and RHS of + have different dimensions" <<
endl
541 <<
" dimensions : " << ds1.
info() <<
" + " << ds2.info()
557 if (dimensionSet::debug && ds1 != ds2)
560 <<
"LHS and RHS of - have different dimensions" <<
endl
561 <<
" dimensions : " << ds1.
info() <<
" - " << ds2.info()
565 return dimDifference;
579 dimProduct.exponents_[Dimension] += ds2.exponents_[Dimension];
596 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.
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.
const dimensionSet current
const dimensionSet temperature
const dimensionSet luminousIntensity
const dimensionSet length
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionSet & dimless
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)
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.