diff --git a/src/include/units/physical/natural/constants.h b/src/include/units/physical/natural/constants.h new file mode 100644 index 00000000..4de79f28 --- /dev/null +++ b/src/include/units/physical/natural/constants.h @@ -0,0 +1,31 @@ +// 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 + +namespace units::natural { + +inline constexpr auto speed_of_light = velocity(1); + +} // namespace units::natural diff --git a/src/include/units/physical/natural/dimensions.h b/src/include/units/physical/natural/dimensions.h new file mode 100644 index 00000000..bd570a61 --- /dev/null +++ b/src/include/units/physical/natural/dimensions.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 + +#include +#include +#include + +namespace units::natural { + +struct dim_length : physical::dim_length {}; +template +using length = quantity; + +struct dim_time : physical::dim_time {}; +template +using time = quantity; + +struct dim_mass : physical::dim_mass {}; +template +using mass = quantity; + +struct dim_velocity : physical::dim_velocity {}; +template +using velocity = quantity; + +struct dim_acceleration : physical::dim_acceleration {}; +template +using acceleration = quantity; + +struct dim_force : physical::dim_force {}; +template +using force = quantity; + +struct dim_momentum : physical::dim_momentum {}; +template +using momentum = quantity; + +struct dim_energy : physical::dim_energy {}; +template +using energy = quantity; + +// 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 units::natural diff --git a/src/include/units/physical/natural/units.h b/src/include/units/physical/natural/units.h new file mode 100644 index 00000000..b1454756 --- /dev/null +++ b/src/include/units/physical/natural/units.h @@ -0,0 +1,41 @@ +// 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 + +namespace units::natural { + +struct unitless : named_unit {}; +struct electronvolt : named_unit {}; +struct gigaelectronvolt : prefixed_unit {}; +struct inverted_gigaelectronvolt : named_unit {}; +struct square_gigaelectronvolt : named_unit {}; + +// NOTE: eV as a base unit with no relation to joule prevents us from going back +// from natural units to SI. Do we need such a support or should we treat +// natural units as an isolated island with ev = 1 which simplifies all +// the maths a lot? + +} // namespace units::natural