34Type Foam::expressions::exprDriver::exprDriver::weightedAverage
57 const scalar
s =
gSum(wfield);
60 if (
mag(
s) < ROOTVSMALL)
70Type Foam::expressions::exprDriver::exprDriver::weightedSum
93 if (!result_.isPointData(wantPointData))
96 <<
"Expected a" << (wantPointData ?
" point" :
"")
97 <<
" field, but found a" << (!wantPointData ?
" point" :
"")
102 return result_.getResult<Type>();
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); \
205 return func->value(
x);
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)
312 good = (var.
size() == expectedSize);
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
A HashTable similar to std::unordered_map.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
const complexVectorField & newField()
bool isLocalVariable(const word &name, bool wantPointData=false, label expectedSize=-1) const
Test existence of a local variable.
Type getFunctionValue(const word &name, const scalar x) const
bool isFunction(const word &name) const
Named mapping with given type exists.
void fillFunctionValues(Field< Type > &result, const word &name, const scalarField &input) const
Fill result with values remapped according to the named Function1.
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()
A polymorphic field/result from evaluating an expression.
const word & valueType() const noexcept
Basic type for the field or single value.
label size() const
The field or object size.
bool isType() const
True if valueType corresponds to the given Type.
bool isPointData(const bool wantPointData=true) const
A traits class, which is primarily used for primitives.
A class for managing references or pointers (no reference counting)
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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))
#define DebugInfo
Report an information message using Foam::Info.
Type gSum(const FieldField< Field, Type > &f)
static Istream & input(Istream &is, IntRange< T > &range)
void func(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
bool isNull(const T *ptr)
True if ptr is a pointer (of type T) to the nullObject.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
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)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
A non-counting (dummy) refCount.
#define doLocalCode(GeoField)