3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
timelevel.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_TIMESTEPPING_TIME_LEVEL_HH
25#define DUMUX_TIMESTEPPING_TIME_LEVEL_HH
26
27namespace Dumux::Experimental {
28
32template<class Scalar>
34{
35public:
36
42 explicit TimeLevel(Scalar curTime)
43 : curTime_(curTime)
44 , prevTime_(curTime)
45 , timeStepFraction_(1.0)
46 {}
47
58 TimeLevel(Scalar curTime, Scalar prevTime, Scalar dtFraction)
59 : curTime_(curTime)
60 , prevTime_(prevTime)
61 , timeStepFraction_(dtFraction)
62 {}
63
65 Scalar current() const { return curTime_; }
67 Scalar previous() const { return prevTime_; }
69 Scalar timeStepFraction() const { return timeStepFraction_; }
70
71private:
72 Scalar curTime_;
73 Scalar prevTime_;
74 Scalar timeStepFraction_;
75};
76
77} // end namespace Dumux::Experimental
78
79#endif
Definition: variables.hh:32
Class that represents a time level during time integration.
Definition: timelevel.hh:34
Scalar previous() const
Return the time at the beginning of time integration.
Definition: timelevel.hh:67
TimeLevel(Scalar curTime, Scalar prevTime, Scalar dtFraction)
Construct a time level with information on an ongoing time step.
Definition: timelevel.hh:58
TimeLevel(Scalar curTime)
Construct a time level with a time.
Definition: timelevel.hh:42
Scalar current() const
Return the current time.
Definition: timelevel.hh:65
Scalar timeStepFraction() const
Return the fraction of the time step this level corresponds to.
Definition: timelevel.hh:69