66#ifndef expressions_patchExprDriver_H
67#define expressions_patchExprDriver_H
98 static const fvPatch& getFvPatch
180 return patch_.boundaryMesh().mesh();
184 virtual label
size()
const
186 return patch_.patch().size();
202 using genericRagelLemonDriver::content;
206 virtual unsigned parse
208 const std::string& expr,
210 size_t len = std::string::npos
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
label nPoints() const
Number of points supporting patch faces.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
const exprResult & result() const noexcept
Const access to expression result.
const dictionary & dict() const noexcept
The dictionary with all input data/specification.
void setResult(Field< Type > *, bool wantPointData=false)
Set result field, taking ownership of the pointer.
Base driver for parsing value expressions associated with an fvMesh.
virtual label size() const
The natural field size for the expression.
tmp< Field< Type > > getVariableIfAvailable(const word &fldName) const
Retrieve variable as field if possible.
tmp< boolField > field_faceZone(const word &name) const
Face selection (zone).
tmp< Field< Type > > patchNormalField(const word &fldName)
Return surface normal field (snGrad).
tmp< Field< Type > > faceToPoint(const Field< Type > &field) const
Interpolate face to point.
tmp< Field< Type > > patchNeighbourField(const word &fldName)
Return patchField on the opposite patch of a coupled patch.
ClassName("patchExpr::driver")
virtual label pointSize() const
The point field size for the expression.
tmp< boolField > field_cellZone(const word &name) const
Cell selection (zone).
tmp< vectorField > field_faceCentre() const
The face centres - (swak = pos).
tmp< Field< Type > > getVolField(const word &fldName)
Retrieve field (vol field).
tmp< Field< Type > > getPointField(const word &fldName)
Retrieve field (point field).
virtual unsigned parse(const std::string &expr, size_t pos=0, size_t len=std::string::npos)
Execute the parser.
void setResult(Field< Type > *ptr, bool pointVal=false)
Set result.
void operator=(const parseDriver &)=delete
tmp< boolField > field_cellSelection(const word &name, enum topoSetSource::sourceType setType) const
Cell selections (as logical).
tmp< Field< Type > > pointToFace(const Field< Type > &field) const
Interpolate point to face values.
tmp< vectorField > field_unitNormal() const
The face unit normal direction [nf] - (expression: normal).
parseDriver(const parseDriver &)=delete
tmp< Field< Type > > getSurfaceField(const word &fldName)
Retrieve field (surface field).
tmp< boolField > field_faceSet(const word &name) const
Face selection (set).
tmp< scalarField > field_rand(label seed=0, bool gaussian=false) const
A uniform random field.
tmp< boolField > field_faceSelection(const word &name, enum topoSetSource::sourceType setType) const
Face selections (as logical).
tmp< Field< Type > > patchInternalField(const word &fldName)
Return internal field next to patch.
const fvPatch & patch_
The referenced patch.
tmp< boolField > field_cellSet(const word &name) const
Cell selection (set).
Type areaAverage(const Field< Type > &fld) const
The area-weighted average of a field.
tmp< scalarField > field_faceArea() const
The face area magnitudes [magSf] - (swak = area).
tmp< vectorField > field_areaNormal() const
The face areas with their vector direction [Sf] - (swak = face).
tmp< vectorField > field_pointField() const
The patch point locations - (swak = pts).
virtual const fvMesh & mesh() const
The mesh we are attached to.
tmp< Field< Type > > getField(const word &fldName)
Return named field.
Type areaSum(const Field< Type > &fld) const
The area-weighted sum of a field.
tmp< scalarField > field_randGaussian(label seed=0) const
A Gaussian random field.
virtual ~parseDriver()=default
Destructor.
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const polyPatch & patch() const noexcept
Return the polyPatch.
Generic interface code for Ragel/Lemon combination Subclasses should implement one or more process() ...
A class for managing temporary objects.
sourceType
Enumeration defining the types of sources.
A class for handling words, derived from Foam::string.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Namespace for patch expressions parsing and evaluation.
A namespace for expression-related classes/traits etc.
Namespace of functions to calculate implicit derivatives returning a matrix.
dimensionedScalar pos(const dimensionedScalar &ds)
Type gWeightedAverage(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted average of a field, using the mag() of the weights.
Type gWeightedSum(const UList< scalar > &weights, const UList< Type > &fld, const label comm)
The global weighted sum (integral) of a field, using the mag() of the weights.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.