40 <<
"Expected a" << (wantPointData ?
" point" :
"")
41 <<
" field, but found a" << (!wantPointData ?
" point" :
"")
62 const auto iter = tbl.cfind(
name);
66 func = iter.val().get();
69 if (!func && listFailure)
71 *listFailure = tbl.sortedToc();
83 #define doLocalCode(WhichType, MapperMember) \ 84 if constexpr (std::is_same_v<Type, WhichType>) \ 88 this->template getFunction1Ptr<WhichType> \ 118 #define doLocalCode(WhichType, MapperMember) \ 119 if constexpr (std::is_same_v<Type, WhichType>) \ 121 const Function1<WhichType>* ptr = \ 122 this->template getFunction1Ptr<WhichType> \ 124 name, MapperMember, &failed \ 126 func = reinterpret_cast<const Function1<Type>*>(ptr); \ 176 #define doLocalCode(WhichType, MapperMember) \ 177 if constexpr (std::is_same_v<Type, WhichType>) \ 179 const Function1<WhichType>* ptr = \ 180 this->template getFunction1Ptr<WhichType> \ 182 name, MapperMember, &failed \ 184 func = reinterpret_cast<const Function1<Type>*>(ptr); \ 209 for (label i = 0; i < len; ++i)
215 for (label i = len; i < result.
size(); ++i)
236 <<
"Looking for local" << (wantPointData ?
" point" :
"")
237 <<
" field name:" <<
name <<
" type:" 241 bool good = hasVariable(
name);
254 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)
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.
Type getFunctionValue(const word &name, const scalar x) const
Evaluate named mapping for the given time/value. Zero for undefined/unknown.
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.
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
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.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
label size() const
The field or object size.
#define doLocalCode(WhichType, MapperMember)
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.
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)