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.
void append(const T &val)
Copy append an element to the end of this list.
Minimal example by using system/controlDict.functions:
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,...
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
T & last()
Return the last element of the list.
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.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
A surface mesh consisting of general polygon faces and capable of holding fields.
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.
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.
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.
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))
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
static constexpr const zero Zero
Global zero (0)
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)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.