34 Type Foam::expressions::exprDriver::exprDriver::weightedAverage
37 const Field<Type>&
fld 57 const scalar
s =
gSum(wfield);
60 if (
mag(
s) < ROOTVSMALL)
70 Type Foam::expressions::exprDriver::exprDriver::weightedSum
73 const Field<Type>&
fld 96 <<
"Expected a" << (wantPointData ?
" point" :
"")
97 <<
" field, but found a" << (!wantPointData ?
" point" :
"")
118 const auto iter = tbl.cfind(
name);
122 func = iter.val().get();
125 if (!func && listFailure)
127 *listFailure = tbl.sortedToc();
139 #define doLocalCode(WhichType, MapperMember) \ 140 if (std::is_same<Type, WhichType>::value) \ 144 this->template getFunction1Ptr<WhichType> \ 174 #define doLocalCode(WhichType, MapperMember) \ 175 if (std::is_same<Type, WhichType>::value) \ 177 const Function1<WhichType>* ptr = \ 178 this->template getFunction1Ptr<WhichType> \ 180 name, MapperMember, &failed \ 182 func = reinterpret_cast<const Function1<Type>*>(ptr); \ 232 #define doLocalCode(WhichType, MapperMember) \ 233 if (std::is_same<Type, WhichType>::value) \ 235 const Function1<WhichType>* ptr = \ 236 this->template getFunction1Ptr<WhichType> \ 238 name, MapperMember, &failed \ 240 func = reinterpret_cast<const Function1<Type>*>(ptr); \ 265 for (label i = 0; i < len; ++i)
271 for (label i = len; i < result.
size(); ++i)
292 <<
"Looking for local" << (wantPointData ?
" point" :
"")
293 <<
" field name:" <<
name <<
" type:" 297 bool good = hasVariable(
name);
310 if (good && expectedSize >= 0)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
tmp< Field< Type > > getResult(bool wantPointData=false)
Return the expression result as a tmp field.
tmp< Field< Type > > newPointField(const Type &val=pTraits< Type >::zero) const
Return a new field with the pointSize()
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A polymorphic field/result from evaluating an expression.
tmp< Field< Type > > getResult(bool cacheCopy=false)
Return tmp field of the contents, optionally keeping a copy in cache.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
bool isType() const
True if valueType corresponds to the given Type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A traits class, which is primarily used for primitives and vector-space.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const word & valueType() const noexcept
Basic type for the field or single value.
tmp< Field< Type > > newField(const Type &val=pTraits< Type >::zero) const
Return a new field with the size()
A class for managing references or pointers (no reference counting)
bool isFunction(const word &name) const
Named mapping with given type exists.
virtual Type value(const scalar x) const
Return value as a function of (scalar) independent variable.
void fillFunctionValues(Field< Type > &result, const word &name, const scalarField &input) const
Fill result with values remapped according to the named Function1.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
Type getFunctionValue(const word &name, const scalar x) const
Evaluate named mapping for the given time/value. Zero for undefined/unknown.
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Generic templated field type.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static Istream & input(Istream &is, IntRange< T > &range)
A HashTable similar to std::unordered_map.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define DebugInfo
Report an information message using Foam::Info.
bool isNull(const T *ptr) noexcept
True if ptr is a pointer (of type T) to the nullObject.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
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;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label size() const
The field or object size.
#define doLocalCode(WhichType, MapperMember)
return returnReduce(nRefine-oldNRefine, sumOp< label >())
bool isLocalVariable(const word &name, bool wantPointData=false, label expectedSize=-1) const
Test existence of a local variable.
messageStream Info
Information stream (stdout output on master, null elsewhere)
exprResult result_
The result.
bool isPointData(const bool wantPointData=true) const
True if representing point data, or test for same value as wantPointData argument.
A class for managing temporary objects.
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))
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static constexpr const zero Zero
Global zero (0)