helics  3.0.1
helicsTime.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2017-2021,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 #pragma once
8 #ifndef _HELICS_TIME_HEADER_
9 # define _HELICS_TIME_HEADER_
10 # include "../utilities/timeRepresentation.hpp"
11 # include "CoreTypes.hpp"
12 # include "helics/helics-config.h"
13 
14 # include <cstdint>
18 namespace helics {
24 # ifdef HELICS_USE_PICOSECOND_TIME
25 using Time = TimeRepresentation<count_time<12>>;
26 # else
27 using Time = TimeRepresentation<count_time<9>>;
28 # endif
29 
31 constexpr Time timeZero = Time::zeroVal();
33 constexpr Time timeEpsilon = Time::epsilon();
35 constexpr Time negEpsilon = -Time::epsilon();
36 
39 
41 constexpr Time operator"" _t(long double val)
42 {
43  return {static_cast<double>(val)};
44 } // NOLINT
45 
50 };
51 
52 } // namespace helics
53 
54 // #TOBEDEPRECTATED The use of the the core-types header for the functions contained in
55 // ../application_api/timeOperations.hpp is deprectaced and will be removed in HELICS 3.0
56 // please use ../application_api/timeOperations.hpp directory for those functions.
57 // This next section should be removed in HELICS 3.0 but is needed to prevent breaking changes
58 # if defined HELICS_SHARED_LIBRARY || !defined HELICS_STATIC_CORE_LIBRARY
59 # include "../application_api/timeOperations.hpp"
60 # endif
61 #endif //_HELICS_TIME_HEADER_
helics::timeZero
constexpr Time timeZero
Definition: helicsTime.hpp:31
helics::initializationTime
constexpr Time initializationTime
Definition: helicsTime.hpp:38
helics::iteration_time::state
IterationResult state
the convergence state
Definition: helicsTime.hpp:49
helics::Time
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
helics::negEpsilon
constexpr Time negEpsilon
Definition: helicsTime.hpp:35
helics::iteration_time::grantedTime
Time grantedTime
the time of the granted step
Definition: helicsTime.hpp:48
helics::IterationResult
IterationResult
Definition: CoreTypes.hpp:80
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::iteration_time
Definition: helicsTime.hpp:47
helics::timeEpsilon
constexpr Time timeEpsilon
Definition: helicsTime.hpp:33
CoreTypes.hpp