version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_TIMESTEPPING_TIME_LEVEL_HH
13#define DUMUX_TIMESTEPPING_TIME_LEVEL_HH
14
15namespace Dumux::Experimental {
16
20template<class Scalar>
22{
23public:
24
30 explicit TimeLevel(Scalar curTime)
31 : curTime_(curTime)
32 , prevTime_(curTime)
33 , timeStepFraction_(1.0)
34 {}
35
46 TimeLevel(Scalar curTime, Scalar prevTime, Scalar dtFraction)
47 : curTime_(curTime)
48 , prevTime_(prevTime)
49 , timeStepFraction_(dtFraction)
50 {}
51
53 Scalar current() const { return curTime_; }
55 Scalar previous() const { return prevTime_; }
57 Scalar timeStepFraction() const { return timeStepFraction_; }
58
59private:
60 Scalar curTime_;
61 Scalar prevTime_;
62 Scalar timeStepFraction_;
63};
64
65} // end namespace Dumux::Experimental
66
67#endif
Class that represents a time level during time integration.
Definition: timelevel.hh:22
Scalar previous() const
Return the time at the beginning of time integration.
Definition: timelevel.hh:55
TimeLevel(Scalar curTime, Scalar prevTime, Scalar dtFraction)
Construct a time level with information on an ongoing time step.
Definition: timelevel.hh:46
TimeLevel(Scalar curTime)
Construct a time level with a time.
Definition: timelevel.hh:30
Scalar current() const
Return the current time.
Definition: timelevel.hh:53
Scalar timeStepFraction() const
Return the fraction of the time step this level corresponds to.
Definition: timelevel.hh:57
Definition: experimental/assembly/cclocalassembler.hh:36