OGS
TimeIncrement.h
Go to the documentation of this file.
1
10
#pragma once
11
12
#include <algorithm>
13
#include <cmath>
14
#include <compare>
15
#include <limits>
16
17
#include "
MathLib/KahanSum.h
"
18
19
namespace
NumLib
20
{
21
struct
TimeIncrement;
22
}
23
24
template
<>
25
struct
fmt::formatter<
NumLib
::TimeIncrement> : fmt::ostream_formatter
26
{
27
};
28
29
namespace
NumLib
30
{
31
struct
TimeIncrement
32
{
33
constexpr
explicit
TimeIncrement
(
double
const
dt) :
value_
{dt} {}
34
35
constexpr
double
operator()
()
const
{
return
value_
; }
36
37
friend
inline
std::ostream&
operator<<
(std::ostream& os,
38
TimeIncrement
const
& dt)
39
{
40
auto
const
precision = os.precision();
41
return
os << std::setprecision(
42
std::numeric_limits<double>::max_digits10)
43
<< dt.
value_
<< std::setprecision(precision);
44
}
45
46
private
:
47
double
value_
;
48
};
49
50
}
// namespace NumLib
KahanSum.h
NumLib
Definition
ProjectData.h:46
NumLib::TimeIncrement
Definition
TimeIncrement.h:32
NumLib::TimeIncrement::operator<<
friend std::ostream & operator<<(std::ostream &os, TimeIncrement const &dt)
Definition
TimeIncrement.h:37
NumLib::TimeIncrement::operator()
constexpr double operator()() const
Definition
TimeIncrement.h:35
NumLib::TimeIncrement::TimeIncrement
constexpr TimeIncrement(double const dt)
Definition
TimeIncrement.h:33
NumLib::TimeIncrement::value_
double value_
Definition
TimeIncrement.h:47
NumLib
TimeStepping
TimeIncrement.h
Generated by
1.12.0