Ramp function base class for the set of scalar functions starting from 0 and increasing monotonically to 1 from start over the duration and remaining at 1 thereafter.
More...
#include <ramp.H>


Protected Member Functions | |
| scalar | linearRamp (const scalar t) const |
| Simple linear ramp function that forms the basis of many more complex ramp functions. | |
| Protected Member Functions inherited from Function1< scalar > | |
| void | operator= (const Function1< scalar > &)=delete |
| No copy assignment. | |
| Protected Member Functions inherited from function1Base | |
| void | operator= (const function1Base &)=delete |
| No copy assignment. | |
Protected Attributes | |
| scalar | start_ |
| Start-time of the ramp function. | |
| scalar | duration_ |
| Duration of the ramp function. | |
| Protected Attributes inherited from function1Base | |
| const word | name_ |
| Name of entry. | |
| const objectRegistry * | obrPtr_ |
| Pointer to an object registry. | |
Additional Inherited Members | |
| Public Types inherited from Function1< scalar > | |
| typedef scalar | returnType |
| The return type. | |
| typedef autoPtr< Function1 >(* | dictionaryConstructorPtr) (const word &entryName, const dictionary &dict, const objectRegistry *obrPtr) |
| Declare runtime constructor selection table. | |
| typedef ::Foam::HashTable< dictionaryConstructorPtr, ::Foam::word, ::Foam::Hash<::Foam::word > > | dictionaryConstructorTableType |
| typedef ::Foam::HashTable< std::pair<::Foam::word, int >, ::Foam::word, ::Foam::Hash<::Foam::word > > | dictionaryConstructorCompatTableType |
| Static Public Member Functions inherited from Function1< scalar > | |
| static const char * | typeName_ () |
| Runtime type information. | |
| static dictionaryConstructorCompatTableType & | dictionaryConstructorCompatTable () |
| static void | dictionaryConstructorTablePtr_construct (bool load) |
| static dictionaryConstructorPtr | dictionaryConstructorTable (const ::Foam::word &k) |
| static tmp< Function1< scalar > > | Clone (const Derived &fun) |
| Clone a Function1. | |
| static autoPtr< Function1< scalar > > | New (const word &entryName, const dictionary &dict, const word &redirectType, const objectRegistry *obrPtr=nullptr, const bool mandatory=true) |
| Selector, with fallback redirection. | |
| static autoPtr< Function1< scalar > > | NewCompat (const word &entryName, std::initializer_list< std::pair< const char *, int > > compat, const dictionary &dict, const word &redirectType=word::null, const objectRegistry *obrPtr=nullptr, const bool mandatory=true) |
| Compatibility selector, with fallback redirection. | |
| static autoPtr< Function1< scalar > > | New (const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr, const bool mandatory=true) |
| Selector, without fallback redirection. | |
| static autoPtr< Function1< scalar > > | NewIfPresent (const word &entryName, const dictionary &dict, const word &redirectType, const objectRegistry *obrPtr=nullptr) |
| An optional selector, with fallback redirection. | |
| static autoPtr< Function1< scalar > > | NewIfPresent (const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr) |
| An optional selector, without fallback redirection. | |
| static refPtr< Function1< scalar > > | New (HashPtrTable< Function1< scalar > > &cache, const word &entryName, const dictionary &dict, enum keyType::option matchOpt=keyType::LITERAL, const objectRegistry *obrPtr=nullptr, const bool mandatory=true) |
| Selector with external storage of Function1. This also allows wildcard matches in a dictionary. | |
| Static Public Attributes inherited from Function1< scalar > | |
| static const ::Foam::word | typeName |
| static int | debug |
| static dictionaryConstructorTableType * | dictionaryConstructorTablePtr_ |
| static std::unique_ptr< dictionaryConstructorCompatTableType > | dictionaryConstructorCompatTablePtr_ |
Ramp function base class for the set of scalar functions starting from 0 and increasing monotonically to 1 from start over the duration and remaining at 1 thereafter.
Usage:
<entryName> <rampFunction>;
<entryName>Coeffs
{
start 10;
duration 20;
}
or
<entryName>
{
type <rampFunction>;
start 10;
duration 20;
}
Where:
| Property | Description | Required | Default value |
|---|---|---|---|
start | Start time | no | 0 |
duration | Duration | yes |
| ramp | ( | const word & | entryName, |
| const dictionary & | dict, | ||
| const objectRegistry * | obrPtr = nullptr ) |
Construct from entry name, dictionary and optional registry.
Definition at line 33 of file ramp.C.
References dict, and Function1< scalar >::Function1().
Referenced by halfCosineRamp::halfCosineRamp(), linearRamp::linearRamp(), quadraticRamp::quadraticRamp(), quarterCosineRamp::quarterCosineRamp(), quarterSineRamp::quarterSineRamp(), reverseRamp::reverseRamp(), stepFunction::stepFunction(), and stepRamp::stepRamp().


|
virtualdefault |
Destructor.
|
inlineprotected |
Simple linear ramp function that forms the basis of many more complex ramp functions.
Definition at line 117 of file ramp.H.
References Foam::clamp(), duration_, and start_.
Referenced by halfCosineRamp::value(), linearRamp::value(), quadraticRamp::value(), quarterCosineRamp::value(), and quarterSineRamp::value().


|
virtual |
Convert time.
Reimplemented from function1Base.
Definition at line 55 of file ramp.C.
References duration_, start_, and TimeState::userTimeToTime().

|
pure virtual |
Return value for time t.
Reimplemented from Function1< scalar >.
Implemented in halfCosineRamp, linearRamp, quadraticRamp, quarterCosineRamp, quarterSineRamp, reverseRamp, stepFunction, and stepRamp.
References os().

|
virtual |
Write in dictionary format.
Reimplemented from Function1< scalar >.
Definition at line 62 of file ramp.C.
References name, os(), Function1< Type >::writeData(), and writeEntries().

|
virtual |
Write coefficient entries in dictionary format.
Reimplemented from Function1< scalar >.
Definition at line 48 of file ramp.C.
References duration_, os(), and start_.
Referenced by writeData().


|
protected |
Start-time of the ramp function.
Definition at line 106 of file ramp.H.
Referenced by linearRamp(), userTimeToTime(), reverseRamp::value(), stepFunction::value(), stepRamp::value(), and writeEntries().
|
protected |
Duration of the ramp function.
Definition at line 111 of file ramp.H.
Referenced by linearRamp(), reverseRamp::reverseRamp(), stepRamp::stepRamp(), userTimeToTime(), stepFunction::value(), and writeEntries().