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);
143template<
class GeomField>
147 return dynamic_cast<const GeomField*
>(resultField_.get());
151template<
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();
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
const dimensionSet & dimensions() const
Return dimensions.
Generic templated field type.
Generic GeometricField class.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A topoSetFaceSource to select all the faces from given cellSet(s).
A topoSetPointSource to select all the points from given cellSet(s).
void reset(const dimensionSet &ds)
Copy assign the exponents from the dimensionSet.
Generic dimensioned Type class.
const exprResult & result() const noexcept
Const access to expression result.
void setResult(Field< Type > *, bool wantPointData=false)
Set result field, taking ownership of the pointer.
tmp< VolumeField< Type > > newVolField(const Type &val=pTraits< Type >::zero) const
Return a new volume field with the mesh size.
bool isPointData() const noexcept
A point field.
tmp< PointField< Type > > getPointField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
tmp< PointField< Type > > newPointField(const Type &val=pTraits< Type >::zero) const
Return a new point field with the mesh nPoints size.
const GeoField * isResultType() const
Test if stored result pointer is the specified type.
tmp< VolumeField< Type > > getVolField(const word &fldName, bool getOldTime=false)
Retrieve field (vol field)
tmp< SurfaceField< Type > > newSurfaceField(const Type &val=pTraits< Type >::zero) const
Return a new surface field with the mesh nInternalFaces size.
tmp< SurfaceField< Type > > getSurfaceField(const word &fldName, bool getOldTime=false)
Retrieve field (surface field)
void setInternalFieldResult(const Field< Type > &fld)
Deep-copy the internalField as a result.
word resultType_
The result type-name.
bool isLogical_
A logical (bool-like) field (but actually a scalar)
void setResult(VolumeField< Type > *ptr, bool logical=false)
Set result (vol field)
A traits class, which is primarily used for primitives.
A topoSetCellSource to select cells with any point or any edge within a given pointSet(s).
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
A class for managing temporary objects.
Interpolate from cell centres to points (vertices) using inverse distance weighting.
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Operations involving expressions.
Interpolates (averages) the vertex values to the cell center.
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.
@ VOLUME_DATA
Volume data.
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.
const dimensionSet dimless
Dimensionless.
Type interpolatePointToCell(const GeometricField< Type, pointPatchField, pointMesh > &ptf, const label celli)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
Convert [0-1] values (usually scalars) as false/true.