38#ifndef Foam_dimensionedType_H
39#define Foam_dimensionedType_H
65template<
class T>
class UniformListWrap;
66template<
class GeoField,
class Type>
class UniformGeometricFieldWrap;
229 const word& entryName
256 const Type& deflt = Type(
Zero)
265 const Type& deflt = Type(
Zero)
276 const Type& deflt = Type(
Zero)
286 const Type& deflt = Type(
Zero)
373 friend Istream&
operator>> <Type>
428 const Type& deflt = Type(
Zero)
441 const Type& deflt = Type(
Zero)
453 const Type& deflt = Type(
Zero)
463 auto expr(
const label size)
const
471 template<
class GeoField>
472 auto expr(
const GeoField&
fld)
const
487Ostream&
operator<<(Ostream&
os,
const dimensioned<Type>& dt);
489template<
class Type, direction r>
568#define PRODUCT_OPERATOR(product, op, opFunc) \
570template<class Type1, class Type2> \
571dimensioned<typename product<Type1, Type2>::type> \
572operator op(const dimensioned<Type1>&, const dimensioned<Type2>&); \
574template<class Type, class Form, class Cmpt, direction nCmpt> \
575dimensioned<typename product<Type, Form>::type> \
578 const dimensioned<Type>&, \
579 const VectorSpace<Form,Cmpt,nCmpt>& \
582template<class Type, class Form, class Cmpt, direction nCmpt> \
583dimensioned<typename product<Form, Type>::type> \
586 const VectorSpace<Form,Cmpt,nCmpt>&, \
587 const dimensioned<Type>& \
595#undef PRODUCT_OPERATOR
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A HashTable similar to std::unordered_map.
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Generic dimensioned Type class.
bool read(const word &entryName, const dictionary &dict)
Update the value of dimensioned<Type>, using an alternative entry name.
dimensioned< cmptType > component(const direction d) const
Return a component as a dimensioned<cmptType>.
dimensionSet & dimensions() noexcept
Return non-const reference to dimensions.
word & name() noexcept
Return non-const reference to name.
void replace(const direction d, const dimensioned< cmptType > &dc)
Return a component with a dimensioned<cmptType>.
void operator*=(const scalar s)
dimensioned(const word &name, const dimensionSet &dims, const Type &val, const dictionary &dict)
Construct from components (name, dimensions, value) with optional dictionary override.
void operator-=(const dimensioned< Type > &dt)
static dimensioned< Type > getOrDefault(const word &name, const dictionary &dict, const Type &deflt=Type(Zero))
Construct dimensionless from dictionary, with default value.
dimensioned()
A dimensionless Zero, named "0".
dimensioned(const primitiveEntry &e, const dimensionSet &dims)
Construct from primitive entry with given name and dimensions.
dimensioned(const Type &val)
Implicit construct dimensionless from given value.
dimensioned(const dimensionSet &dims)
A dimensioned Zero, named "0".
dimensioned(const word &name, const dimensionSet &dims, const dictionary &dict, const word &entryName)
Construct from dictionary lookup with a given name and dimensions.
static dimensioned< label > lookupOrAddToDict(const word &name, dictionary &dict, const dimensionSet &dims=dimless, const label &deflt=label(Zero))
dimensioned(const dimensionSet &dims, const Type &val)
Construct dimensioned from given value.
Istream & read(Istream &is, const bool readName=true)
Read (name, dimensions, value) from stream, using units from system table.
dimensioned< cmptType > operator[](const direction d) const
Return a component as a dimensioned<cmptType>.
dimensioned(const word &name, const dimensioned< Type > &dt)
Copy construct dimensioned Type with a new name.
bool readIfPresent(const word &entryName, const dictionary &dict)
Update the value of dimensioned<Type> if found in the dictionary, using an alternative entry name.
bool read(const dictionary &dict)
Update the value of dimensioned<Type>, lookup in dictionary with the name().
auto expr(const label size) const
Wrap value as constant-value List expression.
const dimensionSet & dimensions() const noexcept
Return const reference to dimensions.
pTraits< label >::cmptType cmptType
dimensioned(const word &name, const dimensionSet &dims, const dictionary &dict)
Construct from dictionary lookup with a given name and dimensions.
void writeEntry(const word &keyword, Ostream &os) const
Write as a dictionary entry with keyword.
static dimensioned< Type > getOrAddToDict(const word &name, dictionary &dict, const Type &deflt=Type(Zero))
Construct dimensionless from dictionary, with default value.
auto expr(const GeoField &fld) const
Wrap value as constant-value GeometricField expression. Supplied.
dimensioned< Type > T() const
Return transpose.
dimensioned(const dimensionSet &dims, const Foam::one)
A dimensioned pTraits::one, named "1".
const word & name() const noexcept
dimensioned(const word &name, const dictionary &dict)
Construct from dictionary lookup with a given name.
Istream & read(Istream &is, const HashTable< dimensionedScalar > &readSet)
Read (name, dimensions, value) from stream, using units from table.
dimensioned(const dimensionSet &dims, const Foam::zero)
A dimensioned Zero, named "0".
Type & value() noexcept
Return non-const reference to value.
dimensioned(const primitiveEntry &e)
Construct from primitive entry with given name.
bool readIfPresent(const dictionary &dict)
Update the value of dimensioned<Type> if found in the dictionary, lookup in dictionary with the name(...
static dimensioned< label > lookupOrDefault(const word &name, const dictionary &dict, const dimensionSet &dims=dimless, const label &deflt=label(Zero))
static dimensioned< Type > getOrDefault(const word &name, const dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
Construct dimensioned from dictionary, with default value.
dimensioned(const word &name, const dimensionSet &dims, const Type &val)
Construct from components (name, dimensions, value).
void operator+=(const dimensioned< Type > &dt)
Istream & read(Istream &is, const dictionary &readSet)
Read (name, dimensions, value) from stream, using units from dictionary.
void operator/=(const scalar s)
const Type & value() const noexcept
Return const reference to value.
static dimensioned< Type > getOrAddToDict(const word &name, dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
Construct dimensioned from dictionary, with default value.
option
Enumeration for the data type and search/match modes (bitmask).
@ REGEX
Regular expression.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A traits class, which is primarily used for primitives and vector-space.
symmTypeOfRank< typenamepTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank)>::type type
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read,...
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define PRODUCT_OPERATOR(product, op, opFunc)
Direction is an 8-bit unsigned integer type used to represent Cartesian directions,...
OBJstream os(runTime.globalPath()/outputName)
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))
A namespace for expression templates.
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static bool checkDims(const char *what, const dimensionSet &a, const dimensionSet &b)
Istream & operator>>(Istream &, directionInfo &)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0).
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
void dotdot(FieldField< Field1, typename scalarProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
void outer(FieldField< Field1, typename outerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
bool operator>(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A newer than B.
dimensioned< Type > lerp(const dimensioned< Type > &a, const dimensioned< Type > &b, const scalar t)
#define FOAM_DEPRECATED_FOR(since, replacement)
#define FOAM_DEPRECATED_STRICT(since, replacement)