30 #include "surfaceInterpolate.H" 69 resultField_.reset(
nullptr);
77 if (hasDimensions_ && !logical)
85 resultField_.reset(ptr);
96 resultField_.reset(
nullptr);
100 isLogical_ = logical;
104 if (hasDimensions_ && !logical)
112 resultField_.reset(ptr);
123 resultField_.reset(
nullptr);
127 isLogical_ = logical;
131 if (hasDimensions_ && !logical)
139 resultField_.reset(ptr);
143 template<
class GeomField>
147 return dynamic_cast<const GeomField*
>(resultField_.get());
151 template<
class GeomField>
161 if (dieOnNull && !ptr)
164 <<
"No result available. Requested " 169 if (isLogical_ == logical)
171 return dynamic_cast<const GeomField*
>(ptr);
186 return this->getOrReadField<VolumeField<Type>>
203 return this->getOrReadField<SurfaceField<Type>>
220 return this->getOrReadPointField<PointField<Type>>
307 auto tresult = newVolField<Type>();
308 auto& result = tresult.ref();
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
Replace first occurrence of sub-string s1 with s2, beginning at pos.
tmp< PointField< Type > > newPointField(const Type &val=pTraits< Type >::zero) const
Return a new point field with the mesh nPoints size.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
void setInternalFieldResult(const Field< Type > &fld)
Deep-copy the internalField as a result.
tmp< PointField< Type > > getPointField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
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.
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)
A traits class, which is primarily used for primitives and vector-space.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type get(const label i) const
Return bool value at specified position, always false for out-of-range access.
void setResult(VolumeField< Type > *ptr, bool logical=false)
Set result (vol field)
tmp< VolumeField< Type > > getVolField(const word &fldName, bool getOldTime=false)
Retrieve field (vol field)
Generic GeometricField class.
Generic dimensioned Type class.
const dimensionSet dimless
Dimensionless.
Convert [0-1] values (usually scalars) as false/true.
tmp< SurfaceField< Type > > getSurfaceField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
#define forAll(list, i)
Loop across all elements in list.
tmp< SurfaceField< Type > > cellToFace(const VolumeField< Type > &field) const
Interpolate cell to face values.
bool isPointData() const noexcept
A point field.
Generic templated field type.
Operations involving expressions.
A class for handling words, derived from Foam::string.
tmp< VolumeField< Type > > newVolField(const Type &val=pTraits< Type >::zero) const
Return a new volume field with the mesh size.
const exprResult & result() const noexcept
Const access to expression result.
const GeoField * isResultType() const
Test if stored result pointer is the specified type.
Interpolate from cell centres to points (vertices) using inverse distance weighting.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
void reset(const dimensionSet &ds)
Copy assign the exponents from the dimensionSet.
void assign(Field< Tout > &result, const Field< T1 > &a, const UnaryOp &op)
Populate a field as the result of a unary operation on an input.
List< bool > bools(const labelHashSet &locations)
Transform the on locations to a boolList, with true for each non-negative location and false for all ...
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
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))
Type interpolatePointToCell(const GeometricField< Type, pointPatchField, pointMesh > &ptf, const label celli)
tmp< PointField< Type > > cellToPoint(const VolumeField< Type > &field) const
Interpolate cell to point values.
tmp< VolumeField< Type > > pointToCell(const PointField< Type > &field) const
Interpolate point to cell values.
void setResult(Field< Type > *, bool wantPointData=false)
Set result field, taking ownership of the pointer.
tmp< SurfaceField< Type > > newSurfaceField(const Type &val=pTraits< Type >::zero) const
Return a new surface field with the mesh nInternalFaces size.
word resultType_
The result type-name.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
A class for managing temporary objects.
Interpolates (averages) the vertex values to the cell center.
bool isLogical_
A logical (bool-like) field (but actually a scalar)
const dimensionSet & dimensions() const noexcept
Return dimensions.