74#ifndef Foam_sampledSurface_H
75#define Foam_sampledSurface_H
106 const polyMesh& mesh_;
118 mutable scalar area_;
134 const Type& defaultValue = Type(
Zero)
242 const bool interpolateToPoints =
false
320 virtual bool expire() = 0;
324 virtual bool update() = 0;
384 template<
class Type,
class GeoMeshType>
388 const word& fieldName,
395 template<
class Type,
class GeoMeshType>
399 const word& fieldName,
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
T & emplace_back(Args &&... args)
Construct an element at the end of the list, return reference to the new list element.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Abstract base class for volume field interpolation.
Abstract definition of a meshed surface defined by faces and points.
constexpr meshedSurf() noexcept=default
Default construct.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
A surface mesh consisting of general polygon faces and capable of holding fields.
PtrList read-construction helper that captures dictionaries used during creation.
autoPtr< sampledSurface > operator()(Istream &is) const
iNewCapture(const polyMesh &mesh, DynamicList< dictionary > &capture)
PtrList read-construction helper.
iNew(const polyMesh &mesh)
autoPtr< sampledSurface > operator()(Istream &is) const
An abstract class for surfaces with sampling.
virtual const scalarField & magSf() const =0
Face area magnitudes.
declareRunTimeSelectionTable(autoPtr, sampledSurface, word,(const word &name, const polyMesh &mesh, const dictionary &dict),(name, mesh, dict))
Declare run-time constructor selection table.
virtual bool needsUpdate() const =0
Does the surface need an update?
bool enabled() const noexcept
Surface is enabled.
static tmp< Field< Type > > sampleOnPoints(const interpolation< Type > &interpolator, const labelUList &elements, const faceList &fcs, const pointField &pts)
Loop for interpolating volume elements to face points.
virtual tmp< symmTensorField > sample(const surfaceSymmTensorField &sField) const
Sample surface field onto surface.
polySurface * getRegistrySurface(const objectRegistry &obr, word lookupName="") const
Get surface from registry if available.
virtual const vectorField & Sf() const =0
Face area vectors.
static tmp< Field< Type > > sampleOnFaces(const interpolation< Type > &sampler, const labelUList &elements, const faceList &fcs, const pointField &pts, const Type &defaultValue=Type(Zero))
Loop for sampling volume elements to faces.
virtual const vectorField & Cf() const =0
Face centres.
virtual tmp< symmTensorField > interpolate(const interpolation< symmTensor > &interpolator) const =0
Interpolate volume field onto surface points.
bool isPointData() const noexcept
Using interpolation to surface points.
virtual const faceList & faces() const =0
Faces of surface.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const =0
Sample volume field onto surface faces.
virtual tmp< tensorField > sample(const interpolation< tensor > &sampler) const =0
Sample volume field onto surface faces.
virtual tmp< scalarField > interpolate(const interpolation< scalar > &interpolator) const =0
Interpolate volume field onto surface points.
virtual tmp< sphericalTensorField > interpolate(const interpolation< sphericalTensor > &interpolator) const =0
Interpolate volume field onto surface points.
virtual void print(Ostream &os, int level=0) const
Print information.
static tmp< VolumeField< Type > > pointAverage(const PointField< Type > &pfld)
Create cell values by averaging the point values.
bool storeRegistryField(const objectRegistry &obr, const word &fieldName, const dimensionSet &dims, const Field< Type > &values, word lookupName="") const
Copy/store sampled field onto registered surface (if it exists).
virtual tmp< symmTensorField > sample(const interpolation< symmTensor > &sampler) const =0
Sample volume field onto surface faces.
sampledSurface(const word &name, std::nullptr_t)
Construct null.
virtual bool update()=0
Update the surface as required.
polySurface * storeRegistrySurface(objectRegistry &obr, word lookupName="") const
Copy surface into registry.
virtual bool hasFaceIds() const
If element ids/order of the original surface are available.
const word & name() const noexcept
Name of surface.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
virtual tmp< tensorField > interpolate(const interpolation< tensor > &interpolator) const =0
Interpolate volume field onto surface points.
static autoPtr< sampledSurface > New(const word &name, const polyMesh &mesh, const dictionary &dict)
Return a reference to the selected surface.
bool removeRegistrySurface(objectRegistry &obr, word lookupName="") const
Remove surface from registry.
autoPtr< sampledSurface > clone() const
Clone.
virtual ~sampledSurface()
Destructor - calls clearGeom().
virtual bool withSurfaceFields() const
Can it sample surface-fields?
virtual void rename(const word &newName)
Rename.
const polyMesh & mesh() const noexcept
Access to the underlying mesh.
virtual tmp< vectorField > interpolate(const interpolation< vector > &interpolator) const =0
Interpolate volume field onto surface points.
virtual tmp< sphericalTensorField > sample(const interpolation< sphericalTensor > &sampler) const =0
Sample volume field onto surface faces.
scalar area() const
The total surface area.
virtual tmp< tensorField > sample(const surfaceTensorField &sField) const
Sample surface field onto surface.
bool invariant() const noexcept
Surface is invariant with geometry change (caution).
virtual bool expire()=0
Mark the surface as needing an update.
TypeName("sampledSurface")
Runtime type information.
virtual const pointField & points() const =0
Points of surface.
virtual tmp< vectorField > sample(const interpolation< vector > &sampler) const =0
Sample volume field onto surface faces.
bool interpolate() const noexcept
Same as isPointData().
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
OBJstream os(runTime.globalPath()/outputName)
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;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
List< face > faceList
List of faces.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
GeometricField< sphericalTensor, fvsPatchField, surfaceMesh > surfaceSphericalTensorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
GeometricField< Type, pointPatchField, pointMesh > PointField
A point field for a given type.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
GeometricField< symmTensor, fvsPatchField, surfaceMesh > surfaceSymmTensorField
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
Basic run-time type information using word as the type's name. Used to enhance the standard RTTI to c...
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Forwards and collection of common volume field types.