Loading...
Searching...
No Matches
PatchFunction1< Type > Class Template Referenceabstract

Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a certain type, e.g. constant or time varying, and provide functions to return the (interpolated) value, and integral between limits. More...

#include <PatchFunction1.H>

Inheritance diagram for PatchFunction1< Type >:
Collaboration diagram for PatchFunction1< Type >:

Public Types

typedef Field< Type > returnType
 The return type is a field of values.

Public Member Functions

 TypeName ("PatchFunction1") declareRunTimeSelectionTable(autoPtr
 Runtime type information.
 PatchFunction1 (const polyPatch &pp, const word &entryName, const bool faceValues=true)
 Construct from polyPatch and entry name.
 PatchFunction1 (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from polyPatch, dictionary and entry name.
 PatchFunction1 (const PatchFunction1< Type > &rhs, const polyPatch &pp)
 Copy construct setting patch.
 PatchFunction1 (const PatchFunction1< Type > &rhs)
 Copy construct.
virtual tmp< PatchFunction1< Type > > clone () const =0
 Return a clone.
virtual tmp< PatchFunction1< Type > > clone (const polyPatch &pp) const =0
 Return a clone, setting patch.
virtual ~PatchFunction1 ()=default
 Destructor.
virtual bool constant () const
 Is value constant (i.e. independent of x).
virtual bool good () const
 Can function be evaluated?
virtual bool uniform () const =0
 Is value uniform (i.e. independent of coordinate).
virtual tmp< Field< Type > > value (const scalar x) const
 Return value as a function of (scalar) independent variable.
virtual tmp< Field< Type > > integrate (const scalar x1, const scalar x2) const
 Integrate between two (scalar) values.
virtual tmp< pointFieldlocalPosition (const pointField &globalPos) const
 Helper: optionally convert coordinates to local coordinates.
virtual tmp< Field< Type > > transform (const Field< Type > &fld) const
 Apply optional transformation.
virtual tmp< Field< Type > > transform (const tmp< Field< Type > > &tfld) const
 Apply optional transformation.
virtual void autoMap (const FieldMapper &mapper)
 Map (and resize as needed) from self given a mapping object.
virtual void rmap (const PatchFunction1< Type > &rhs, const labelList &addr)
 Reverse map the given PatchFunction1 onto this PatchFunction1.
virtual void writeData (Ostream &os) const
 Write in dictionary format.
Public Member Functions inherited from patchFunction1Base
 patchFunction1Base (const polyPatch &pp, const word &entryName, const bool faceValues=true)
 Construct from polyPatch and entry name.
 patchFunction1Base (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from polyPatch, dictionary and entry name.
 patchFunction1Base (const patchFunction1Base &rhs)
 Copy construct.
 patchFunction1Base (const patchFunction1Base &rhs, const polyPatch &pp)
 Copy construct setting patch.
virtual ~patchFunction1Base ()=default
 Destructor.
const wordname () const noexcept
 The name of the entry.
const polyPatchpatch () const noexcept
 Reference to the patch.
bool faceValues () const noexcept
 Generate face or point values on patch?
label size () const
 Number of faces or points on the patch.
const objectRegistrywhichDb () const
 Return the associated registry (ie, the mesh).
const objectRegistryobr () const
 Return the object registry (ie, the mesh).
const Timetime () const
 Return false: function not created with time database.
virtual void userTimeToTime (const Time &t)
 Convert time.
Public Member Functions inherited from refCount
constexpr refCount () noexcept
 Default construct, initializing count to 0.
int use_count () const noexcept
 Return the current reference count.
bool unique () const noexcept
 Return true if the reference count is zero.
void operator++ () noexcept
 Increment the reference count.
void operator++ (int) noexcept
 Increment the reference count.
void operator-- () noexcept
 Decrement the reference count.
void operator-- (int) noexcept
 Decrement the reference count.

Static Public Member Functions

template<class Derived>
static tmp< PatchFunction1< Type > > Clone (const Derived &fun)
 Clone a PatchFunction1.
template<class Derived>
static tmp< PatchFunction1< Type > > Clone (const Derived &fun, const polyPatch &pp)
 Clone a PatchFunction1 with a patch.
static autoPtr< PatchFunction1< Type > > New (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true, const bool mandatory=true)
 Selector.
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.
static autoPtr< PatchFunction1< Type > > NewIfPresent (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 An optional selector.
static refPtr< PatchFunction1< Type > > New (HashPtrTable< PatchFunction1< Type > > &cache, const polyPatch &pp, const word &entryName, const dictionary &dict, enum keyType::option matchOpt=keyType::LITERAL, const bool faceValues=true, const bool mandatory=true)
 Selector with external storage. This also allows wildcard matches in a dictionary.

Public Attributes

 PatchFunction1
 dictionary
const polyPatchpp
const polyPatch const wordtype
const polyPatch const word const wordentryName
const polyPatch const word const word const dictionarydict
const polyPatch const word const word const dictionary const bool faceValues
const polyPatch const word const word const dictionary const bool pp
const polyPatch const word const word const dictionary const bool type
const polyPatch const word const word const dictionary const bool entryName
const polyPatch const word const word const dictionary const bool dict

Protected Member Functions

void operator= (const PatchFunction1< Type > &)=delete
 No copy assignment.
Protected Member Functions inherited from patchFunction1Base
void operator= (const patchFunction1Base &)=delete
 No copy assignment.

Protected Attributes

coordinateScaling< Type > coordSys_
 Optional local coordinate system and scaling.
Protected Attributes inherited from patchFunction1Base
const word name_
 Name of entry.
const polyPatchpatch_
 Reference to the patch.
const bool faceValues_
 Generate face or point values on patch.

Friends

Ostreamoperator<< (Ostream &os, const PatchFunction1< Type > &rhs)
 Ostream Operator.

Detailed Description

template<class Type>
class Foam::PatchFunction1< Type >

Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a certain type, e.g. constant or time varying, and provide functions to return the (interpolated) value, and integral between limits.

Extends the Function1 class by adding autoMap and rMap functions

Source files
See also
Foam::Function1

Definition at line 66 of file PatchFunction1.H.

Member Typedef Documentation

◆ returnType

template<class Type>
typedef Field<Type> returnType

The return type is a field of values.

Definition at line 111 of file PatchFunction1.H.

Constructor & Destructor Documentation

◆ PatchFunction1() [1/4]

template<class Type>
PatchFunction1 ( const polyPatch & pp,
const word & entryName,
const bool faceValues = true )

Construct from polyPatch and entry name.

References entryName, faceValues, PatchFunction1, and pp.

Here is the call graph for this function:

◆ PatchFunction1() [2/4]

template<class Type>
PatchFunction1 ( const polyPatch & pp,
const word & entryName,
const dictionary & dict,
const bool faceValues = true )

Construct from polyPatch, dictionary and entry name.

References dict, dictionary, entryName, faceValues, PatchFunction1, and pp.

Here is the call graph for this function:

◆ PatchFunction1() [3/4]

template<class Type>
PatchFunction1 ( const PatchFunction1< Type > & rhs,
const polyPatch & pp )
explicit

Copy construct setting patch.

References PatchFunction1, pp, and Foam::rhs().

Here is the call graph for this function:

◆ PatchFunction1() [4/4]

template<class Type>
PatchFunction1 ( const PatchFunction1< Type > & rhs)
explicit

Copy construct.

References PatchFunction1, and Foam::rhs().

Here is the call graph for this function:

◆ ~PatchFunction1()

template<class Type>
virtual ~PatchFunction1 ( )
virtualdefault

Destructor.

Member Function Documentation

◆ operator=()

template<class Type>
void operator= ( const PatchFunction1< Type > & )
protecteddelete

No copy assignment.

References PatchFunction1.

Here is the call graph for this function:

◆ TypeName()

template<class Type>
TypeName ( "PatchFunction1< Type >" )

Runtime type information.

Declare runtime constructor selection table

References declareRunTimeSelectionTable.

◆ clone() [1/2]

template<class Type>
virtual tmp< PatchFunction1< Type > > clone ( ) const
pure virtual

Return a clone.

Implemented in CodedField< Type >, ConstantField< Type >, LookupField< Type >, MappedFile< Type >, MappedFile< scalar >, PatchExprField< Type >, Sampled< Type >, and UniformValueField< Type >.

References clone(), and PatchFunction1.

Referenced by clone(), and clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone() [2/2]

template<class Type>
virtual tmp< PatchFunction1< Type > > clone ( const polyPatch & pp) const
pure virtual

Return a clone, setting patch.

Implemented in CodedField< Type >, ConstantField< Type >, LookupField< Type >, MappedFile< Type >, PatchExprField< Type >, Sampled< Type >, and UniformValueField< Type >.

References clone(), PatchFunction1, and pp.

Here is the call graph for this function:

◆ Clone() [1/2]

◆ Clone() [2/2]

template<class Type>
template<class Derived>
tmp< PatchFunction1< Type > > Clone ( const Derived & fun,
const polyPatch & pp )
inlinestatic

Clone a PatchFunction1 with a patch.

Definition at line 203 of file PatchFunction1.H.

References pp.

◆ New() [1/2]

template<class Type>
Foam::autoPtr< Foam::PatchFunction1< Type > > New ( const polyPatch & pp,
const word & entryName,
const dictionary & dict,
const bool faceValues = true,
const bool mandatory = true )
static

Selector.

Definition at line 160 of file PatchFunction1New.C.

References dict, dictionary, entryName, faceValues, keyType::LITERAL, and pp.

◆ NewCompat()

template<class Type>
Foam::autoPtr< Foam::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 )
static

Compatibility selector.

Definition at line 183 of file PatchFunction1New.C.

References dict, dictionary, entryName, faceValues, keyType::LITERAL, and pp.

◆ NewIfPresent()

◆ New() [2/2]

template<class Type>
Foam::refPtr< Foam::PatchFunction1< Type > > New ( HashPtrTable< PatchFunction1< Type > > & cache,
const polyPatch & pp,
const word & entryName,
const dictionary & dict,
enum keyType::option matchOpt = keyType::LITERAL,
const bool faceValues = true,
const bool mandatory = true )
static

Selector with external storage. This also allows wildcard matches in a dictionary.

Definition at line 222 of file PatchFunction1New.C.

◆ constant()

template<class Type>
virtual bool constant ( ) const
inlinevirtual

Is value constant (i.e. independent of x).

Reimplemented in ConstantField< Type >, MappedFile< Type >, MappedFile< scalar >, PatchExprField< Type >, Sampled< Type >, and UniformValueField< Type >.

Definition at line 275 of file PatchFunction1.H.

◆ good()

template<class Type>
virtual bool good ( ) const
inlinevirtual

Can function be evaluated?

Reimplemented in UniformValueField< Type >.

Definition at line 280 of file PatchFunction1.H.

◆ uniform()

template<class Type>
bool uniform ( ) const
pure virtual

Is value uniform (i.e. independent of coordinate).

Implemented in CodedField< Type >, ConstantField< Type >, LookupField< Type >, MappedFile< Type >, MappedFile< scalar >, PatchExprField< Type >, Sampled< Type >, and UniformValueField< Type >.

Definition at line 76 of file PatchFunction1.C.

References coordSys_.

Referenced by ConstantField< Type >::uniform(), MappedFile< Type >::uniform(), and UniformValueField< Type >::uniform().

Here is the caller graph for this function:

◆ value()

template<class Type>
Foam::tmp< Foam::Field< Type > > value ( const scalar x) const
virtual

Return value as a function of (scalar) independent variable.

Reimplemented in CodedField< Type >, ConstantField< Type >, LookupField< Type >, MappedFile< Type >, MappedFile< scalar >, PatchExprField< Type >, Sampled< Type >, and UniformValueField< Type >.

Definition at line 83 of file PatchFunction1.C.

References NotImplemented, and x.

◆ integrate()

template<class Type>
Foam::tmp< Foam::Field< Type > > integrate ( const scalar x1,
const scalar x2 ) const
virtual

◆ localPosition()

template<class Type>
Foam::tmp< Foam::pointField > localPosition ( const pointField & globalPos) const
virtual

Helper: optionally convert coordinates to local coordinates.

Definition at line 107 of file PatchFunction1.C.

References coordSys_.

◆ transform() [1/2]

template<class Type>
Foam::tmp< Foam::Field< Type > > transform ( const Field< Type > & fld) const
virtual

Apply optional transformation.

Definition at line 137 of file PatchFunction1.C.

References coordSys_, faceValues, fld(), and patchFunction1Base::patch_.

Referenced by ConstantField< Type >::integrate(), UniformValueField< Type >::integrate(), ConstantField< Type >::value(), and UniformValueField< Type >::value().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transform() [2/2]

template<class Type>
Foam::tmp< Foam::Field< Type > > transform ( const tmp< Field< Type > > & tfld) const
virtual

Apply optional transformation.

Definition at line 114 of file PatchFunction1.C.

References tmp< T >::clear(), coordSys_, faceValues, and patchFunction1Base::patch_.

Here is the call graph for this function:

◆ autoMap()

template<class Type>
void autoMap ( const FieldMapper & mapper)
virtual

Map (and resize as needed) from self given a mapping object.

Reimplemented in CodedField< Type >, ConstantField< Type >, MappedFile< Type >, MappedFile< scalar >, PatchExprField< Type >, and UniformValueField< Type >.

Definition at line 159 of file PatchFunction1.C.

Referenced by CodedField< Type >::autoMap(), MappedFile< Type >::autoMap(), and PatchExprField< Type >::autoMap().

Here is the caller graph for this function:

◆ rmap()

template<class Type>
void rmap ( const PatchFunction1< Type > & rhs,
const labelList & addr )
virtual

Reverse map the given PatchFunction1 onto this PatchFunction1.

Reimplemented in CodedField< Type >, ConstantField< Type >, MappedFile< Type >, MappedFile< scalar >, PatchExprField< Type >, and UniformValueField< Type >.

Definition at line 164 of file PatchFunction1.C.

References PatchFunction1, and Foam::rhs().

Referenced by CodedField< Type >::rmap(), MappedFile< Type >::rmap(), and PatchExprField< Type >::rmap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeData()

template<class Type>
void writeData ( Ostream & os) const
virtual

◆ operator<<

template<class Type>
Ostream & operator<< ( Ostream & os,
const PatchFunction1< Type > & rhs )
friend

Ostream Operator.

References os(), PatchFunction1, and Foam::rhs().

Member Data Documentation

◆ coordSys_

template<class Type>
coordinateScaling<Type> coordSys_
protected

Optional local coordinate system and scaling.

Definition at line 93 of file PatchFunction1.H.

Referenced by ConstantField< Type >::integrate(), localPosition(), transform(), transform(), uniform(), ConstantField< Type >::value(), and writeData().

◆ PatchFunction1

◆ dictionary

◆ pp [1/2]

◆ type [1/2]

template<class Type>
const polyPatch const word& type

Definition at line 129 of file PatchFunction1.H.

◆ entryName [1/2]

◆ dict [1/2]

◆ faceValues

◆ pp [2/2]

template<class Type>
const polyPatch const word const word const dictionary const bool pp

Definition at line 134 of file PatchFunction1.H.

◆ type [2/2]

template<class Type>
const polyPatch const word const word const dictionary const bool type

Definition at line 134 of file PatchFunction1.H.

◆ entryName [2/2]

template<class Type>
const polyPatch const word const word const dictionary const bool entryName

Definition at line 134 of file PatchFunction1.H.

◆ dict [2/2]

template<class Type>
const polyPatch const word const word const dictionary const bool dict

Definition at line 134 of file PatchFunction1.H.


The documentation for this class was generated from the following files: