46#ifndef Foam_PatchFunction1_H
47#define Foam_PatchFunction1_H
170 template<class Derived>
172 Clone(const Derived& fun)
178 template<
class Derived>
193 const bool mandatory =
true
201 std::initializer_list<std::pair<const char*,int>> compat,
204 const bool mandatory =
true
229 const bool mandatory =
true
240 virtual bool constant()
const {
return false; }
243 virtual bool good()
const {
return true; }
246 virtual bool uniform()
const = 0;
252 virtual tmp<Field<Type>>
value(
const scalar
x)
const;
293 friend Ostream& operator<< <Type>
311#define makePatchFunction1(Type) \
313 defineNamedTemplateTypeNameAndDebug(PatchFunction1<Type>, 0); \
315 defineTemplateRunTimeSelectionTable \
317 PatchFunction1<Type>, \
323#define makePatchFunction1Type(SS, Type) \
325 defineNamedTemplateTypeNameAndDebug(PatchFunction1Types::SS<Type>, 0); \
327 PatchFunction1<Type>::adddictionaryConstructorToTable \
328 <PatchFunction1Types::SS<Type>> \
329 add##SS##Type##ConstructorToTable_;
333#define makeConcretePatchFunction1Type(SS, Type) \
335 defineTypeNameAndDebug(SS, 0); \
337 PatchFunction1<Type>::adddictionaryConstructorToTable \
338 <PatchFunction1Types::SS> \
339 add##SS##Type##ConstructorToTable_;
343#define makeScalarPatchFunction1(SS) \
345 makeConcretePatchFunction1Type(SS, scalar);
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))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Abstract base class to hold the Field mapping addressing and weights.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
virtual tmp< Field< Type > > integrate(const scalar x1, const scalar x2) const
Integrate between two (scalar) values.
const polyPatch const word const word & entryName
virtual bool uniform() const =0
Is value uniform (i.e. independent of coordinate).
virtual void rmap(const PatchFunction1< Type > &rhs, const labelList &addr)
Reverse map the given PatchFunction1 onto this PatchFunction1.
virtual ~PatchFunction1()=default
Destructor.
const polyPatch const word & type
virtual void autoMap(const FieldMapper &mapper)
Map (and resize as needed) from self given a mapping object.
Field< Type > returnType
The return type is a field of values.
virtual void writeData(Ostream &os) const
Write in dictionary format.
coordinateScaling< Type > coordSys_
Optional local coordinate system and scaling.
virtual bool constant() const
Is value constant (i.e. independent of x).
virtual tmp< Field< Type > > value(const scalar x) const
Return value as a function of (scalar) independent variable.
const polyPatch const word const word const dictionary & dict
virtual tmp< pointField > localPosition(const pointField &globalPos) const
Helper: optionally convert coordinates to local coordinates.
static tmp< PatchFunction1< Type > > Clone(const Derived &fun)
Clone a PatchFunction1.
void operator=(const PatchFunction1< Type > &)=delete
No copy assignment.
virtual bool good() const
Can function be evaluated?
virtual tmp< Field< Type > > transform(const Field< Type > &fld) const
Apply optional transformation.
static tmp< PatchFunction1< Type > > Clone(const Derived &fun, const polyPatch &pp)
Clone a PatchFunction1 with a patch.
TypeName("PatchFunction1") declareRunTimeSelectionTable(autoPtr
Runtime type information.
static autoPtr< PatchFunction1< Type > > NewCompat(const polyPatch &pp, const word &entryName, std::initializer_list< std::pair< const char *, int > > compat, const dictionary &dict, const bool faceValues=true, const bool mandatory=true)
Compatibility selector.
virtual tmp< PatchFunction1< Type > > clone() const =0
Return a clone.
static autoPtr< PatchFunction1< Type > > NewIfPresent(const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
An optional selector.
const polyPatch const word const word const dictionary const bool faceValues
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Helper class to wrap coordinate system and component-wise scaling.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A keyword and a list of tokens is an 'entry'.
option
Enumeration for the data type and search/match modes (bitmask).
patchFunction1Base(const polyPatch &pp, const word &entryName, const bool faceValues=true)
Construct from polyPatch and entry name.
A patch is a list of labels that address the faces in the global face list.
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
List< label > labelList
A List of labels.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
vectorField pointField
pointField is a vectorField.
#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.