From ec8c19b947052a71a848b24aad4549b6508dc810 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 15 Apr 2021 14:03:32 +0200 Subject: [PATCH] refactor: natural units refactored --- docs/CMakeLists.txt | 9 ++- docs/reference/systems/isq/natural.rst | 9 ++- .../systems/isq/natural/acceleration.rst | 4 ++ .../systems/isq/natural/dimensions.rst | 4 -- docs/reference/systems/isq/natural/energy.rst | 4 ++ docs/reference/systems/isq/natural/force.rst | 4 ++ docs/reference/systems/isq/natural/length.rst | 4 ++ docs/reference/systems/isq/natural/mass.rst | 4 ++ .../systems/isq/natural/momentum.rst | 4 ++ docs/reference/systems/isq/natural/speed.rst | 4 ++ docs/reference/systems/isq/natural/time.rst | 4 ++ .../natural/{dimensions.h => acceleration.h} | 57 +++++++-------- .../include/units/isq/natural/constants.h | 2 +- .../include/units/isq/natural/energy.h | 69 +++++++++++++++++++ .../include/units/isq/natural/force.h | 69 +++++++++++++++++++ .../include/units/isq/natural/length.h | 66 ++++++++++++++++++ .../include/units/isq/natural/mass.h | 66 ++++++++++++++++++ .../include/units/isq/natural/momentum.h | 69 +++++++++++++++++++ .../include/units/isq/natural/natural.h | 13 +++- .../include/units/isq/natural/speed.h | 44 ++++++++++++ .../include/units/isq/natural/time.h | 66 ++++++++++++++++++ 21 files changed, 537 insertions(+), 38 deletions(-) create mode 100644 docs/reference/systems/isq/natural/acceleration.rst delete mode 100644 docs/reference/systems/isq/natural/dimensions.rst create mode 100644 docs/reference/systems/isq/natural/energy.rst create mode 100644 docs/reference/systems/isq/natural/force.rst create mode 100644 docs/reference/systems/isq/natural/length.rst create mode 100644 docs/reference/systems/isq/natural/mass.rst create mode 100644 docs/reference/systems/isq/natural/momentum.rst create mode 100644 docs/reference/systems/isq/natural/speed.rst create mode 100644 docs/reference/systems/isq/natural/time.rst rename src/systems/isq-natural/include/units/isq/natural/{dimensions.h => acceleration.h} (52%) create mode 100644 src/systems/isq-natural/include/units/isq/natural/energy.h create mode 100644 src/systems/isq-natural/include/units/isq/natural/force.h create mode 100644 src/systems/isq-natural/include/units/isq/natural/length.h create mode 100644 src/systems/isq-natural/include/units/isq/natural/mass.h create mode 100644 src/systems/isq-natural/include/units/isq/natural/momentum.h create mode 100644 src/systems/isq-natural/include/units/isq/natural/speed.h create mode 100644 src/systems/isq-natural/include/units/isq/natural/time.h diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 3b9f0c73..a76aa93c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -138,8 +138,15 @@ set(unitsSphinxDocs "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/iec80000/transfer_rate.rst" "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/acceleration.rst" "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/constants.rst" - "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/dimensions.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/energy.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/force.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/length.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/mass.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/momentum.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/speed.rst" + "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/time.rst" "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/natural/units.rst" "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/isq/si_cgs.rst" diff --git a/docs/reference/systems/isq/natural.rst b/docs/reference/systems/isq/natural.rst index f55c1059..5d08f8e5 100644 --- a/docs/reference/systems/isq/natural.rst +++ b/docs/reference/systems/isq/natural.rst @@ -4,6 +4,13 @@ Natural .. toctree:: :maxdepth: 2 - natural/dimensions natural/units natural/constants + natural/acceleration + natural/energy + natural/force + natural/length + natural/mass + natural/momentum + natural/speed + natural/time diff --git a/docs/reference/systems/isq/natural/acceleration.rst b/docs/reference/systems/isq/natural/acceleration.rst new file mode 100644 index 00000000..eb79ef95 --- /dev/null +++ b/docs/reference/systems/isq/natural/acceleration.rst @@ -0,0 +1,4 @@ +Acceleration +============ + +.. doxygenfile:: natural/acceleration.h diff --git a/docs/reference/systems/isq/natural/dimensions.rst b/docs/reference/systems/isq/natural/dimensions.rst deleted file mode 100644 index 073d9431..00000000 --- a/docs/reference/systems/isq/natural/dimensions.rst +++ /dev/null @@ -1,4 +0,0 @@ -Dimensions -========== - -.. doxygenfile:: natural/dimensions.h diff --git a/docs/reference/systems/isq/natural/energy.rst b/docs/reference/systems/isq/natural/energy.rst new file mode 100644 index 00000000..58d84946 --- /dev/null +++ b/docs/reference/systems/isq/natural/energy.rst @@ -0,0 +1,4 @@ +Energy +====== + +.. doxygenfile:: natural/energy.h diff --git a/docs/reference/systems/isq/natural/force.rst b/docs/reference/systems/isq/natural/force.rst new file mode 100644 index 00000000..3f80c2c5 --- /dev/null +++ b/docs/reference/systems/isq/natural/force.rst @@ -0,0 +1,4 @@ +Force +===== + +.. doxygenfile:: natural/force.h diff --git a/docs/reference/systems/isq/natural/length.rst b/docs/reference/systems/isq/natural/length.rst new file mode 100644 index 00000000..3f004be7 --- /dev/null +++ b/docs/reference/systems/isq/natural/length.rst @@ -0,0 +1,4 @@ +Length +====== + +.. doxygenfile:: natural/length.h diff --git a/docs/reference/systems/isq/natural/mass.rst b/docs/reference/systems/isq/natural/mass.rst new file mode 100644 index 00000000..4d60670b --- /dev/null +++ b/docs/reference/systems/isq/natural/mass.rst @@ -0,0 +1,4 @@ +Mass +==== + +.. doxygenfile:: natural/mass.h diff --git a/docs/reference/systems/isq/natural/momentum.rst b/docs/reference/systems/isq/natural/momentum.rst new file mode 100644 index 00000000..db1408a3 --- /dev/null +++ b/docs/reference/systems/isq/natural/momentum.rst @@ -0,0 +1,4 @@ +Momentum +======== + +.. doxygenfile:: natural/momentum.h diff --git a/docs/reference/systems/isq/natural/speed.rst b/docs/reference/systems/isq/natural/speed.rst new file mode 100644 index 00000000..d1025b01 --- /dev/null +++ b/docs/reference/systems/isq/natural/speed.rst @@ -0,0 +1,4 @@ +Speed +===== + +.. doxygenfile:: natural/speed.h diff --git a/docs/reference/systems/isq/natural/time.rst b/docs/reference/systems/isq/natural/time.rst new file mode 100644 index 00000000..4a46dddc --- /dev/null +++ b/docs/reference/systems/isq/natural/time.rst @@ -0,0 +1,4 @@ +Time +==== + +.. doxygenfile:: natural/time.h diff --git a/src/systems/isq-natural/include/units/isq/natural/dimensions.h b/src/systems/isq-natural/include/units/isq/natural/acceleration.h similarity index 52% rename from src/systems/isq-natural/include/units/isq/natural/dimensions.h rename to src/systems/isq-natural/include/units/isq/natural/acceleration.h index 1836543b..735cad68 100644 --- a/src/systems/isq-natural/include/units/isq/natural/dimensions.h +++ b/src/systems/isq-natural/include/units/isq/natural/acceleration.h @@ -22,47 +22,48 @@ #pragma once +#include +#include + // IWYU pragma: begin_exports -#include +#include #include #include +#include +#include // IWYU pragma: end_exports namespace units::isq::natural { -struct dim_length : isq::dim_length {}; -template U, Representation Rep = double> -using length = quantity; - -struct dim_time : isq::dim_time {}; -template U, Representation Rep = double> -using time = quantity; - -struct dim_mass : isq::dim_mass {}; -template U, Representation Rep = double> -using mass = quantity; - -struct dim_speed : isq::dim_speed {}; -template U, Representation Rep = double> -using speed = quantity; - struct dim_acceleration : isq::dim_acceleration {}; + template U, Representation Rep = double> using acceleration = quantity; -struct dim_force : isq::dim_force {}; -template U, Representation Rep = double> -using force = quantity; +#ifdef UNITS_REFERENCES -struct dim_momentum : isq::dim_momentum {}; -template U, Representation Rep = double> -using momentum = quantity; +namespace acceleration_references { -struct dim_energy : isq::dim_energy {}; -template U, Representation Rep = double> -using energy = quantity; +inline constexpr auto GeV = reference{}; -// Typical UDLs will not work here as the same units are reused by many quantities. -// Should we define some strange ones (i.e. _q_mass_GeV)? +} // namespace acceleration_references + +namespace references { + +using namespace acceleration_references; + +} // namespace references + +#endif // UNITS_REFERENCES } // namespace units::isq::natural + +#ifdef UNITS_ALIASES + +namespace units::aliases::isq::natural::inline acceleration { + +template using GeV = units::isq::natural::acceleration; + +} // namespace units::aliases::isq::natural::inline acceleration + +#endif // UNITS_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/constants.h b/src/systems/isq-natural/include/units/isq/natural/constants.h index 4d76aa0e..c570a589 100644 --- a/src/systems/isq-natural/include/units/isq/natural/constants.h +++ b/src/systems/isq-natural/include/units/isq/natural/constants.h @@ -22,7 +22,7 @@ #pragma once -#include +#include namespace units::isq::natural { diff --git a/src/systems/isq-natural/include/units/isq/natural/energy.h b/src/systems/isq-natural/include/units/isq/natural/energy.h new file mode 100644 index 00000000..f5f9db3d --- /dev/null +++ b/src/systems/isq-natural/include/units/isq/natural/energy.h @@ -0,0 +1,69 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +#include +#include + +// IWYU pragma: begin_exports +#include +#include +#include +#include +#include +// IWYU pragma: end_exports + +namespace units::isq::natural { + +struct dim_energy : isq::dim_energy {}; + +template U, Representation Rep = double> +using energy = quantity; + +#ifdef UNITS_REFERENCES + +namespace energy_references { + +inline constexpr auto GeV = reference{}; + +} // namespace energy_references + +namespace references { + +using namespace energy_references; + +} // namespace references + +#endif // UNITS_REFERENCES + +} // namespace units::isq::natural + +#ifdef UNITS_ALIASES + +namespace units::aliases::isq::natural::inline energy { + +template using GeV = units::isq::natural::energy; + +} // namespace units::aliases::isq::natural::inline energy + +#endif // UNITS_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/force.h b/src/systems/isq-natural/include/units/isq/natural/force.h new file mode 100644 index 00000000..f81eae27 --- /dev/null +++ b/src/systems/isq-natural/include/units/isq/natural/force.h @@ -0,0 +1,69 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +#include +#include + +// IWYU pragma: begin_exports +#include +#include +#include +#include +#include +// IWYU pragma: end_exports + +namespace units::isq::natural { + +struct dim_force : isq::dim_force {}; + +template U, Representation Rep = double> +using force = quantity; + +#ifdef UNITS_REFERENCES + +namespace force_references { + +inline constexpr auto GeV2 = reference{}; + +} // namespace force_references + +namespace references { + +using namespace force_references; + +} // namespace references + +#endif // UNITS_REFERENCES + +} // namespace units::isq::natural + +#ifdef UNITS_ALIASES + +namespace units::aliases::isq::natural::inline force { + +template using GeV2 = units::isq::natural::force; + +} // namespace units::aliases::isq::natural::inline force + +#endif // UNITS_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/length.h b/src/systems/isq-natural/include/units/isq/natural/length.h new file mode 100644 index 00000000..832563a1 --- /dev/null +++ b/src/systems/isq-natural/include/units/isq/natural/length.h @@ -0,0 +1,66 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +// IWYU pragma: begin_exports +#include +#include +#include +#include +#include +// IWYU pragma: end_exports + +namespace units::isq::natural { + +struct dim_length : isq::dim_length {}; + +template U, Representation Rep = double> +using length = quantity; + +#ifdef UNITS_REFERENCES + +namespace length_references { + +inline constexpr auto inv_GeV = reference{}; + +} // namespace length_references + +namespace references { + +using namespace length_references; + +} // namespace references + +#endif // UNITS_REFERENCES + +} // namespace units::isq::natural + +#ifdef UNITS_ALIASES + +namespace units::aliases::isq::natural::inline length { + +template using inv_GeV = units::isq::natural::length; + +} // namespace units::aliases::isq::natural::inline length + +#endif // UNITS_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/mass.h b/src/systems/isq-natural/include/units/isq/natural/mass.h new file mode 100644 index 00000000..7efca445 --- /dev/null +++ b/src/systems/isq-natural/include/units/isq/natural/mass.h @@ -0,0 +1,66 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +// IWYU pragma: begin_exports +#include +#include +#include +#include +#include +// IWYU pragma: end_exports + +namespace units::isq::natural { + +struct dim_mass : isq::dim_mass {}; + +template U, Representation Rep = double> +using mass = quantity; + +#ifdef UNITS_REFERENCES + +namespace mass_references { + +inline constexpr auto GeV = reference{}; + +} // namespace mass_references + +namespace references { + +using namespace mass_references; + +} // namespace references + +#endif // UNITS_REFERENCES + +} // namespace units::isq::natural + +#ifdef UNITS_ALIASES + +namespace units::aliases::isq::natural::inline mass { + +template using GeV = units::isq::natural::mass; + +} // namespace units::aliases::isq::natural::inline mass + +#endif // UNITS_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/momentum.h b/src/systems/isq-natural/include/units/isq/natural/momentum.h new file mode 100644 index 00000000..bf29cf58 --- /dev/null +++ b/src/systems/isq-natural/include/units/isq/natural/momentum.h @@ -0,0 +1,69 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +#include +#include + +// IWYU pragma: begin_exports +#include +#include +#include +#include +#include +// IWYU pragma: end_exports + +namespace units::isq::natural { + +struct dim_momentum : isq::dim_momentum {}; + +template U, Representation Rep = double> +using momentum = quantity; + +#ifdef UNITS_REFERENCES + +namespace momentum_references { + +inline constexpr auto GeV = reference{}; + +} // namespace momentum_references + +namespace references { + +using namespace momentum_references; + +} // namespace references + +#endif // UNITS_REFERENCES + +} // namespace units::isq::natural + +#ifdef UNITS_ALIASES + +namespace units::aliases::isq::natural::inline momentum { + +template using GeV = units::isq::natural::momentum; + +} // namespace units::aliases::isq::natural::inline momentum + +#endif // UNITS_ALIASES diff --git a/src/systems/isq-natural/include/units/isq/natural/natural.h b/src/systems/isq-natural/include/units/isq/natural/natural.h index d4e99c24..b9495b1e 100644 --- a/src/systems/isq-natural/include/units/isq/natural/natural.h +++ b/src/systems/isq-natural/include/units/isq/natural/natural.h @@ -23,7 +23,14 @@ #pragma once // IWYU pragma: begin_exports -#include "dimensions.h" -#include "units.h" -#include "constants.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: end_exports diff --git a/src/systems/isq-natural/include/units/isq/natural/speed.h b/src/systems/isq-natural/include/units/isq/natural/speed.h new file mode 100644 index 00000000..29f388cc --- /dev/null +++ b/src/systems/isq-natural/include/units/isq/natural/speed.h @@ -0,0 +1,44 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +#include +#include + +// IWYU pragma: begin_exports +#include +#include +#include +#include +#include +#include +// IWYU pragma: end_exports + +namespace units::isq::natural { + +struct dim_speed : isq::dim_speed {}; + +template U, Representation Rep = double> +using speed = quantity; + +} // namespace units::isq::natural diff --git a/src/systems/isq-natural/include/units/isq/natural/time.h b/src/systems/isq-natural/include/units/isq/natural/time.h new file mode 100644 index 00000000..8c98870d --- /dev/null +++ b/src/systems/isq-natural/include/units/isq/natural/time.h @@ -0,0 +1,66 @@ +// The MIT License (MIT) +// +// Copyright (c) 2018 Mateusz Pusz +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#pragma once + +// IWYU pragma: begin_exports +#include +#include +#include +#include +#include +// IWYU pragma: end_exports + +namespace units::isq::natural { + +struct dim_time : isq::dim_time {}; + +template U, Representation Rep = double> +using time = quantity; + +#ifdef UNITS_REFERENCES + +namespace time_references { + +inline constexpr auto inv_GeV = reference{}; + +} // namespace time_references + +namespace references { + +using namespace time_references; + +} // namespace references + +#endif // UNITS_REFERENCES + +} // namespace units::isq::natural + +#ifdef UNITS_ALIASES + +namespace units::aliases::isq::natural::inline time { + +template using inv_GeV = units::isq::natural::time; + +} // namespace units::aliases::isq::natural::inline time + +#endif // UNITS_ALIASES