/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- 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& time, const word& entryName, const dictionary& dict ) : time_(time), name_(entryName), function_(Function1::New(entryName, dict)) {} template Foam::TimeFunction1::TimeFunction1 ( const Time& time, const word& entryName ) : time_(time), name_(entryName), function_(nullptr) {} template Foam::TimeFunction1::TimeFunction1 ( const TimeFunction1& tf ) : time_(tf.time_), name_(tf.name_), function_(tf.function_, false) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template Foam::TimeFunction1::~TimeFunction1() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template void Foam::TimeFunction1::reset(const dictionary& dict) { function_.reset(Function1::New(name_, dict).ptr()); } template Type Foam::TimeFunction1::value(const scalar x) const { return function_->value(time_.userTimeToTime(x)); } template Type Foam::TimeFunction1::integral ( const scalar x1, const scalar x2 ) const { return time_.timeToUserTimeRatio() *function_->integral ( time_.userTimeToTime(x1), time_.userTimeToTime(x2) ); } // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template Foam::Ostream& Foam::operator<< ( Ostream& os, const TimeFunction1& tf ) { return os << tf.function_(); } template void Foam::TimeFunction1::write(Ostream& os) const { function_->write(os); } // ************************************************************************* //