59 #ifndef Foam_use_scalarImpl_header 60 #error "scalarImpl.H" is only to be included internally 105 static const char*
const typeName;
106 static const char*
const componentNames[];
111 static const Scalar rootMax;
112 static const Scalar rootMin;
235 return (
s >= 0)? 1: -1;
242 return (
s > 0)? 1: 0;
249 return (
s >= 0)? 1: 0;
256 return (
s < 0)? 1: 0;
263 return (
s <= 0)? 1: 0;
270 return (
s > 0)?
s: 0;
278 return (
s < 0)?
s: 0;
297 return (val < 0) ? 0 : (1 < val) ? 1 : val;
310 return (
mag(s1) <
mag(s2)) ? s1: 0.0;
316 return (
mag(s1) <
mag(s2)) ? s1: s2;
444 return maga*
sqrt(1.0 +
sqr(magb/maga));
486 return (
mag(a -
b) <= tolerance) ? 0 : (a -
b);
492 template<
class T>
struct equalOp;
508 return mag(a -
b) <= tolerance;
530 return mag(a -
b) > tolerance;
545 return std::floor(
x);
551 template<
class T>
struct ceilOp;
565 template<
class T>
struct roundOp;
573 return std::round(
x);
dimensionedScalar sign(const dimensionedScalar &ds)
dimensionedScalar tanh(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensionedScalar log(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
bool equal(const T &a, const T &b)
Compare two values for equality.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
dimensionedScalar yn(const int n, const dimensionedScalar &ds)
Three-way comparison operation of two parameters,.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionedScalar pow025(const dimensionedScalar &ds)
A traits class, which is primarily used for primitives and vector-space.
bool operator()(const T &x, const T &y) const
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
dimensionedScalar y0(const dimensionedScalar &ds)
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
Scalar magType
Magnitude type.
dimensionedScalar posPart(const dimensionedScalar &ds)
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedScalar asin(const dimensionedScalar &ds)
dimensionedScalar pow5(const dimensionedScalar &ds)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Extract name (as a word) from an object, typically using its name() method.
dimensionedScalar j1(const dimensionedScalar &ds)
pTraits(const Base &obj)
Copy construct from base class.
bool notEqual(const Scalar a, const Scalar b)
dimensionedScalar pos(const dimensionedScalar &ds)
dimensionedScalar acosh(const dimensionedScalar &ds)
dimensionedScalar cos(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensionedScalar exp(const dimensionedScalar &ds)
void cmptMagSqr(Field< Type > &result, const UList< Type > &f1)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
dimensionedScalar asinh(const dimensionedScalar &ds)
dimensionedScalar jn(const int n, const dimensionedScalar &ds)
Istream & operator>>(Istream &, directionInfo &)
dimensionedScalar cbrt(const dimensionedScalar &ds)
complex limit(const complex &c1, const complex &c2)
Scalar sqrtSumSqr(const Scalar a, const Scalar b)
dimensionedScalar neg0(const dimensionedScalar &ds)
dimensionedScalar atanh(const dimensionedScalar &ds)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
dimensionedScalar y1(const dimensionedScalar &ds)
Scalar cmptPow(const Scalar s1, const Scalar s2)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
word operator()(const T &obj) const
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar pos0(const dimensionedScalar &ds)
dimensionedScalar sin(const dimensionedScalar &ds)
Scalar cmptSqr(const Scalar s)
dimensionedScalar erf(const dimensionedScalar &ds)
OBJstream os(runTime.globalPath()/outputName)
Scalar cmptType
Component type.
#define besselFunc2(func)
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
Scalar ScalarRead(const char *buf)
Parse entire buffer as a float/double, skipping leading/trailing whitespace.
dimensionedScalar lgamma(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
dimensionedScalar pow3(const dimensionedScalar &ds)
Scalar minMod(const Scalar s1, const Scalar s2)
dimensionedScalar erfc(const dimensionedScalar &ds)
dimensionedScalar sinh(const dimensionedScalar &ds)
label labelType
Equivalent type of labels used for valid component indexing.
dimensionedScalar atan(const dimensionedScalar &ds)
dimensionedScalar pow4(const dimensionedScalar &ds)
string lower(const std::string &s)
Return string copy transformed with std::tolower on each character.
dimensionedScalar pow6(const dimensionedScalar &ds)
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
transFunc(sqrt) transFunc(cbrt) transFunc(exp) transFunc(log) transFunc(log10) transFunc(sin) transFunc(cos) transFunc(tan) transFunc(asin) transFunc(acos) transFunc(atan) transFunc(sinh) transFunc(cosh) transFunc(tanh) transFunc(asinh) transFunc(acosh) transFunc(atanh) transFunc(erf) transFunc(erfc) transFunc(lgamma) transFunc(tgamma) besselFunc(j0) besselFunc(j1) besselFunc(y0) besselFunc(y1) besselFunc2(jn) besselFunc2(yn) inline Scalar &setComponent(Scalar &val
Non-const access to scalar-type (has no components)
dimensionedScalar cosh(const dimensionedScalar &ds)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensionedScalar tan(const dimensionedScalar &ds)
int operator()(const T &a, const T &b) const
dimensionedScalar j0(const dimensionedScalar &ds)
label & setComponent(label &val, const direction) noexcept
Non-const access to integer-type (has no components)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
dimensionedScalar log10(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar negPart(const dimensionedScalar &ds)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
bool operator()(const T &x, const T &y) const