ConstantField< Type > Class Template Reference

Templated function that returns a constant value. More...

Inheritance diagram for ConstantField< Type >:
[legend]
Collaboration diagram for ConstantField< Type >:
[legend]

Public Member Functions

 TypeName ("constant")
 Runtime type information. More...
 
 ConstantField (const polyPatch &pp, const word &entryName, const Type &uniformValue, const dictionary &dict=dictionary::null, const bool faceValues=true)
 Construct from a uniform value. More...
 
 ConstantField (const polyPatch &pp, const word &entryName, const bool isUniform, const Type &uniformValue, const Field< Type > &fieldValues, const dictionary &dict=dictionary::null, const bool faceValues=true)
 Construct from components. More...
 
 ConstantField (const polyPatch &pp, const word &redirectType, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from entry name and dictionary. More...
 
 ConstantField (const polyPatch &pp, const entry *eptr, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from primitive entry, entry name and dictionary. More...
 
 ConstantField (const ConstantField< Type > &rhs)
 Copy construct. More...
 
 ConstantField (const ConstantField< Type > &rhs, const polyPatch &pp)
 Copy construct setting patch. More...
 
virtual tmp< PatchFunction1< Type > > clone () const
 Construct and return a clone. More...
 
virtual tmp< PatchFunction1< Type > > clone (const polyPatch &pp) const
 Construct and return a clone setting patch. More...
 
virtual ~ConstantField ()=default
 Destructor. More...
 
virtual bool constant () const
 Value is independent of x. More...
 
virtual bool uniform () const
 Is value uniform (i.e. independent of coordinate) More...
 
virtual tmp< Field< Type > > value (const scalar x) const
 Return constant value. More...
 
virtual tmp< Field< Type > > integrate (const scalar x1, const scalar x2) const
 Integrate between two values. More...
 
virtual void autoMap (const FieldMapper &mapper)
 Map (and resize as needed) from self given a mapping object. More...
 
virtual void rmap (const PatchFunction1< Type > &pf1, const labelList &addr)
 Reverse map the given PatchFunction1 onto this PatchFunction1. More...
 
virtual void writeData (Ostream &os) const
 Write in dictionary format. More...
 
- Public Member Functions inherited from PatchFunction1< Type >
 TypeName ("PatchFunction1") declareRunTimeSelectionTable(autoPtr
 Runtime type information. More...
 
 PatchFunction1 (const polyPatch &pp, const word &entryName, const bool faceValues=true)
 Construct from polyPatch and entry name. More...
 
 PatchFunction1 (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 Construct from polyPatch, dictionary and entry name. More...
 
 PatchFunction1 (const PatchFunction1< Type > &rhs)
 Copy construct. More...
 
 PatchFunction1 (const PatchFunction1< Type > &rhs, const polyPatch &pp)
 Copy construct setting patch. More...
 
virtual ~PatchFunction1 ()=default
 Destructor. More...
 
virtual tmp< pointFieldlocalPosition (const pointField &globalPos) const
 Helper: optionally convert coordinates to local coordinates. More...
 
virtual tmp< Field< Type > > transform (const Field< Type > &fld) const
 Apply optional transformation. More...
 
virtual tmp< Field< Type > > transform (const tmp< Field< Type >> &tfld) const
 Apply optional transformation. More...
 

Additional Inherited Members

- Public Types inherited from PatchFunction1< Type >
typedef Field< Type > returnType
 
- Static Public Member Functions inherited from PatchFunction1< Type >
static autoPtr< PatchFunction1< Type > > New (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true, const bool mandatory=true)
 Selector. More...
 
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. More...
 
static autoPtr< PatchFunction1< Type > > NewIfPresent (const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
 An optional selector. More...
 
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)
 
- Public Attributes inherited from PatchFunction1< Type >
 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 inherited from PatchFunction1< Type >
void operator= (const PatchFunction1< Type > &)=delete
 No copy assignment. More...
 
- Protected Attributes inherited from PatchFunction1< Type >
coordinateScaling< Type > coordSys_
 Optional local coordinate system and scaling. More...
 

Detailed Description

template<class Type>
class Foam::PatchFunction1Types::ConstantField< Type >

Templated function that returns a constant value.

Usage - for entry <entryName> returning the value

:

    <entryName>    constant  <value>
Source files

Definition at line 58 of file ConstantField.H.

Constructor & Destructor Documentation

◆ ConstantField() [1/6]

ConstantField ( const polyPatch pp,
const word entryName,
const Type &  uniformValue,
const dictionary dict = dictionary::null,
const bool  faceValues = true 
)

Construct from a uniform value.

Definition at line 34 of file ConstantField.C.

◆ ConstantField() [2/6]

ConstantField ( const polyPatch pp,
const word entryName,
const bool  isUniform,
const Type &  uniformValue,
const Field< Type > &  fieldValues,
const dictionary dict = dictionary::null,
const bool  faceValues = true 
)

Construct from components.

Definition at line 51 of file ConstantField.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, patchIdentifier::name(), and Foam::nl.

Here is the call graph for this function:

◆ ConstantField() [3/6]

ConstantField ( const polyPatch pp,
const word redirectType,
const word entryName,
const dictionary dict,
const bool  faceValues = true 
)

Construct from entry name and dictionary.

Definition at line 169 of file ConstantField.C.

◆ ConstantField() [4/6]

ConstantField ( const polyPatch pp,
const entry eptr,
const word entryName,
const dictionary dict,
const bool  faceValues = true 
)

Construct from primitive entry, entry name and dictionary.

Definition at line 196 of file ConstantField.C.

◆ ConstantField() [5/6]

ConstantField ( const ConstantField< Type > &  rhs)
explicit

Copy construct.

Definition at line 223 of file ConstantField.C.

◆ ConstantField() [6/6]

ConstantField ( const ConstantField< Type > &  rhs,
const polyPatch pp 
)
explicit

Copy construct setting patch.

Definition at line 233 of file ConstantField.C.

References Foam::Zero.

◆ ~ConstantField()

virtual ~ConstantField ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "constant"  )

Runtime type information.

◆ clone() [1/2]

virtual tmp<PatchFunction1<Type> > clone ( ) const
inlinevirtual

Construct and return a clone.

Implements PatchFunction1< Type >.

Definition at line 151 of file ConstantField.H.

◆ clone() [2/2]

virtual tmp<PatchFunction1<Type> > clone ( const polyPatch pp) const
inlinevirtual

Construct and return a clone setting patch.

Implements PatchFunction1< Type >.

Definition at line 157 of file ConstantField.H.

References PatchFunction1< Type >::pp.

◆ constant()

virtual bool constant ( ) const
inlinevirtual

Value is independent of x.

Reimplemented from PatchFunction1< Type >.

Definition at line 173 of file ConstantField.H.

◆ uniform()

virtual bool uniform ( ) const
inlinevirtual

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

Implements PatchFunction1< Type >.

Definition at line 179 of file ConstantField.H.

References PatchFunction1< Type >::uniform().

Here is the call graph for this function:

◆ value()

Foam::tmp< Foam::Field< Type > > value ( const scalar  x) const
inlinevirtual

Return constant value.

Reimplemented from PatchFunction1< Type >.

Definition at line 35 of file ConstantFieldI.H.

References Foam::transform().

Here is the call graph for this function:

◆ integrate()

Foam::tmp< Foam::Field< Type > > integrate ( const scalar  x1,
const scalar  x2 
) const
inlinevirtual

Integrate between two values.

Reimplemented from PatchFunction1< Type >.

Definition at line 51 of file ConstantFieldI.H.

References Foam::transform().

Here is the call graph for this function:

◆ autoMap()

void autoMap ( const FieldMapper mapper)
virtual

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

Reimplemented from PatchFunction1< Type >.

Definition at line 257 of file ConstantField.C.

◆ rmap()

void rmap ( const PatchFunction1< Type > &  pf1,
const labelList addr 
)
virtual

Reverse map the given PatchFunction1 onto this PatchFunction1.

Reimplemented from PatchFunction1< Type >.

Definition at line 273 of file ConstantField.C.

◆ writeData()

void writeData ( Ostream os) const
virtual

Write in dictionary format.

Reimplemented from PatchFunction1< Type >.

Definition at line 285 of file ConstantField.C.

References Foam::name(), os(), and writeData().

Here is the call graph for this function:

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