Skip to content
Snippets Groups Projects
Commit 373d88a4 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Function1 - added some missing time conversions

parent d5260b18
Branches
Tags
No related merge requests found
......@@ -67,6 +67,13 @@ Foam::Function1Types::Sine<Type>::Sine(const Sine<Type>& rhs)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::Function1Types::Sine<Type>::convertTimeBase(const Time& t)
{
t0_ = t.timeToUserTime(t0_);
}
template<class Type>
void Foam::Function1Types::Sine<Type>::writeEntries(Ostream& os) const
{
......
......@@ -194,6 +194,9 @@ public:
// Member Functions
//- Convert time
virtual void convertTimeBase(const Time& t);
//- Return value for time t
virtual inline Type value(const scalar t) const
{
......
......@@ -58,6 +58,13 @@ void Foam::Function1Types::ramp::writeEntries(Ostream& os) const
}
void Foam::Function1Types::ramp::convertTimeBase(const Time& t)
{
start_ = t.timeToUserTime(start_);
duration_ = t.timeToUserTime(duration_);
}
void Foam::Function1Types::ramp::writeData(Ostream& os) const
{
Function1<scalar>::writeData(os);
......
......@@ -133,6 +133,9 @@ public:
// Member Functions
//- Convert time
virtual void convertTimeBase(const Time& t);
//- Return value for time t
virtual scalar value(const scalar t) const = 0;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment