42 const scalar temperature,
45 const scalar luminousIntensity
48 exponents_[MASS] = mass;
49 exponents_[LENGTH] = length;
50 exponents_[TIME] = time;
51 exponents_[TEMPERATURE] = temperature;
52 exponents_[MOLES] = moles;
53 exponents_[CURRENT] = current;
54 exponents_[LUMINOUS_INTENSITY] = luminousIntensity;
63 const scalar temperature,
67 exponents_[MASS] = mass;
68 exponents_[LENGTH] = length;
69 exponents_[TIME] = time;
70 exponents_[TEMPERATURE] = temperature;
71 exponents_[MOLES] = moles;
72 exponents_[CURRENT] = 0;
73 exponents_[LUMINOUS_INTENSITY] = 0;
81 bool Dimensionless =
true;
83 for (
int Dimension=0; Dimension<
nDimensions; Dimension++)
85 Dimensionless = Dimensionless &&
98 for (
int Dimension=0; Dimension<nDimensions; Dimension++)
100 exponents_[Dimension] = ds.exponents_[Dimension];
109 return exponents_[
type];
114 return exponents_[
type];
122 for (
int Dimension=0; Dimension<nDimensions; Dimension++)
125 (
mag(exponents_[Dimension] - ds.exponents_[Dimension])
140 if (dimensionSet::debug && *
this != ds)
142 FatalErrorIn(
"dimensionSet::operator=(const dimensionSet& ds) const")
143 <<
"Different dimensions for =" <<
endl
144 <<
" dimensions : " << *
this <<
" = " << ds <<
endl
154 if (dimensionSet::debug && *
this != ds)
156 FatalErrorIn(
"dimensionSet::operator+=(const dimensionSet& ds) const")
157 <<
"Different dimensions for +=" <<
endl
158 <<
" dimensions : " << *
this <<
" = " << ds <<
endl
167 if (dimensionSet::debug && *
this != ds)
169 FatalErrorIn(
"dimensionSet::operator-=(const dimensionSet& ds) const")
170 <<
"Different dimensions for -=" <<
endl
171 <<
" dimensions : " << *
this <<
" = " << ds <<
endl
197 if (dimensionSet::debug && ds1 != ds2)
199 FatalErrorIn(
"max(const dimensionSet& ds1, const dimensionSet& ds2)")
200 <<
"Arguments of max have different dimensions" <<
endl
201 <<
" dimensions : " << ds1 <<
" and " << ds2 <<
endl
210 if (dimensionSet::debug && ds1 != ds2)
212 FatalErrorIn(
"min(const dimensionSet& ds1, const dimensionSet& ds2)")
213 <<
"Arguments of min have different dimensions" <<
endl
214 <<
" dimensions : " << ds1 <<
" and " << ds2 <<
endl
266 FatalErrorIn(
"pow(const dimensionSet& ds, const dimensionedScalar& dS)")
267 <<
"Exponent of pow are not dimensionless"
297 FatalErrorIn(
"pow(const dimensionedScalar& dS, const dimensionSet& ds)")
298 <<
"Argument or exponent of pow not dimensionless" <<
endl
371 <<
"Argument of trancendental function not dimensionless"
399 if (dimensionSet::debug && ds1 != ds2)
402 (
"operator+(const dimensionSet& ds1, const dimensionSet& ds2)")
403 <<
"LHS and RHS of + have different dimensions" <<
endl
404 <<
" dimensions : " << ds1 <<
" + " << ds2 <<
endl
419 if (dimensionSet::debug && ds1 != ds2)
422 (
"operator-(const dimensionSet& ds1, const dimensionSet& ds2)")
423 <<
"LHS and RHS of - have different dimensions" <<
endl
424 <<
" dimensions : " << ds1 <<
" - " << ds2 <<
endl
428 return dimDifference;
441 dimProduct.exponents_[Dimension] += ds2.exponents_[Dimension];
457 dimQuotient.exponents_[Dimension] -= ds2.exponents_[Dimension];