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