LimitRange< Type > Class Template Reference

Function1 wrapper that limits the input range of another Function1. More...

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

Public Member Functions

 TypeName ("limitRange")
 Runtime type information. More...
 
void operator= (const LimitRange< Type > &)=delete
 No copy assignment. More...
 
 LimitRange (const word &entryName, const dictionary &dict)
 Construct from entry name and dictionary. More...
 
 LimitRange (const LimitRange< Type > &rhs)
 Copy construct. More...
 
virtual ~LimitRange ()=default
 Destructor. More...
 
virtual Type value (const scalar t) const
 Return value for time t. More...
 
virtual Type integrate (const scalar x1, const scalar x2) const
 Integrate between two (scalar) values. More...
 
virtual void writeData (Ostream &os) const
 Write in dictionary format. More...
 
void writeEntries (Ostream &os) const
 Write coefficient entries in dictionary format. More...
 
- Public Member Functions inherited from Function1< Type >
 TypeName ("Function1") declareRunTimeSelectionTable(autoPtr
 Runtime type information. More...
 
 Function1 (const word &entryName)
 Construct from entry name. More...
 
 Function1 (const word &entryName, const dictionary &dict)
 Construct from entry name and dictionary. More...
 
 Function1 (const Function1< Type > &rhs)
 Copy construct. More...
 
virtual tmp< Function1< Type > > clone () const =0
 Construct and return a clone. More...
 
virtual ~Function1 ()=default
 Destructor. More...
 
virtual tmp< Field< Type > > value (const scalarField &x) const
 Return value as a function of (scalar) independent variable. More...
 
virtual tmp< Field< Type > > integrate (const scalarField &x1, const scalarField &x2) const
 Integrate between two (scalar) values. More...
 
void writeEntries (Ostream &os) const
 Write coefficient entries in dictionary format. More...
 

Additional Inherited Members

- Public Types inherited from Function1< Type >
typedef Type returnType
 
- Static Public Member Functions inherited from Function1< Type >
static autoPtr< Function1< Type > > New (const word &entryName, const dictionary &dict, const word &redirectType, const bool mandatory=true)
 Selector, with fallback redirection. More...
 
static autoPtr< Function1< Type > > NewCompat (const word &entryName, std::initializer_list< std::pair< const char *, int >> compat, const dictionary &dict, const word &redirectType=word::null, const bool mandatory=true)
 Compatibility selector, with fallback redirection. More...
 
static autoPtr< Function1< Type > > New (const word &entryName, const dictionary &dict, const bool mandatory=true)
 Selector, without fallback redirection. More...
 
static autoPtr< Function1< Type > > NewIfPresent (const word &entryName, const dictionary &dict, const word &redirectType=word::null)
 An optional selector. More...
 
- Public Attributes inherited from Function1< Type >
 Function1
 
 dictionary
 
const wordentryName
 
const word const dictionarydict
 
const word const dictionary entryName
 
const word const dictionary dict
 
- Protected Member Functions inherited from Function1< Type >
void operator= (const Function1< Type > &)=delete
 No copy assignment. More...
 

Detailed Description

template<class Type>
class Foam::Function1Types::LimitRange< Type >

Function1 wrapper that limits the input range of another Function1.

Example usage for limiting a polynomial:

    limitedPolyTest        limitRange;
    limitedPolyTestCoeffs
    {
        min         0.4;
        max         1.4;

        value       polynomial
        (
            (5 1)
            (-2 2)
            (-2 3)
            (1 4)
        );
    }

Here the return value will be:

  • poly(0.4) for x <= 0.4;
  • poly(1.4) for x >= 1.4; and
  • poly(x) for 0.4 < x < 1.4.

Example usage for limiting a table

    limitedTableFileTest   limitRange;
    limitedTableFileTestCoeffs
    {
        min             0.4;
        max             1.4;

        value           tableFile;
        file            "<system>/fanCurve.txt";
    }

Where:

Property Description Required
min Minimum input value yes
max Maximum input value yes
value Function of type Function1<Type> yes
Source files

Definition at line 114 of file LimitRange.H.

Constructor & Destructor Documentation

◆ LimitRange() [1/2]

LimitRange ( const word entryName,
const dictionary dict 
)

Construct from entry name and dictionary.

Definition at line 43 of file LimitRange.C.

References dict, and Foam::blockMeshTools::read().

Here is the call graph for this function:

◆ LimitRange() [2/2]

LimitRange ( const LimitRange< Type > &  rhs)
explicit

Copy construct.

Definition at line 55 of file LimitRange.C.

◆ ~LimitRange()

virtual ~LimitRange ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "limitRange"  )

Runtime type information.

◆ operator=()

void operator= ( const LimitRange< Type > &  )
delete

No copy assignment.

◆ value()

Type value ( const scalar  t) const
inlinevirtual

Return value for time t.

Reimplemented from Function1< Type >.

Definition at line 33 of file LimitRangeI.H.

References Foam::max(), and Foam::min().

Here is the call graph for this function:

◆ integrate()

Type integrate ( const scalar  x1,
const scalar  x2 
) const
inlinevirtual

Integrate between two (scalar) values.

Reimplemented from Function1< Type >.

Definition at line 43 of file LimitRangeI.H.

References Foam::max(), and Foam::min().

Here is the call graph for this function:

◆ writeData()

void writeData ( Ostream os) const
virtual

Write in dictionary format.

Reimplemented from Function1< Type >.

Definition at line 76 of file LimitRange.C.

References Ostream::beginBlock(), token::END_STATEMENT, Ostream::endBlock(), Foam::name(), Foam::nl, and Function1< Type >::writeData().

Here is the call graph for this function:

◆ writeEntries()

void writeEntries ( Ostream os) const

Write coefficient entries in dictionary format.

Definition at line 67 of file LimitRange.C.

References Ostream::writeEntry().

Here is the call graph for this function:

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