39 bool hasPointData =
false;
46 hasPointData = tvar().isPointData();
48 else if (isGlobalVariable<Type>(
name))
56 const auto& var = tvar.
cref();
59 const label len = (hasPointData ? this->
pointSize() : this->
size());
70 <<
"Variable " <<
name 71 <<
" is nonuniform and does not fit the size" 72 <<
". Using average" <<
endl;
86 return getField<Type>(
name);
94 return getField<Type>(
name);
102 return getField<Type>(
name);
118 const label patchIndex = patch_.index();
127 for (
int checki = 0; !
found && checki < 2; ++checki)
137 if (!ioptr)
continue;
151 pfield.
cref(
dynamic_cast<const PointField<Type>*
>(ioptr));
158 if (!
found && searchFiles())
160 const word fldType = this->getTypeOfField(
name);
164 vfield = this->readAndRegister<VolumeField<Type>>(
name,
mesh());
168 sfield = this->readAndRegister<SurfaceField<Type>>(
name,
mesh());
172 pfield = this->readAndRegister<PointField<Type>>
183 return tmp<Field<Type>>
::New 185 vfield().boundaryField()[patchIndex]
190 return tmp<Field<Type>>
::New 192 sfield().boundaryField()[patchIndex]
197 return pfield().boundaryField()[patchIndex].patchInternalField();
202 <<
"No field '" <<
name <<
"' of type " 203 << pTraits<Type>::typeName <<
nl <<
nl;
239 const label patchIndex = patch_.index();
247 for (
int checki = 0; !
found && checki < 2; ++checki)
257 if (!ioptr)
continue;
273 if (!
found && searchFiles())
275 const word fldType = this->getTypeOfField(
name);
279 vfield = this->readAndRegister<VolumeField<Type>>(
name,
mesh());
283 pfield = this->readAndRegister<PointField<Type>>
294 return vfield().boundaryField()[patchIndex].patchInternalField();
298 return pfield().boundaryField()[patchIndex].patchInternalField();
303 <<
"No field '" <<
name <<
"' of type " 304 << pTraits<Type>::typeName <<
nl <<
nl;
336 const label patchIndex = patch_.index();
343 for (
int checki = 0; !
found && checki < 2; ++checki)
353 if (!ioptr)
continue;
364 if (!
found && searchFiles())
366 const word fldType = this->getTypeOfField(
name);
370 vfield = this->readAndRegister<VolumeField<Type>>(
name,
mesh());
377 return vfield().boundaryField()[patchIndex].patchNeighbourField();
382 <<
"No field '" <<
name <<
"' of type " 383 << pTraits<Type>::typeName <<
nl <<
nl;
411 const label patchIndex = patch_.index();
418 for (
int checki = 0; !
found && checki < 2; ++checki)
428 if (!ioptr)
continue;
439 if (!
found && searchFiles())
441 const word fldType = this->getTypeOfField(
name);
445 vfield = this->readAndRegister<VolumeField<Type>>(
name,
mesh());
452 return vfield().boundaryField()[patchIndex].snGrad();
457 <<
"No field '" <<
name <<
"' of type " 458 << pTraits<Type>::typeName <<
nl <<
nl;
bool valid() const noexcept
Identical to good(), or bool operator.
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
void size(const label n)
Older name for setAddressableSize.
tmp< Field< Type > > getField(const word &fldName)
Return named field.
tmp< Field< Type > > getPointField(const word &fldName)
Retrieve field (point field)
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
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...
tmp< Field< Type > > faceToPoint(const Field< Type > &field) const
Interpolate face to point.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< Field< Type > > getSurfaceField(const word &fldName)
Retrieve field (surface field)
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
constexpr char nl
The newline '\n' character (0x0a)
virtual bool hasVariable(const word &name) const
True if named variable exists.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool valid() const noexcept
Identical to good(), or bool operator.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
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 regIOobject * cfindContextIOobject(const word &name) const
Find named context field, if it exists.
Generic GeometricField class.
static autoPtr< fvExprDriver > New(const dictionary &dict, const fvMesh &mesh)
Return a reference to the selected value driver.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
A class for managing references or pointers (no reference counting)
tmp< Field< Type > > getVariableIfAvailable(const word &fldName) const
Retrieve variable as field if possible.
tmp< Field< Type > > patchNeighbourField(const word &fldName)
Return patchField on the opposite patch of a coupled patch.
tmp< Field< Type > > patchInternalField(const word &fldName)
Return internal field next to patch.
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
tmp< Field< Type > > pointToFace(const Field< Type > &field) const
Interpolate point to face values.
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.
wordList sortedNames() const
The sorted names of all objects.
virtual exprResult & variable(const word &name)
Non-const access to the named variable (sub-classes only)
virtual label size() const
The natural field size for the expression.
tmp< Field< Type > > getVolField(const word &fldName)
Retrieve field (vol field)
const word typeName("volScalarField::Internal")
virtual label pointSize() const
The point field size for the expression.
tmp< Field< Type > > patchNormalField(const word &fldName)
Return surface normal field (snGrad)
#define WarningInFunction
Report a warning using Foam::Warning.
Type gAverage(const FieldField< Field, Type > &f)
tmp< Field< Type > > faceToPointInterpolate(const Field< Type > &ff) const
Interpolate from faces to points.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
const exprResult & lookupGlobal(const word &name) const
Return the global variable if available or a null result.
A class for managing temporary objects.
Registry of regIOobjects.
const regIOobject * cfindIOobject(const word &name, const bool recursive=false) const
Return const pointer to the regIOobject.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.