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);
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
virtual void writeEntries(Ostream &os) const
Write coefficient entries in dictionary format.
const word const dictionary & dict
virtual void userTimeToTime(const Time &t)
Convert time.
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 sinValue(const scalar t) const
Return value for time t, using sin form.
scalar t0_
Start-time for the function.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
scalar squareForm(const scalar t, const scalar posFrac) const
Calculated square value at time t.
autoPtr< Function1< Type > > level_
Level to add to the scaled function.
autoPtr< Function1< Type > > scale_
Scaling factor for the function.
autoPtr< Function1< scalar > > frequency_
Frequency of the function (or specify period)
virtual ~Sine()=default
Destructor.
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...
OBJstream os(runTime.globalPath()/outputName)
autoPtr< Function1< scalar > > period_
Period of the function (or specify frequency)
const word const dictionary const objectRegistry * obrPtr
scalar cosForm(const scalar t) const
Calculated cos value at time t.
virtual void writeData(Ostream &os) const
Write in dictionary format.
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.
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.
virtual tmp< Function1< Type > > clone() const
Construct and return a clone.
void operator=(const Sine< Type > &)=delete
No copy assignment.