Go to the documentation of this file.
101 #ifndef Function1Types_Sine_H
102 #define Function1Types_Sine_H
110 namespace Function1Types
120 public Function1<Type>
133 autoPtr<Function1<scalar>>
period_;
139 autoPtr<Function1<Type>>
scale_;
142 autoPtr<Function1<Type>>
level_;
148 inline scalar
cycle(
const scalar t)
const;
151 inline scalar
cosForm(
const scalar t)
const;
154 inline scalar
sinForm(
const scalar t)
const;
158 inline scalar
squareForm(
const scalar t,
const scalar posFrac)
const;
161 inline Type
cosValue(
const scalar t)
const;
164 inline Type
sinValue(
const scalar t)
const;
167 inline Type
squareValue(
const scalar t,
const scalar posFrac)
const;
179 void operator=(
const Sine<Type>&) =
delete;
189 const objectRegistry*
obrPtr =
nullptr
193 explicit Sine(
const Sine<Type>& rhs);
197 virtual ~Sine() =
default;
206 virtual inline Type
value(
const scalar t)
const
autoPtr< Function1< scalar > > amplitude_
Scalar amplitude of the function (optional)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Sine(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry name, dictionary and optional registry.
A class for handling words, derived from Foam::string.
A templated sine function, with support for offset etc.
const word const dictionary & dict
autoPtr< Function1< scalar > > frequency_
Frequency of the function (or specify period)
void writeEntries(Ostream &os) const
Write coefficient entries in dictionary format.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
virtual void userTimeToTime(const Time &t)
Convert time.
Registry of regIOobjects.
virtual ~Sine()=default
Destructor.
autoPtr< Function1< Type > > scale_
Scaling factor for the function.
scalar squareForm(const scalar t, const scalar posFrac) const
Calculated square value at time t.
const word const dictionary const objectRegistry * obrPtr
autoPtr< Function1< Type > > level_
Level to add to the scaled function.
Type sinValue(const scalar t) const
Return value for time t, using sin form.
scalar t0_
Start-time for the function.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
autoPtr< Function1< scalar > > period_
Period of the function (or specify frequency)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual Type value(const scalar t) const
Return value for time t.
Type cosValue(const scalar t) const
Return value for time t, using cos form.
scalar sinForm(const scalar t) const
Calculated sin value at time t.
scalar cycle(const scalar t) const
The cycle: (freq * time) or (time / period)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void operator=(const Sine< Type > &)=delete
No copy assignment.
virtual void writeData(Ostream &os) const
Write in dictionary format.
scalar cosForm(const scalar t) const
Calculated cos value at time t.
Type squareValue(const scalar t, const scalar posFrac) const
Return value for time t, using square form.