12#include "../settings/settings.hpp"
13#include "../utility/array_util.hpp"
20static double EMPTY_STATE{ 0 };
22template <
size_t N,
size_t N_cumulative = settings::data::N_CumulativeCell>
23struct State :
public std::array<double, N + N_cumulative>
33 inline auto time()
const {
return (N_cumulative != 3) ? EMPTY_STATE : (*this)[
i_time]; }
34 inline auto Ah()
const {
return (N_cumulative != 3) ? EMPTY_STATE : (*this)[
i_Ah]; }
35 inline auto Wh()
const {
return (N_cumulative != 3) ? EMPTY_STATE : (*this)[
i_Wh]; }
37 inline auto &
time() {
return (N_cumulative != 3) ? EMPTY_STATE : (*this)[
i_time]; }
38 inline auto &
Ah() {
return (N_cumulative != 3) ? EMPTY_STATE : (*this)[
i_Ah]; }
39 inline auto &
Wh() {
return (N_cumulative != 3) ? EMPTY_STATE : (*this)[
i_Wh]; }
43 if constexpr (N_cumulative != 3)
49 return "Current throughput [Ah]";
51 return "Energy throughput [Wh]";
57 inline auto reset() { this->fill(0); }
Slide namespace contains all the types, classes, and functions for the simulation framework.
Definition: Cell.hpp:27
static constexpr auto description(size_t i)
Definition: State.hpp:41
auto Wh() const
Energy throughput [Wh].
Definition: State.hpp:35
Index
Definition: State.hpp:26
@ i_Wh
Definition: State.hpp:29
@ i_Ah
Definition: State.hpp:28
@ N_states
Definition: State.hpp:30
@ i_time
Definition: State.hpp:27
auto & time()
time [s]
Definition: State.hpp:37
auto Ah() const
Current throughput [Ah].
Definition: State.hpp:34
auto time() const
time [s]
Definition: State.hpp:33
auto reset()
Definition: State.hpp:57
auto & Wh()
Energy throughput [Wh].
Definition: State.hpp:39
auto & Ah()
Current throughput [Ah].
Definition: State.hpp:38