GEOS
|
Enumerates the Units that are in use in GEOS and regroups useful conversion and formatting functions. More...
#include "common/DataTypes.hpp"
#include "common/PhysicsConstants.hpp"
#include "common/format/Format.hpp"
Go to the source code of this file.
Classes | |
struct | geos::units::TimeFormatInfo |
Stores information that is useful to duration strings. Based on the geos::units time constants. More... | |
struct | GEOS_FMT_NS::formatter< geos::units::TimeFormatInfo > |
Formatter to be able to directly use a DurationInfo as a GEOS_FMT() argument. More... | |
Namespaces | |
geos | |
Typedefs | |
using | geos::units::SystemClock = std::chrono::high_resolution_clock |
Clock in use in GEOS to manipulate system times. | |
using | geos::units::YearDaysRatio = std::ratio< 146097, 400 > |
One year = 365.2425 days (= 146097 / 400) following the Gregorian calendar and the C++ convention. | |
using | geos::units::Days = std::chrono::duration< int64_t, std::ratio_multiply< std::ratio< 24 >, std::chrono::hours::period > > |
Day helper duration type, equivalent to C++20 std::chrono::days. | |
using | geos::units::Years = std::chrono::duration< int64_t, std::ratio_multiply< YearDaysRatio, Days::period > > |
Year helper duration type, equivalent to C++20 std::chrono::years. | |
Enumerations | |
enum | geos::units::Unit : integer { geos::units::Unknown , geos::units::Dimensionless , geos::units::Pressure , geos::units::Temperature , geos::units::TemperatureInC , geos::units::Distance , geos::units::Time , geos::units::Viscosity , geos::units::Density , geos::units::Enthalpy , geos::units::Solubility , geos::units::Mass , geos::units::Mole , geos::units::MassRate , geos::units::MoleRate , geos::units::Transmissibility } |
Enumerator of available unit types. Units are in SI by default. More... | |
Functions | |
constexpr GEOS_HOST_DEVICE double | geos::units::convertKToC (double kelvin) |
constexpr GEOS_HOST_DEVICE double | geos::units::convertCToK (double celsius) |
constexpr std::string_view | geos::units::getDescription (Unit unit) |
constexpr std::string_view | geos::units::getSymbol (Unit unit) |
string | geos::units::formatValue (real64 value, Unit unit) |
Format the specified value coherently with the specified unit. More... | |
Variables | |
static constexpr double | geos::units::YearDays = ( double )YearDaysRatio::num / YearDaysRatio::den |
Days in one year (following the Gregorian calendar and the C++ convention) = 365.2425 days (= 146097 / 400). | |
static constexpr double | geos::units::MinuteSeconds = 60.0 |
Seconds in a minute. | |
static constexpr double | geos::units::HourSeconds = 60.0 * MinuteSeconds |
Seconds in a hour. | |
static constexpr double | geos::units::DaySeconds = 24.0 * HourSeconds |
Seconds in a day. | |
static constexpr double | geos::units::YearSeconds = YearDays * DaySeconds |
Seconds in a year. | |
Enumerates the Units that are in use in GEOS and regroups useful conversion and formatting functions.
Definition in file Units.hpp.
enum geos::units::Unit : integer |
Enumerator of available unit types. Units are in SI by default.
|
inlineconstexpr |
|
inlineconstexpr |
Format the specified value coherently with the specified unit.
value | The value to format. |
unit | The unit of the specified value. |
|
inlineconstexpr |