/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "TimeFunction1.H"
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
template
Foam::TimeFunction1::TimeFunction1
(
const Time& t,
const word& name,
const dictionary& dict
)
:
time_(t),
name_(name),
entry_(Function1::New(name, dict))
{
entry_->convertTimeBase(t);
}
template
Foam::TimeFunction1::TimeFunction1(const Time& t, const word& name)
:
time_(t),
name_(name),
entry_(nullptr)
{}
template
Foam::TimeFunction1::TimeFunction1
(
const TimeFunction1& tde
)
:
time_(tde.time_),
name_(tde.name_),
entry_()
{
if (tde.entry_.valid())
{
entry_.reset(tde.entry_->clone().ptr());
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template
Foam::TimeFunction1::~TimeFunction1()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
void Foam::TimeFunction1::reset(const dictionary& dict)
{
entry_.reset
(
Function1::New
(
name_,
dict
).ptr()
);
entry_->convertTimeBase(time_);
}
template
const Foam::word& Foam::TimeFunction1::name() const
{
return entry_->name();
}
template
Type Foam::TimeFunction1::value(const scalar x) const
{
return entry_->value(x);
}
template
Type Foam::TimeFunction1::integrate
(
const scalar x1,
const scalar x2
) const
{
return entry_->integrate(x1, x2);
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const TimeFunction1& de
)
{
return de.entry_->operator<<(os, de);
}
template
void Foam::TimeFunction1::writeData(Ostream& os) const
{
entry_->writeData(os);
}
// ************************************************************************* //