57 <<
"Different dimensions for '" << what
58 <<
"'\n dimensions : " << a <<
" != " <<
b <<
nl
82 const scalar temperature,
85 const scalar luminousIntensity
90 exponents_[
MASS] = mass;
91 exponents_[
LENGTH] = length;
92 exponents_[
TIME] = time;
94 exponents_[
MOLES] = moles;
108 exponents_(ds.exponents_)
116 for (
const scalar val : exponents_)
119 if ((val > smallExponent) || (val < -smallExponent))
151 exponents_ = ds.exponents_;
159 return exponents_[
type];
165 return exponents_[
type];
171 return exponents_[
type];
177 return exponents_[
type];
183 for (
int d=0; d<nDimensions; ++d)
187 mag(exponents_[d] - ds.exponents_[d])
313 const dimensionSet& ds1,
338 const dimensionSet& ds,
345 <<
"Exponent of pow is not dimensionless" <<
endl
349 return pow(ds,
p.value());
391 return pow(ds, 0.25);
403 return pow(ds, 1.0/3.0);
483 <<
"Argument of trancendental function not dimensionless" <<
nl
556 const dimensionSet& ds1,
557 const dimensionSet& ds2
569Foam::dimensionSet Foam::operator-
584Foam::dimensionSet Foam::operator*
592 auto rhs = ds2.values().begin();
594 for (scalar& val : result.values())
604Foam::dimensionSet Foam::operator/
612 auto rhs = ds2.values().begin();
614 for (scalar& val : result.values())
624Foam::dimensionSet Foam::operator&
636 const dimensionSet& ds1,
646 const dimensionSet& ds1,
647 const dimensionSet& ds2
A 1D vector of objects of type <T> with a fixed length <N>.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
bool operator+=(const dimensionSet &) const
Addition operation, checks for identical dimensions.
bool operator==(const dimensionSet &) const
static constexpr int nDimensions
There are 7 base dimensions.
bool operator!=(const dimensionSet &) const
dimensionSet()
Default construct (dimensionless).
static bool checking(bool on) noexcept
Turn dimension checking on/off.
static bool checking() noexcept
True if dimension checking is enabled (the usual default).
bool operator/=(const dimensionSet &)
Division, modifies the exponents.
bool operator-=(const dimensionSet &) const
Subtraction operation, checks for identical dimensions.
scalar operator[](const dimensionType) const
const FixedList< scalar, 7 > & values() const noexcept
Const access to the exponents as a list.
static const scalar smallExponent
Tolerance for 'small' exponents, for near-zero rounding.
bool dimensionless() const
Return true if it is dimensionless.
void clear()
Clear exponents - resets to be dimensionless.
void reset(const dimensionSet &ds)
Copy assign the exponents from the dimensionSet.
dimensionType
Enumeration for the dimension exponents.
@ LUMINOUS_INTENSITY
Candela cd.
bool operator*=(const dimensionSet &)
Multiplication, modifies the exponents.
bool operator=(const dimensionSet &) const
Assignment operation, checks for identical dimensions. Use reset() to change the dimensions.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
limits reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
bitSet operator~(const bitSet &bitset)
Bitset complement, returns a copy of the bitset with all its bits flipped.
dimensionedScalar pow6(const dimensionedScalar &ds)
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar pow5(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar atan2(const dimensionedScalar &x, const dimensionedScalar &y)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar negPart(const dimensionedScalar &ds)
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static bool checkDims(const char *what, const dimensionSet &a, const dimensionSet &b)
dimensionedScalar hypot(const dimensionedScalar &x, const dimensionedScalar &y)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar pow4(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
dimensionSet trans(const dimensionSet &ds)
Check the argument is dimensionless (for transcendental functions).
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensionedScalar neg0(const dimensionedScalar &ds)
dimensionedScalar cbrt(const dimensionedScalar &ds)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionSet pow2(const dimensionSet &ds)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
dimensionedScalar pow025(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a).