Go to the documentation of this file.
39 bool hasPointData =
false;
43 if (hasVariable(
name) && variable(
name).isType<Type>())
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);
133 if (searchFiles() && !vfield && !sfield && !pfield)
135 const word fldType = this->getTypeOfField(
name);
137 if (fldType == vfieldType::typeName)
139 t_vfield = this->readAndRegister<vfieldType>(
name,
mesh());
140 vfield = t_vfield.get();
142 else if (fldType == sfieldType::typeName)
144 t_sfield = this->readAndRegister<sfieldType>(
name,
mesh());
145 sfield = t_sfield.
get();
147 else if (fldType == pfieldType::typeName)
149 t_pfield = this->readAndRegister<pfieldType>
154 pfield = t_pfield.
get();
158 const label patchIndex = patch_.index();
164 vfield->boundaryField()[patchIndex]
172 sfield->boundaryField()[patchIndex]
178 return pfield->boundaryField()[patchIndex].patchInternalField();
183 <<
"No field '" <<
name <<
"' of type "
185 << vfieldType::typeName <<
" Fields: "
187 << sfieldType::typeName <<
" Fields: "
189 << pfieldType::typeName <<
" Fields: "
wordList sortedNames() const
The sorted names of all objects.
A class for handling words, derived from Foam::string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A class for managing temporary objects.
Type gAverage(const FieldField< Field, Type > &f)
tmp< Field< Type > > getVariableIfAvailable(const word &fldName) const
Retrieve variable as field if possible.
tmp< Field< Type > > pointToFaceInterpolate(const Field< Type > &pf) const
Interpolate from points to faces.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
tmp< Field< Type > > getField(const word &fldName)
Return named field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T * get() noexcept
Return pointer without nullptr checking.
Registry of regIOobjects.
bool valid() const noexcept
True for non-null pointer/reference.
tmp< Field< Type > > getSurfaceField(const word &fldName)
Retrieve field (surface field)
Generic templated field type.
word name(const complex &c)
Return string representation of complex.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
tmp< Field< Type > > faceToPointInterpolate(const Field< Type > &ff) const
Interpolate from faces to points.
tmp< Field< Type > > pointToFace(const Field< Type > &field) const
Interpolate point to face values.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const Type * findObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Traits class for primitives.
tmp< Field< Type > > getVolField(const word &fldName)
Retrieve field (vol field)
tmp< Field< Type > > faceToPoint(const Field< Type > &field) const
Interpolate face to point.
bool valid() const noexcept
True for non-null pointer/reference.
tmp< Field< Type > > getPointField(const word &fldName)
Retrieve field (point field)
#define WarningInFunction
Report a warning using Foam::Warning.
A class for managing references or pointers (no reference counting)