Go to the documentation of this file.
30 #include "surfaceInterpolate.H"
45 resultType_.replace(
"Scalar",
"Logical");
50 this->result().setResult(std::move(
bools), this->isPointData());
55 this->result().setResult(
fld, this->isPointData());
79 if (!resultDimension_.dimensionless())
81 ptr->dimensions().reset(resultDimension_);
87 resultField_.reset(ptr);
100 resultField_.clear();
104 isLogical_ = logical;
108 if (!resultDimension_.dimensionless())
110 ptr->dimensions().reset(resultDimension_);
116 resultField_.reset(ptr);
129 resultField_.clear();
133 isLogical_ = logical;
137 if (!resultDimension_.dimensionless())
139 ptr->dimensions().reset(resultDimension_);
145 resultField_.reset(ptr);
149 template<
class GeomField>
153 return dynamic_cast<const GeomField*
>(
resultField_.get());
157 template<
class GeomField>
167 if (dieOnNull && ptr !=
nullptr)
170 <<
"No result available. Requested "
175 if (isLogical_ == logical)
177 return dynamic_cast<const GeomField*
>(ptr);
194 return this->getOrReadField<fieldType>
213 return this->getOrReadField<fieldType>
232 return this->getOrReadPointField<fieldType>
319 auto tresult = newVolField<Type>();
320 auto& result = tresult.ref();
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
A class for handling words, derived from Foam::string.
List< bool > bools(const labelHashSet &locations)
tmp< GeometricField< Type, pointPatchField, pointMesh > > cellToPoint(const GeometricField< Type, fvPatchField, volMesh > &field) const
Interpolate cell to point values.
const GeoField * isResultType() const
Test if stored result pointer is the specified type.
A class for managing temporary objects.
Type interpolatePointToCell(const GeometricField< Type, pointPatchField, pointMesh > &ptf, const label celli)
Interpolates (averages) the vertex values to the cell center.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
#define forAll(list, i)
Loop across all elements in list.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &ds, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field from name, mesh, dimensions and patch type.
Generic templated field type.
tmp< GeometricField< Type, pointPatchField, pointMesh > > getPointField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
autoPtr< regIOobject > resultField_
The results (volume, surface, point)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > getSurfaceField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
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))
Convert [0-1] values (usually scalars) as false/true.
Generic dimensioned Type class.
void setInternalFieldResult(const Field< Type > &fld)
Deep-copy the internalField as a result.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Traits class for primitives.
tmp< GeometricField< Type, fvPatchField, volMesh > > getVolField(const word &fldName, bool getOldTime=false)
Retrieve field (vol field)
tmp< GeometricField< Type, fvPatchField, volMesh > > pointToCell(const GeometricField< Type, pointPatchField, pointMesh > &field) const
Interpolate point to cell values.
tmp< GeometricField< Type, fvPatchField, volMesh > > newVolField(const Type &val=pTraits< Type >::zero) const
Return a new volume field with the mesh size.
void setResult(GeometricField< Type, fvPatchField, volMesh > *ptr, bool logical=false)
Set result (vol field)
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.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > newSurfaceField(const Type &val=pTraits< Type >::zero) const
Return a new surface field with the mesh nInternalFaces size.
Interpolate from cell centres to points (vertices) using inverse distance weighting.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > cellToFace(const GeometricField< Type, fvPatchField, volMesh > &field) const
Interpolate cell to face values.
tmp< GeometricField< Type, pointPatchField, pointMesh > > newPointField(const Type &val=pTraits< Type >::zero) const
Return a new point field with the mesh nPoints size.
Operations involving expressions.