101#ifndef Foam_Function1Types_Sine_H
102#define Foam_Function1Types_Sine_H
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;
187 const word& entryName,
189 const objectRegistry* obrPtr =
nullptr
196 virtual tmp<Function1<Type>>
clone()
const
203 virtual ~Sine() =
default;
212 virtual inline Type
value(
const scalar t)
const
218 virtual Type
integrate(
const scalar x1,
const scalar x2)
const
A templated sine function, with support for offset etc.
virtual tmp< Function1< Type > > clone() const
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.
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two (scalar) values.
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.
Function1(const word &entryName, const objectRegistry *obrPtr=nullptr)
Construct from entry name.
static tmp< Function1< Type > > Clone(const Derived &fun)
Clone a Function1.
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)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.