refactor: physical replaced with isq

Refers to #249
This commit is contained in:
Mateusz Pusz
2021-03-16 12:03:25 +01:00
parent f3bcdc4ad2
commit bbbb77286c
304 changed files with 1354 additions and 1354 deletions
+70
View File
@@ -0,0 +1,70 @@
// 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 <units/isq/dimensions/absorbed_dose.h>
#include <units/isq/dimensions/acceleration.h>
#include <units/isq/dimensions/amount_of_substance.h>
#include <units/isq/dimensions/angular_velocity.h>
#include <units/isq/dimensions/area.h>
#include <units/isq/dimensions/capacitance.h>
#include <units/isq/dimensions/catalytic_activity.h>
#include <units/isq/dimensions/charge_density.h>
#include <units/isq/dimensions/concentration.h>
#include <units/isq/dimensions/conductance.h>
#include <units/isq/dimensions/current_density.h>
#include <units/isq/dimensions/density.h>
#include <units/isq/dimensions/dynamic_viscosity.h>
#include <units/isq/dimensions/electric_charge.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/dimensions/electric_field_strength.h>
#include <units/isq/dimensions/energy.h>
// TODO Add when downcasting issue is solved (collides with pressure)
// #include <units/isq/dimensions/energy_density.h>
#include <units/isq/dimensions/force.h>
#include <units/isq/dimensions/frequency.h>
#include <units/isq/dimensions/heat_capacity.h>
#include <units/isq/dimensions/inductance.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/luminance.h>
#include <units/isq/dimensions/luminous_intensity.h>
#include <units/isq/dimensions/magnetic_flux.h>
#include <units/isq/dimensions/magnetic_induction.h>
#include <units/isq/dimensions/mass.h>
#include <units/isq/dimensions/molar_energy.h>
#include <units/isq/dimensions/momentum.h>
#include <units/isq/dimensions/permeability.h>
#include <units/isq/dimensions/permittivity.h>
#include <units/isq/dimensions/power.h>
#include <units/isq/dimensions/pressure.h>
// TODO Add when downcasting issue is solved (collides with frequency)
// #include <units/isq/dimensions/radioactivity.h>
#include <units/isq/dimensions/resistance.h>
#include <units/isq/dimensions/speed.h>
#include <units/isq/dimensions/surface_tension.h>
#include <units/isq/dimensions/thermal_conductivity.h>
#include <units/isq/dimensions/thermodynamic_temperature.h>
#include <units/isq/dimensions/time.h>
#include <units/isq/dimensions/torque.h>
#include <units/isq/dimensions/voltage.h>
#include <units/isq/dimensions/volume.h>
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/energy.h>
#include <units/isq/dimensions/mass.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_mass> M>
struct dim_absorbed_dose : derived_dimension<Child, U, exponent<E, 1>, exponent<M, -1>> {};
template<typename T>
concept AbsorbedDose = QuantityOfT<T, dim_absorbed_dose>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_length> L, DimensionOfT<dim_time> T>
struct dim_acceleration : derived_dimension<Child, U, exponent<L, 1>, exponent<T, -2>> {};
template<typename T>
concept Acceleration = QuantityOfT<T, dim_acceleration>;
} // namespace units::isq
@@ -0,0 +1,35 @@
// 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 <units/concepts.h>
namespace units::isq {
template<Unit U>
struct dim_amount_of_substance : base_dimension<"N", U> {};
template<typename T>
concept AmountOfSubstance = QuantityOfT<T, dim_amount_of_substance>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/generic/angle.h>
#include <units/concepts.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_angle> A, DimensionOfT<dim_time> T>
struct dim_angular_velocity : derived_dimension<Child, U, exponent<A, 1>, exponent<T, -1>> {};
template <typename T>
concept AngularVelocity = QuantityOfT<T, dim_angular_velocity>;
} // namespace units::isq
+36
View File
@@ -0,0 +1,36 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_length> L>
struct dim_area : derived_dimension<Child, U, exponent<L, 2>> {};
template<typename T>
concept Area = QuantityOfT<T, dim_area>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/electric_charge.h>
#include <units/isq/dimensions/voltage.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_electric_charge> C, DimensionOfT<dim_voltage> V>
struct dim_capacitance : derived_dimension<Child, U, exponent<C, 1>, exponent<V, -1>> {};
template<typename T>
concept Capacitance = QuantityOfT<T, dim_capacitance>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/isq/dimensions/amount_of_substance.h>
#include <units/concepts.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_time> T, DimensionOfT<dim_amount_of_substance> M>
struct dim_catalytic_activity : derived_dimension<Child, U, exponent<T, -1>, exponent<M, 1>> {};
template<typename T>
concept CatalyticActivity = QuantityOfT<T, dim_catalytic_activity>;
} // namespace units::isq
@@ -0,0 +1,43 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/electric_charge.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_electric_charge> Q, DimensionOfT<dim_length> L>
struct dim_charge_density : derived_dimension<Child, U, exponent<Q, 1>, exponent<L, -3>> {};
template<typename Child, Unit U, DimensionOfT<dim_electric_charge> Q, DimensionOfT<dim_length> L>
struct dim_surface_charge_density : derived_dimension<Child, U, exponent<Q, 1>, exponent<L, -2>> {};
template<typename T>
concept ChargeDensity = QuantityOfT<T, dim_charge_density>;
template<typename T>
concept SurfaceChargeDensity = QuantityOfT<T, dim_surface_charge_density>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/amount_of_substance.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_amount_of_substance> M, DimensionOfT<dim_length> L>
struct dim_concentration : derived_dimension<Child, U, exponent<M, 1>, exponent<L, -3>> {};
template<typename T>
concept Concentration = QuantityOfT<T, dim_concentration>;
} // namespace units::isq
@@ -0,0 +1,36 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/resistance.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_resistance> R>
struct dim_conductance : derived_dimension<Child, U, exponent<R, -1>> {};
template<typename T>
concept Conductance = QuantityOfT<T, dim_conductance>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_electric_current> I, DimensionOfT<dim_length> L>
struct dim_current_density : derived_dimension<Child, U, exponent<I, 1>, exponent<L, -2>> {};
template<typename T>
concept CurrentDensity = QuantityOfT<T, dim_current_density>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/mass.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_mass> M, DimensionOfT<dim_length> L>
struct dim_density : derived_dimension<Child, U, exponent<M, 1>, exponent<L, -3>> {};
template<typename T>
concept Density = QuantityOfT<T, dim_density>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/pressure.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_pressure> P, DimensionOfT<dim_time> T>
struct dim_dynamic_viscosity : derived_dimension<Child, U, exponent<P, 1>, exponent<T, 1>> {};
template<typename T>
concept DynamicViscosity = QuantityOfT<T, dim_dynamic_viscosity>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_time> T, DimensionOfT<dim_electric_current> C>
struct dim_electric_charge : derived_dimension<Child, U, exponent<T, 1>, exponent<C, 1>> {};
template<typename T>
concept ElectricCharge = QuantityOfT<T, dim_electric_charge>;
} // namespace units::isq
@@ -0,0 +1,35 @@
// 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 <units/concepts.h>
namespace units::isq {
template<Unit U>
struct dim_electric_current : base_dimension<"I", U> {};
template<typename T>
concept ElectricCurrent = QuantityOfT<T, dim_electric_current>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/voltage.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_voltage> V, DimensionOfT<dim_length> L>
struct dim_electric_field_strength : derived_dimension<Child, U, exponent<V, 1>, exponent<L, -1>> {};
template<typename T>
concept ElectricFieldStrength = QuantityOfT<T, dim_electric_field_strength>;
} // namespace units::isq
+37
View File
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/force.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_length> L>
struct dim_energy : derived_dimension<Child, U, exponent<F, 1>, exponent<L, 1>> {};
template<typename T>
concept Energy = QuantityOfT<T, dim_energy>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/energy.h>
#include <units/isq/dimensions/volume.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_volume> V>
struct dim_energy_density : derived_dimension<Child, U, exponent<E, 1>, exponent<V, -1>> {};
template<typename T>
concept EnergyDensity = QuantityOfT<T, dim_energy_density>;
} // namespace units::isq
+37
View File
@@ -0,0 +1,37 @@
// 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 <units/isq/dimensions/acceleration.h>
#include <units/concepts.h>
#include <units/isq/dimensions/mass.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_mass> M, DimensionOfT<dim_acceleration> A>
struct dim_force : derived_dimension<Child, U, exponent<M, 1>, exponent<A, 1>> {};
template<typename T>
concept Force = QuantityOfT<T, dim_force>;
} // namespace units::isq
@@ -0,0 +1,36 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_time> T>
struct dim_frequency : derived_dimension<Child, U, exponent<T, -1>> {};
template<typename T>
concept Frequency = QuantityOfT<T, dim_frequency>;
} // namespace units::isq
@@ -0,0 +1,51 @@
// 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 <units/isq/dimensions/amount_of_substance.h>
#include <units/concepts.h>
#include <units/isq/dimensions/energy.h>
#include <units/isq/dimensions/mass.h>
#include <units/isq/dimensions/thermodynamic_temperature.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_thermodynamic_temperature> T>
struct dim_heat_capacity : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOfT<dim_heat_capacity> C, DimensionOfT<dim_mass> M>
struct dim_specific_heat_capacity : derived_dimension<Child, U, exponent<C, 1>, exponent<M, -1>> {};
template<typename Child, Unit U, DimensionOfT<dim_heat_capacity> C, DimensionOfT<dim_amount_of_substance> M>
struct dim_molar_heat_capacity : derived_dimension<Child, U, exponent<C, 1>, exponent<M, -1>> {};
template<typename T>
concept HeatCapacity = QuantityOfT<T, dim_heat_capacity>;
template<typename T>
concept SpecificHeatCapacity = QuantityOfT<T, dim_specific_heat_capacity>;
template<typename T>
concept MolarHeatCapacity = QuantityOfT<T, dim_molar_heat_capacity>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/dimensions/magnetic_flux.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_magnetic_flux> F, DimensionOfT<dim_electric_current> I>
struct dim_inductance : derived_dimension<Child, U, exponent<F, 1>, exponent<I, -1>> {};
template<typename T>
concept Inductance = QuantityOfT<T, dim_inductance>;
} // namespace units::isq
+35
View File
@@ -0,0 +1,35 @@
// 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 <units/concepts.h>
namespace units::isq {
template<Unit U>
struct dim_length : base_dimension<"L", U> {};
template<typename T>
concept Length = QuantityOfT<T, dim_length>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/luminous_intensity.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_luminous_intensity> I, DimensionOfT<dim_length> L>
struct dim_luminance : derived_dimension<Child, U, exponent<I, 1>, exponent<L, -2>> {};
template<typename T>
concept Luminance = QuantityOfT<T, dim_luminance>;
} // namespace units::isq
@@ -0,0 +1,35 @@
// 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 <units/concepts.h>
namespace units::isq {
template<Unit U>
struct dim_luminous_intensity : base_dimension<"J", U> {};
template<typename T>
concept LuminousIntensity = QuantityOfT<T, dim_luminous_intensity>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/isq/dimensions/area.h>
#include <units/concepts.h>
#include <units/isq/dimensions/magnetic_induction.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_magnetic_induction> B, DimensionOfT<dim_area> A>
struct dim_magnetic_flux : derived_dimension<Child, U, exponent<B, 1>, exponent<A, 1>> {};
template<typename T>
concept MagneticFlux = QuantityOfT<T, dim_magnetic_flux>;
} // namespace units::isq
@@ -0,0 +1,38 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/time.h>
#include <units/isq/dimensions/voltage.h>
namespace units::isq {
template <typename Child, Unit U, DimensionOfT<dim_voltage> V, DimensionOfT<dim_time> T, DimensionOfT<dim_length> L>
struct dim_magnetic_induction : derived_dimension<Child, U, exponent<V, 1>, exponent<T, 1>, exponent<L, -2>> {};
template<typename T>
concept MagneticInduction = QuantityOfT<T, dim_magnetic_induction>;
} // namespace units::isq
+35
View File
@@ -0,0 +1,35 @@
// 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 <units/concepts.h>
namespace units::isq {
template<Unit U>
struct dim_mass : base_dimension<"M", U> {};
template<typename T>
concept Mass = QuantityOfT<T, dim_mass>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/isq/dimensions/amount_of_substance.h>
#include <units/concepts.h>
#include <units/isq/dimensions/energy.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_amount_of_substance> M>
struct dim_molar_energy : derived_dimension<Child, U, exponent<E, 1>, exponent<M, -1>> {};
template<typename T>
concept MolarEnergy = QuantityOfT<T, dim_molar_energy>;
} // namespace units::isq
@@ -0,0 +1,36 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/speed.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_mass> M, DimensionOfT<dim_speed> V>
struct dim_momentum : derived_dimension<Child, U, exponent<M, 1>, exponent<V, 1>> {};
template<typename T>
concept Momentum = QuantityOfT<T, dim_momentum>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/inductance.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_inductance> H, DimensionOfT<dim_length> L>
struct dim_permeability : derived_dimension<Child, U, exponent<H, 1>, exponent<L, -1>> {};
template<typename T>
concept Permeability = QuantityOfT<T, dim_permeability>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/isq/dimensions/capacitance.h>
#include <units/concepts.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_capacitance> C, DimensionOfT<dim_length> L>
struct dim_permittivity : derived_dimension<Child, U, exponent<C, 1>, exponent<L, -1>> {};
template<typename T>
concept Permittivity = QuantityOfT<T, dim_permittivity>;
} // namespace units::isq
+37
View File
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/energy.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_time> T>
struct dim_power : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
template<typename T>
concept Power = QuantityOfT<T, dim_power>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/isq/dimensions/area.h>
#include <units/concepts.h>
#include <units/isq/dimensions/force.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_area> A>
struct dim_pressure : derived_dimension<Child, U, exponent<F, 1>, exponent<A, -1>> {};
template<typename T>
concept Pressure = QuantityOfT<T, dim_pressure>;
} // namespace units::isq
@@ -0,0 +1,36 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_time> T>
struct dim_radioactivity : derived_dimension<Child, U, exponent<T, -1>> {};
template<typename T>
concept Radioactivity = QuantityOfT<T, dim_radioactivity>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/dimensions/voltage.h>
namespace units::isq {
template <typename Child, Unit U, DimensionOfT<dim_voltage> V, DimensionOfT<dim_electric_current> C>
struct dim_resistance : derived_dimension<Child,U, exponent<V, 1>, exponent<C, -1>> {};
template<typename T>
concept Resistance = QuantityOfT<T, dim_resistance>;
} // namespace units::isq
+37
View File
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/time.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_length> L, DimensionOfT<dim_time> T>
struct dim_speed : derived_dimension<Child, U, exponent<L, 1>, exponent<T, -1>> {};
template<typename T>
concept Speed = QuantityOfT<T, dim_speed>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/force.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_length> L>
struct dim_surface_tension : derived_dimension<Child, U, exponent<F, 1>, exponent<L, -1>> {};
template<typename T>
concept SurfaceTension = QuantityOfT<T, dim_surface_tension>;
} // namespace units::isq
@@ -0,0 +1,38 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/dimensions/power.h>
#include <units/isq/dimensions/thermodynamic_temperature.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_power> P, DimensionOfT<dim_length> L, DimensionOfT<dim_thermodynamic_temperature> T>
struct dim_thermal_conductivity : derived_dimension<Child, U, exponent<P, 1>, exponent<L, -1>, exponent<T, -1>> {};
template<typename T>
concept ThermalConductivity = QuantityOfT<T, dim_thermal_conductivity>;
} // namespace units::isq
@@ -0,0 +1,35 @@
// 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 <units/concepts.h>
namespace units::isq {
template<Unit U>
struct dim_thermodynamic_temperature : base_dimension<"Θ", U> {};
template<typename T>
concept ThermodynamicTemperature = QuantityOfT<T, dim_thermodynamic_temperature>;
} // namespace units::isq
+35
View File
@@ -0,0 +1,35 @@
// 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 <units/concepts.h>
namespace units::isq {
template<Unit U>
struct dim_time : base_dimension<"T", U> {};
template<typename T>
concept Time = QuantityOfT<T, dim_time>;
} // namespace units::isq
+37
View File
@@ -0,0 +1,37 @@
// 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 <units/generic/angle.h>
#include <units/concepts.h>
#include <units/isq/dimensions/energy.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_length> L, DimensionOfT<dim_angle> A>
struct dim_torque : derived_dimension<Child, U, exponent<F, 1>, exponent<L, 1>, exponent<A, -1>> {};
template<typename T>
concept Torque = QuantityOfT<T, dim_torque>;
} // namespace units::isq
@@ -0,0 +1,37 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/dimensions/power.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_power> P, DimensionOfT<dim_electric_current> C>
struct dim_voltage : derived_dimension<Child, U, exponent<P, 1>, exponent<C, -1>> {};
template<typename T>
concept Voltage = QuantityOfT<T, dim_voltage>;
} // namespace units::isq
+36
View File
@@ -0,0 +1,36 @@
// 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 <units/concepts.h>
#include <units/isq/dimensions/length.h>
namespace units::isq {
template<typename Child, Unit U, DimensionOfT<dim_length> L>
struct dim_volume : derived_dimension<Child, U, exponent<L, 3>> {};
template<typename T>
concept Volume = QuantityOfT<T, dim_volume>;
} // namespace units::isq
@@ -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 <units/isq/dimensions.h>
#include <units/isq/natural/bits/units.h>
#include <units/quantity.h>
namespace units::isq::natural {
struct dim_length : isq::dim_length<inverted_gigaelectronvolt> {};
template<UnitOf<dim_length> U, QuantityValue Rep = double>
using length = quantity<dim_length, U, Rep>;
struct dim_time : isq::dim_time<inverted_gigaelectronvolt> {};
template<UnitOf<dim_time> U, QuantityValue Rep = double>
using time = quantity<dim_time, U, Rep>;
struct dim_mass : isq::dim_mass<gigaelectronvolt> {};
template<UnitOf<dim_mass> U, QuantityValue Rep = double>
using mass = quantity<dim_mass, U, Rep>;
struct dim_speed : isq::dim_speed<dim_speed, one, dim_length, dim_time> {};
template<UnitOf<dim_speed> U, QuantityValue Rep = double>
using speed = quantity<dim_speed, U, Rep>;
struct dim_acceleration : isq::dim_acceleration<dim_acceleration, gigaelectronvolt, dim_length, dim_time> {};
template<UnitOf<dim_acceleration> U, QuantityValue Rep = double>
using acceleration = quantity<dim_acceleration, U, Rep>;
struct dim_force : isq::dim_force<dim_force, square_gigaelectronvolt, dim_mass, dim_acceleration> {};
template<UnitOf<dim_force> U, QuantityValue Rep = double>
using force = quantity<dim_force, U, Rep>;
struct dim_momentum : isq::dim_momentum<dim_momentum, gigaelectronvolt, dim_mass, dim_speed> {};
template<UnitOf<dim_momentum> U, QuantityValue Rep = double>
using momentum = quantity<dim_momentum, U, Rep>;
struct dim_energy : isq::dim_energy<dim_energy, gigaelectronvolt, dim_force, dim_length> {};
template<UnitOf<dim_force> U, QuantityValue Rep = double>
using energy = quantity<dim_force, U, Rep>;
// 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::isq::natural
@@ -0,0 +1,40 @@
// 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 <units/unit.h>
#include <units/isq/si/prefixes.h>
namespace units::isq::natural {
struct electronvolt : named_unit<electronvolt, "eV", si::prefix> {};
struct gigaelectronvolt : prefixed_unit<gigaelectronvolt, si::giga, electronvolt> {};
struct inverted_gigaelectronvolt : named_unit<inverted_gigaelectronvolt, basic_symbol_text{"GeV⁻¹", "GeV^-1"}, no_prefix> {};
struct square_gigaelectronvolt : named_unit<square_gigaelectronvolt, basic_symbol_text{"GeV²", "GeV^2"}, no_prefix> {};
// 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::isq::natural
+32
View File
@@ -0,0 +1,32 @@
// 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 <units/isq/natural/bits/dimensions.h>
namespace units::isq::natural {
template<QuantityValue Rep = double>
inline constexpr auto speed_of_light = speed<one, Rep>(1);
} // namespace units::isq::natural
+30
View File
@@ -0,0 +1,30 @@
// 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
#define MP_UNITS_SYSTEM_NATURAL
#include "bits/dimensions.h"
#include "bits/units.h"
#include "constants.h"
+173
View File
@@ -0,0 +1,173 @@
// 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 <units/isq/dimensions/absorbed_dose.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct gray : named_unit<gray, "Gy", prefix> {};
struct yoctogray : prefixed_unit<yoctogray, yocto, gray> {};
struct zeptogray : prefixed_unit<zeptogray, zepto, gray> {};
struct attogray : prefixed_unit<attogray, atto, gray> {};
struct femtogray : prefixed_unit<femtogray, femto, gray> {};
struct picogray : prefixed_unit<picogray, pico, gray> {};
struct nanogray : prefixed_unit<nanogray, nano, gray> {};
struct microgray : prefixed_unit<microgray, micro, gray> {};
struct milligray : prefixed_unit<milligray, milli, gray> {};
struct centigray : prefixed_unit<centigray, centi, gray> {};
struct decigray : prefixed_unit<decigray, deci, gray> {};
struct decagray : prefixed_unit<decagray, deca, gray> {};
struct hectogray : prefixed_unit<hectogray, hecto, gray> {};
struct kilogray : prefixed_unit<kilogray, kilo, gray> {};
struct megagray : prefixed_unit<megagray, mega, gray> {};
struct gigagray : prefixed_unit<gigagray, giga, gray> {};
struct teragray : prefixed_unit<teragray, tera, gray> {};
struct petagray : prefixed_unit<petagray, peta, gray> {};
struct exagray : prefixed_unit<exagray, exa, gray> {};
struct zettagray : prefixed_unit<zettagray, zetta, gray> {};
struct yottagray : prefixed_unit<yottagray, yotta, gray> {};
struct dim_absorbed_dose : isq::dim_absorbed_dose<dim_absorbed_dose, gray, dim_energy, dim_mass> {};
template<UnitOf<dim_absorbed_dose> U, QuantityValue Rep = double>
using absorbed_dose = quantity<dim_absorbed_dose, U, Rep>;
inline namespace literals {
// Gy
constexpr auto operator"" _q_Gy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<gray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gy(long double l) { return absorbed_dose<gray, long double>(l); }
// yGy
constexpr auto operator"" _q_yGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<yoctogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yGy(long double l) { return absorbed_dose<yoctogray, long double>(l); }
// zGy
constexpr auto operator"" _q_zGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<zeptogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zGy(long double l) { return absorbed_dose<zeptogray, long double>(l); }
// aGy
constexpr auto operator"" _q_aGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<attogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aGy(long double l) { return absorbed_dose<attogray, long double>(l); }
// fGy
constexpr auto operator"" _q_fGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<femtogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fGy(long double l) { return absorbed_dose<femtogray, long double>(l); }
// pGy
constexpr auto operator"" _q_pGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<picogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pGy(long double l) { return absorbed_dose<picogray, long double>(l); }
// nGy
constexpr auto operator"" _q_nGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<nanogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nGy(long double l) { return absorbed_dose<nanogray, long double>(l); }
// uGy
constexpr auto operator"" _q_uGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<microgray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uGy(long double l) { return absorbed_dose<microgray, long double>(l); }
// mGy
constexpr auto operator"" _q_mGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<milligray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mGy(long double l) { return absorbed_dose<milligray, long double>(l); }
// cGy
constexpr auto operator"" _q_cGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<centigray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cGy(long double l) { return absorbed_dose<centigray, long double>(l); }
// dGy
constexpr auto operator"" _q_dGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<decigray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dGy(long double l) { return absorbed_dose<decigray, long double>(l); }
// daGy
constexpr auto operator"" _q_daGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<decagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daGy(long double l) { return absorbed_dose<decagray, long double>(l); }
// hGy
constexpr auto operator"" _q_hGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<hectogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hGy(long double l) { return absorbed_dose<hectogray, long double>(l); }
// kGy
constexpr auto operator"" _q_kGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<kilogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kGy(long double l) { return absorbed_dose<kilogray, long double>(l); }
// MGy
constexpr auto operator"" _q_MGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<megagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MGy(long double l) { return absorbed_dose<megagray, long double>(l); }
// GGy
constexpr auto operator"" _q_GGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<gigagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GGy(long double l) { return absorbed_dose<gigagray, long double>(l); }
// TGy
constexpr auto operator"" _q_TGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<teragray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TGy(long double l) { return absorbed_dose<teragray, long double>(l); }
// PGy
constexpr auto operator"" _q_PGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<petagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PGy(long double l) { return absorbed_dose<petagray, long double>(l); }
// EGy
constexpr auto operator"" _q_EGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<exagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EGy(long double l) { return absorbed_dose<exagray, long double>(l); }
// ZGy
constexpr auto operator"" _q_ZGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<zettagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZGy(long double l) { return absorbed_dose<zettagray, long double>(l); }
// YGy
constexpr auto operator"" _q_YGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<yottagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YGy(long double l) { return absorbed_dose<yottagray, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto Gy = absorbed_dose<gray, one_rep>{};
inline constexpr auto yGy = absorbed_dose<yoctogray, one_rep>{};
inline constexpr auto zGy = absorbed_dose<zeptogray, one_rep>{};
inline constexpr auto aGy = absorbed_dose<attogray, one_rep>{};
inline constexpr auto fGy = absorbed_dose<femtogray, one_rep>{};
inline constexpr auto pGy = absorbed_dose<picogray, one_rep>{};
inline constexpr auto nGy = absorbed_dose<nanogray, one_rep>{};
inline constexpr auto uGy = absorbed_dose<microgray, one_rep>{};
inline constexpr auto mGy = absorbed_dose<milligray, one_rep>{};
inline constexpr auto cGy = absorbed_dose<centigray, one_rep>{};
inline constexpr auto dGy = absorbed_dose<decigray, one_rep>{};
inline constexpr auto daGy = absorbed_dose<decagray, one_rep>{};
inline constexpr auto hGy = absorbed_dose<hectogray, one_rep>{};
inline constexpr auto kGy = absorbed_dose<kilogray, one_rep>{};
inline constexpr auto MGy = absorbed_dose<megagray, one_rep>{};
inline constexpr auto GGy = absorbed_dose<gigagray, one_rep>{};
inline constexpr auto TGy = absorbed_dose<teragray, one_rep>{};
inline constexpr auto PGy = absorbed_dose<petagray, one_rep>{};
inline constexpr auto EGy = absorbed_dose<exagray, one_rep>{};
inline constexpr auto ZGy = absorbed_dose<zettagray, one_rep>{};
inline constexpr auto YGy = absorbed_dose<yottagray, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
+45
View File
@@ -0,0 +1,45 @@
// 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 <units/isq/dimensions/acceleration.h>
#include <units/isq/si/speed.h>
#include <units/quantity.h>
namespace units::isq::si {
struct metre_per_second_sq : unit<metre_per_second_sq> {};
struct dim_acceleration : isq::dim_acceleration<dim_acceleration, metre_per_second_sq, dim_length, dim_time> {};
template<UnitOf<dim_acceleration> U, QuantityValue Rep = double>
using acceleration = quantity<dim_acceleration, U, Rep>;
inline namespace literals {
// m/s2
constexpr auto operator"" _q_m_per_s2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return acceleration<metre_per_second_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_m_per_s2(long double l) { return acceleration<metre_per_second_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,53 @@
// 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 <units/one_rep.h>
#include <units/isq/dimensions/amount_of_substance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct mole : named_unit<mole, "mol", prefix> {};
struct dim_amount_of_substance : isq::dim_amount_of_substance<mole> {};
template<UnitOf<dim_amount_of_substance> U, QuantityValue Rep = double>
using amount_of_substance = quantity<dim_amount_of_substance, U, Rep>;
inline namespace literals {
// mol
constexpr auto operator"" _q_mol(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return amount_of_substance<mole, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mol(long double l) { return amount_of_substance<mole, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto mol = amount_of_substance<mole, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,48 @@
// 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 <units/isq/dimensions/angular_velocity.h>
#include <units/generic/angle.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct radian_per_second : named_unit<radian_per_second, basic_symbol_text{"ω", "w"}, no_prefix> {};
struct dim_angular_velocity : isq::dim_angular_velocity<dim_angular_velocity, radian_per_second, dim_angle<>, dim_time> {};
template<UnitOf<dim_angular_velocity> U, QuantityValue Rep = double>
using angular_velocity = quantity<dim_angular_velocity, U, Rep>;
inline namespace literals {
// rad / s
constexpr auto operator"" _q_rad_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return angular_velocity<radian_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_rad_per_s(long double l) { return angular_velocity<radian_per_second, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+179
View File
@@ -0,0 +1,179 @@
// 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 <units/isq/dimensions/area.h>
#include <units/isq/si/length.h>
#include <units/quantity.h>
namespace units::isq::si {
struct square_metre : unit<square_metre> {};
struct dim_area : isq::dim_area<dim_area, square_metre, dim_length> {};
struct square_yoctometre : deduced_unit<square_yoctometre, dim_area, yoctometre> {};
struct square_zeptometre : deduced_unit<square_zeptometre, dim_area, zeptometre> {};
struct square_attometre : deduced_unit<square_attometre, dim_area, attometre> {};
struct square_femtometre : deduced_unit<square_femtometre, dim_area, femtometre> {};
struct square_picometre : deduced_unit<square_picometre, dim_area, picometre> {};
struct square_nanometre : deduced_unit<square_nanometre, dim_area, nanometre> {};
struct square_micrometre : deduced_unit<square_micrometre, dim_area, micrometre> {};
struct square_millimetre : deduced_unit<square_millimetre, dim_area, millimetre> {};
struct square_centimetre : deduced_unit<square_centimetre, dim_area, centimetre> {};
struct square_decimetre : deduced_unit<square_decimetre, dim_area, decimetre> {};
struct square_decametre : deduced_unit<square_decametre, dim_area, decametre> {};
struct square_hectometre : deduced_unit<square_hectometre, dim_area, hectometre> {};
struct square_kilometre : deduced_unit<square_kilometre, dim_area, kilometre> {};
struct square_megametre : deduced_unit<square_megametre, dim_area, megametre> {};
struct square_gigametre : deduced_unit<square_gigametre, dim_area, gigametre> {};
struct square_terametre : deduced_unit<square_terametre, dim_area, terametre> {};
struct square_petametre : deduced_unit<square_petametre, dim_area, petametre> {};
struct square_exametre : deduced_unit<square_exametre, dim_area, exametre> {};
struct square_zettametre : deduced_unit<square_zettametre, dim_area, zettametre> {};
struct square_yottametre : deduced_unit<square_yottametre, dim_area, yottametre> {};
struct hectare : alias_unit<square_hectometre, "ha", no_prefix> {};
template<UnitOf<dim_area> U, QuantityValue Rep = double>
using area = quantity<dim_area, U, Rep>;
inline namespace literals {
// m2
constexpr auto operator"" _q_m2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_m2(long double l) { return area<square_metre, long double>(l); }
// ym2
constexpr auto operator"" _q_ym2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_yoctometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ym2(long double l) { return area<square_yoctometre, long double>(l); }
// zm2
constexpr auto operator"" _q_zm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_zeptometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zm2(long double l) { return area<square_zeptometre, long double>(l); }
// am2
constexpr auto operator"" _q_am2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_attometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_am2(long double l) { return area<square_attometre, long double>(l); }
// fm2
constexpr auto operator"" _q_fm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_femtometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fm2(long double l) { return area<square_femtometre, long double>(l); }
// pm2
constexpr auto operator"" _q_pm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_picometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pm2(long double l) { return area<square_picometre, long double>(l); }
// nm2
constexpr auto operator"" _q_nm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_nanometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nm2(long double l) { return area<square_nanometre, long double>(l); }
// um2
constexpr auto operator"" _q_um2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_micrometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_um2(long double l) { return area<square_micrometre, long double>(l); }
// mm2
constexpr auto operator"" _q_mm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_millimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mm2(long double l) { return area<square_millimetre, long double>(l); }
// cm2
constexpr auto operator"" _q_cm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_centimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cm2(long double l) { return area<square_centimetre, long double>(l); }
// dm2
constexpr auto operator"" _q_dm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_decimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dm2(long double l) { return area<square_decimetre, long double>(l); }
// dam2
constexpr auto operator"" _q_dam2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_decametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dam2(long double l) { return area<square_decametre, long double>(l); }
// hm2
constexpr auto operator"" _q_hm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_hectometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hm2(long double l) { return area<square_hectometre, long double>(l); }
// km2
constexpr auto operator"" _q_km2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_kilometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_km2(long double l) { return area<square_kilometre, long double>(l); }
// Mm2
constexpr auto operator"" _q_Mm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_megametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mm2(long double l) { return area<square_megametre, long double>(l); }
// Gm2
constexpr auto operator"" _q_Gm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_gigametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gm2(long double l) { return area<square_gigametre, long double>(l); }
// Tm2
constexpr auto operator"" _q_Tm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_terametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tm2(long double l) { return area<square_terametre, long double>(l); }
// Pm2
constexpr auto operator"" _q_Pm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_petametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pm2(long double l) { return area<square_petametre, long double>(l); }
// Em2
constexpr auto operator"" _q_Em2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_exametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Em2(long double l) { return area<square_exametre, long double>(l); }
// Zm2
constexpr auto operator"" _q_Zm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_zettametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zm2(long double l) { return area<square_zettametre, long double>(l); }
// Ym2
constexpr auto operator"" _q_Ym2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_yottametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ym2(long double l) { return area<square_yottametre, long double>(l); }
// ha
constexpr auto operator"" _q_ha(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<hectare, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ha(long double l) { return area<hectare, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto m2 = area<square_metre, one_rep>{};
inline constexpr auto ym2 = area<square_yoctometre, one_rep>{};
inline constexpr auto zm2 = area<square_zeptometre, one_rep>{};
inline constexpr auto am2 = area<square_attometre, one_rep>{};
inline constexpr auto fm2 = area<square_femtometre, one_rep>{};
inline constexpr auto pm2 = area<square_picometre, one_rep>{};
inline constexpr auto nm2 = area<square_nanometre, one_rep>{};
inline constexpr auto um2 = area<square_micrometre, one_rep>{};
inline constexpr auto mm2 = area<square_millimetre, one_rep>{};
inline constexpr auto cm2 = area<square_centimetre, one_rep>{};
inline constexpr auto dm2 = area<square_decimetre, one_rep>{};
inline constexpr auto dam2 = area<square_decametre, one_rep>{};
inline constexpr auto hm2 = area<square_hectometre, one_rep>{};
inline constexpr auto km2 = area<square_kilometre, one_rep>{};
inline constexpr auto Mm2 = area<square_megametre, one_rep>{};
inline constexpr auto Gm2 = area<square_gigametre, one_rep>{};
inline constexpr auto Tm2 = area<square_terametre, one_rep>{};
inline constexpr auto Pm2 = area<square_petametre, one_rep>{};
inline constexpr auto Em2 = area<square_exametre, one_rep>{};
inline constexpr auto Zm2 = area<square_zettametre, one_rep>{};
inline constexpr auto Ym2 = area<square_yottametre, one_rep>{};
inline constexpr auto ha = area<hectare, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
+174
View File
@@ -0,0 +1,174 @@
// 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 <units/isq/dimensions/capacitance.h>
#include <units/isq/si/electric_charge.h>
#include <units/isq/si/voltage.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct farad : named_unit<farad, "F", prefix> {};
struct yoctofarad : prefixed_unit<yoctofarad, yocto, farad> {};
struct zeptofarad : prefixed_unit<zeptofarad, zepto, farad> {};
struct attofarad : prefixed_unit<attofarad, atto, farad> {};
struct femtofarad : prefixed_unit<femtofarad, femto, farad> {};
struct picofarad : prefixed_unit<picofarad, pico, farad> {};
struct nanofarad : prefixed_unit<nanofarad, nano, farad> {};
struct microfarad : prefixed_unit<microfarad, micro, farad> {};
struct millifarad : prefixed_unit<millifarad, milli, farad> {};
struct centifarad : prefixed_unit<centifarad, centi, farad> {};
struct decifarad : prefixed_unit<decifarad, deci, farad> {};
struct decafarad : prefixed_unit<decafarad, deca, farad> {};
struct hectofarad : prefixed_unit<hectofarad, hecto, farad> {};
struct kilofarad : prefixed_unit<kilofarad, kilo, farad> {};
struct megafarad : prefixed_unit<megafarad, mega, farad> {};
struct gigafarad : prefixed_unit<gigafarad, giga, farad> {};
struct terafarad : prefixed_unit<terafarad, tera, farad> {};
struct petafarad : prefixed_unit<petafarad, peta, farad> {};
struct exafarad : prefixed_unit<exafarad, exa, farad> {};
struct zettafarad : prefixed_unit<zettafarad, zetta, farad> {};
struct yottafarad : prefixed_unit<yottafarad, yotta, farad> {};
struct dim_capacitance : isq::dim_capacitance<dim_capacitance, farad, dim_electric_charge, dim_voltage> {};
template<UnitOf<dim_capacitance> U, QuantityValue Rep = double>
using capacitance = quantity<dim_capacitance, U, Rep>;
inline namespace literals {
// F
constexpr auto operator"" _q_F(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<farad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_F(long double l) { return capacitance<farad, long double>(l); }
// yF
constexpr auto operator"" _q_yF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<yoctofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yF(long double l) { return capacitance<yoctofarad, long double>(l); }
// zF
constexpr auto operator"" _q_zF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<zeptofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zF(long double l) { return capacitance<zeptofarad, long double>(l); }
// aF
constexpr auto operator"" _q_aF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<attofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aF(long double l) { return capacitance<attofarad, long double>(l); }
// fF
constexpr auto operator"" _q_fF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<femtofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fF(long double l) { return capacitance<femtofarad, long double>(l); }
// pF
constexpr auto operator"" _q_pF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<picofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pF(long double l) { return capacitance<picofarad, long double>(l); }
// nF
constexpr auto operator"" _q_nF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<nanofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nF(long double l) { return capacitance<nanofarad, long double>(l); }
// uF
constexpr auto operator"" _q_uF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<microfarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uF(long double l) { return capacitance<microfarad, long double>(l); }
// mF
constexpr auto operator"" _q_mF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<millifarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mF(long double l) { return capacitance<millifarad, long double>(l); }
// cF
constexpr auto operator"" _q_cF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<centifarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cF(long double l) { return capacitance<centifarad, long double>(l); }
// dF
constexpr auto operator"" _q_dF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<decifarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dF(long double l) { return capacitance<decifarad, long double>(l); }
// daF
constexpr auto operator"" _q_daF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<decafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daF(long double l) { return capacitance<decafarad, long double>(l); }
// hF
constexpr auto operator"" _q_hF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<hectofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hF(long double l) { return capacitance<hectofarad, long double>(l); }
// kF
constexpr auto operator"" _q_kF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<kilofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kF(long double l) { return capacitance<kilofarad, long double>(l); }
// MF
constexpr auto operator"" _q_MF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<megafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MF(long double l) { return capacitance<megafarad, long double>(l); }
// GF
constexpr auto operator"" _q_GF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<gigafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GF(long double l) { return capacitance<gigafarad, long double>(l); }
// TF
constexpr auto operator"" _q_TF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<terafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TF(long double l) { return capacitance<terafarad, long double>(l); }
// PF
constexpr auto operator"" _q_PF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<petafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PF(long double l) { return capacitance<petafarad, long double>(l); }
// EF
constexpr auto operator"" _q_EF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<exafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EF(long double l) { return capacitance<exafarad, long double>(l); }
// ZF
constexpr auto operator"" _q_ZF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<zettafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZF(long double l) { return capacitance<zettafarad, long double>(l); }
// YF
constexpr auto operator"" _q_YF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<yottafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YF(long double l) { return capacitance<yottafarad, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto F = capacitance<farad, one_rep>{};
inline constexpr auto yF = capacitance<yoctofarad, one_rep>{};
inline constexpr auto zF = capacitance<zeptofarad, one_rep>{};
inline constexpr auto aF = capacitance<attofarad, one_rep>{};
inline constexpr auto fF = capacitance<femtofarad, one_rep>{};
inline constexpr auto pF = capacitance<picofarad, one_rep>{};
inline constexpr auto nF = capacitance<nanofarad, one_rep>{};
inline constexpr auto uF = capacitance<microfarad, one_rep>{};
inline constexpr auto mF = capacitance<millifarad, one_rep>{};
inline constexpr auto cF = capacitance<centifarad, one_rep>{};
inline constexpr auto dF = capacitance<decifarad, one_rep>{};
inline constexpr auto daF = capacitance<decafarad, one_rep>{};
inline constexpr auto hF = capacitance<hectofarad, one_rep>{};
inline constexpr auto kF = capacitance<kilofarad, one_rep>{};
inline constexpr auto MF = capacitance<megafarad, one_rep>{};
inline constexpr auto GF = capacitance<gigafarad, one_rep>{};
inline constexpr auto TF = capacitance<terafarad, one_rep>{};
inline constexpr auto PF = capacitance<petafarad, one_rep>{};
inline constexpr auto EF = capacitance<exafarad, one_rep>{};
inline constexpr auto ZF = capacitance<zettafarad, one_rep>{};
inline constexpr auto YF = capacitance<yottafarad, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,182 @@
// 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 <units/isq/dimensions/catalytic_activity.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/isq/si/time.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct katal : named_unit<katal, "kat", prefix> {};
struct yoctokatal : prefixed_unit<yoctokatal, yocto, katal> {};
struct zeptokatal : prefixed_unit<zeptokatal, zepto, katal> {};
struct attokatal : prefixed_unit<attokatal, atto, katal> {};
struct femtokatal : prefixed_unit<femtokatal, femto, katal> {};
struct picokatal : prefixed_unit<picokatal, pico, katal> {};
struct nanokatal : prefixed_unit<nanokatal, nano, katal> {};
struct microkatal : prefixed_unit<microkatal, micro, katal> {};
struct millikatal : prefixed_unit<millikatal, milli, katal> {};
struct centikatal : prefixed_unit<centikatal, centi, katal> {};
struct decikatal : prefixed_unit<decikatal, deci, katal> {};
struct decakatal : prefixed_unit<decakatal, deca, katal> {};
struct hectokatal : prefixed_unit<hectokatal, hecto, katal> {};
struct kilokatal : prefixed_unit<kilokatal, kilo, katal> {};
struct megakatal : prefixed_unit<megakatal, mega, katal> {};
struct gigakatal : prefixed_unit<gigakatal, giga, katal> {};
struct terakatal : prefixed_unit<terakatal, tera, katal> {};
struct petakatal : prefixed_unit<petakatal, peta, katal> {};
struct exakatal : prefixed_unit<exakatal, exa, katal> {};
struct zettakatal : prefixed_unit<zettakatal, zetta, katal> {};
struct yottakatal : prefixed_unit<yottakatal, yotta, katal> {};
struct enzyme_unit : named_scaled_unit<enzyme_unit, "U", prefix, ratio(1, 60, -6), katal> {};
struct dim_catalytic_activity : isq::dim_catalytic_activity<dim_catalytic_activity, katal, dim_time, dim_amount_of_substance> {};
template<UnitOf<dim_catalytic_activity> U, QuantityValue Rep = double>
using catalytic_activity = quantity<dim_catalytic_activity, U, Rep>;
inline namespace literals {
// kat
constexpr auto operator"" _q_kat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<katal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kat(long double l) { return catalytic_activity<katal, long double>(l); }
// ykat
constexpr auto operator"" _q_ykat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<yoctokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ykat(long double l) { return catalytic_activity<yoctokatal, long double>(l); }
// zkat
constexpr auto operator"" _q_zkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<zeptokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zkat(long double l) { return catalytic_activity<zeptokatal, long double>(l); }
// akat
constexpr auto operator"" _q_akat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<attokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_akat(long double l) { return catalytic_activity<attokatal, long double>(l); }
// fkat
constexpr auto operator"" _q_fkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<femtokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fkat(long double l) { return catalytic_activity<femtokatal, long double>(l); }
// pkat
constexpr auto operator"" _q_pkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<picokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pkat(long double l) { return catalytic_activity<picokatal, long double>(l); }
// nkat
constexpr auto operator"" _q_nkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<nanokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nkat(long double l) { return catalytic_activity<nanokatal, long double>(l); }
// ukat
constexpr auto operator"" _q_ukat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<microkatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ukat(long double l) { return catalytic_activity<microkatal, long double>(l); }
// mkat
constexpr auto operator"" _q_mkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<millikatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mkat(long double l) { return catalytic_activity<millikatal, long double>(l); }
// ckat
constexpr auto operator"" _q_ckat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<centikatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ckat(long double l) { return catalytic_activity<centikatal, long double>(l); }
// dkat
constexpr auto operator"" _q_dkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<decikatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dkat(long double l) { return catalytic_activity<decikatal, long double>(l); }
// dakat
constexpr auto operator"" _q_dakat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<decakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dakat(long double l) { return catalytic_activity<decakatal, long double>(l); }
// hkat
constexpr auto operator"" _q_hkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<hectokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hkat(long double l) { return catalytic_activity<hectokatal, long double>(l); }
// kkat
constexpr auto operator"" _q_kkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<kilokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kkat(long double l) { return catalytic_activity<kilokatal, long double>(l); }
// Mkat
constexpr auto operator"" _q_Mkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<megakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mkat(long double l) { return catalytic_activity<megakatal, long double>(l); }
// Gkat
constexpr auto operator"" _q_Gkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<gigakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gkat(long double l) { return catalytic_activity<gigakatal, long double>(l); }
// Tkat
constexpr auto operator"" _q_Tkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<terakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tkat(long double l) { return catalytic_activity<terakatal, long double>(l); }
// Pkat
constexpr auto operator"" _q_Pkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<petakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pkat(long double l) { return catalytic_activity<petakatal, long double>(l); }
// Ekat
constexpr auto operator"" _q_Ekat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<exakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ekat(long double l) { return catalytic_activity<exakatal, long double>(l); }
// Zkat
constexpr auto operator"" _q_Zkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<zettakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zkat(long double l) { return catalytic_activity<zettakatal, long double>(l); }
// Ykat
constexpr auto operator"" _q_Ykat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<yottakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ykat(long double l) { return catalytic_activity<yottakatal, long double>(l); }
// U
constexpr auto operator"" _q_U(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<enzyme_unit, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_U(long double l) { return catalytic_activity<enzyme_unit, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto kat = catalytic_activity<katal, one_rep>{};
inline constexpr auto ykat = catalytic_activity<yoctokatal, one_rep>{};
inline constexpr auto zkat = catalytic_activity<zeptokatal, one_rep>{};
inline constexpr auto akat = catalytic_activity<attokatal, one_rep>{};
inline constexpr auto fkat = catalytic_activity<femtokatal, one_rep>{};
inline constexpr auto pkat = catalytic_activity<picokatal, one_rep>{};
inline constexpr auto nkat = catalytic_activity<nanokatal, one_rep>{};
inline constexpr auto ukat = catalytic_activity<microkatal, one_rep>{};
inline constexpr auto mkat = catalytic_activity<millikatal, one_rep>{};
inline constexpr auto ckat = catalytic_activity<centikatal, one_rep>{};
inline constexpr auto dkat = catalytic_activity<decikatal, one_rep>{};
inline constexpr auto dakat = catalytic_activity<decakatal, one_rep>{};
inline constexpr auto hkat = catalytic_activity<hectokatal, one_rep>{};
inline constexpr auto kkat = catalytic_activity<kilokatal, one_rep>{};
inline constexpr auto Mkat = catalytic_activity<megakatal, one_rep>{};
inline constexpr auto Gkat = catalytic_activity<gigakatal, one_rep>{};
inline constexpr auto Tkat = catalytic_activity<terakatal, one_rep>{};
inline constexpr auto Pkat = catalytic_activity<petakatal, one_rep>{};
inline constexpr auto Ekat = catalytic_activity<exakatal, one_rep>{};
inline constexpr auto Zkat = catalytic_activity<zettakatal, one_rep>{};
inline constexpr auto Ykat = catalytic_activity<yottakatal, one_rep>{};
inline constexpr auto U = catalytic_activity<enzyme_unit, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,51 @@
// 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 <units/isq/dimensions/acceleration.h>
#include <units/isq/si/cgs/speed.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
struct gal : named_unit<gal, "Gal", si::prefix> {};
struct dim_acceleration : isq::dim_acceleration<dim_acceleration, gal, dim_length, dim_time> {};
template<UnitOf<dim_acceleration> U, QuantityValue Rep = double>
using acceleration = quantity<dim_acceleration, U, Rep>;
inline namespace literals {
// Gal
constexpr auto operator"" _q_Gal(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return acceleration<gal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gal(long double l) { return acceleration<gal, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto Gal = acceleration<gal, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::cgs
+52
View File
@@ -0,0 +1,52 @@
// 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 <units/isq/si/area.h>
#include <units/isq/si/cgs/length.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
using si::square_centimetre;
struct dim_area : isq::dim_area<dim_area, square_centimetre, dim_length> {};
template<UnitOf<dim_area> U, QuantityValue Rep = double>
using area = quantity<dim_area, U, Rep>;
inline namespace literals {
// cm2
constexpr auto operator"" _q_cm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_centimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cm2(long double l) { return area<square_centimetre, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto cm2 = area<square_centimetre, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::cgs
+35
View File
@@ -0,0 +1,35 @@
// 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 <units/isq/si/cgs/length.h>
#include <units/isq/si/cgs/mass.h>
#include <units/isq/si/cgs/time.h>
#include <units/isq/si/cgs/acceleration.h>
#include <units/isq/si/cgs/area.h>
#include <units/isq/si/cgs/energy.h>
#include <units/isq/si/cgs/force.h>
#include <units/isq/si/cgs/power.h>
#include <units/isq/si/cgs/pressure.h>
#include <units/isq/si/cgs/speed.h>
+53
View File
@@ -0,0 +1,53 @@
// 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 <units/isq/dimensions/energy.h>
#include <units/isq/si/cgs/force.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
struct erg : named_unit<erg, "erg", si::prefix> {};
struct dim_energy : isq::dim_energy<dim_energy, erg, dim_force, dim_length> {};
template<UnitOf<dim_energy> U, QuantityValue Rep = double>
using energy = quantity<dim_energy, U, Rep>;
inline namespace literals {
// erg
constexpr auto operator"" _q_erg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<erg, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_erg(long double l) { return energy<erg, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto erg = energy<cgs::erg, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::cgs
+54
View File
@@ -0,0 +1,54 @@
// 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 <units/isq/dimensions/force.h>
#include <units/isq/si/cgs/acceleration.h>
#include <units/isq/si/cgs/mass.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
struct dyne : named_unit<dyne, "dyn", si::prefix> {};
struct dim_force : isq::dim_force<dim_force, dyne, dim_mass, dim_acceleration> {};
template<UnitOf<dim_force> U, QuantityValue Rep = double>
using force = quantity<dim_force, U, Rep>;
inline namespace literals {
// dyn
constexpr auto operator"" _q_dyn(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<dyne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dyn(long double l) { return force<dyne, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto dyn = force<dyne, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::cgs
+51
View File
@@ -0,0 +1,51 @@
// 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 <units/isq/si/length.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
using si::centimetre;
struct dim_length : isq::dim_length<centimetre> {};
template<UnitOf<dim_length> U, QuantityValue Rep = double>
using length = quantity<dim_length, U, Rep>;
inline namespace literals {
// cm
constexpr auto operator"" _q_cm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<centimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cm(long double l) { return length<centimetre, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto cm = length<centimetre, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::cgs
+51
View File
@@ -0,0 +1,51 @@
// 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 <units/isq/si/mass.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
using si::gram;
struct dim_mass : isq::dim_mass<gram> {};
template<UnitOf<dim_mass> U, QuantityValue Rep = double>
using mass = quantity<dim_mass, U, Rep>;
inline namespace literals {
// g
constexpr auto operator"" _q_g(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<gram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_g(long double l) { return mass<gram, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto g = mass<gram, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::cgs
+47
View File
@@ -0,0 +1,47 @@
// 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 <units/isq/dimensions/power.h>
#include <units/isq/si/cgs/energy.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
struct erg_per_second : unit<erg_per_second> {};
struct dim_power : isq::dim_power<dim_power, erg_per_second, dim_energy, dim_time> {};
template<UnitOf<dim_power> U, QuantityValue Rep = double>
using power = quantity<dim_power, U, Rep>;
inline namespace literals {
// erg/s
constexpr auto operator"" _q_erg_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<erg_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_erg_per_s(long double l) { return power<erg_per_second, long double>(l); }
} // namespace literals
} // namespace units::isq::si::cgs
+54
View File
@@ -0,0 +1,54 @@
// 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 <units/isq/dimensions/pressure.h>
#include <units/isq/si/cgs/area.h>
#include <units/isq/si/cgs/force.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
struct barye : named_unit<barye, "Ba", si::prefix> {};
struct dim_pressure : isq::dim_pressure<dim_pressure, barye, dim_force, dim_area> {};
template<UnitOf<dim_pressure> U, QuantityValue Rep = double>
using pressure = quantity<dim_pressure, U, Rep>;
inline namespace literals {
// Ba
constexpr auto operator"" _q_Ba(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<barye, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ba(long double l) { return pressure<barye, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto Ba = pressure<barye, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::cgs
+46
View File
@@ -0,0 +1,46 @@
// 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 <units/isq/dimensions/speed.h>
#include <units/isq/si/cgs/length.h>
#include <units/isq/si/cgs/time.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
struct centimetre_per_second : unit<centimetre_per_second> {};
struct dim_speed : isq::dim_speed<dim_speed, centimetre_per_second, dim_length, dim_time> {};
template<UnitOf<dim_speed> U, QuantityValue Rep = double>
using speed = quantity<dim_speed, U, Rep>;
inline namespace literals {
// cm/s
constexpr auto operator"" _q_cm_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return speed<centimetre_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cm_per_s(long double l) { return speed<centimetre_per_second, long double>(l); }
} // namespace literals
} // namespace units::isq::si::cgs
+47
View File
@@ -0,0 +1,47 @@
// 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 <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si::cgs {
using si::second;
using si::dim_time;
using si::time;
inline namespace literals {
using si::literals::operator"" _q_s;
} // namespace literals
namespace unit_constants {
using si::unit_constants::s;
} // namespace unit_constants
} // namespace units::isq::si::cgs
+57
View File
@@ -0,0 +1,57 @@
// 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 <units/isq/dimensions/charge_density.h>
#include <units/isq/si/electric_charge.h>
#include <units/isq/si/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct coulomb_per_metre_cub : unit<coulomb_per_metre_cub> {};
struct coulomb_per_metre_sq : unit<coulomb_per_metre_sq> {};
struct dim_charge_density : isq::dim_charge_density<dim_charge_density, coulomb_per_metre_cub, dim_electric_charge, dim_length> {};
struct dim_surface_charge_density : isq::dim_surface_charge_density<dim_surface_charge_density, coulomb_per_metre_sq, dim_electric_charge, dim_length> {};
template<UnitOf<dim_charge_density> U, QuantityValue Rep = double>
using charge_density = quantity<dim_charge_density, U, Rep>;
template<UnitOf<dim_surface_charge_density> U, QuantityValue Rep = double>
using surface_charge_density = quantity<dim_surface_charge_density, U, Rep>;
inline namespace literals {
// C/m³
constexpr auto operator"" _q_C_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return charge_density<coulomb_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_C_per_m3(long double l) { return charge_density<coulomb_per_metre_cub, long double>(l); }
// C/m²
constexpr auto operator"" _q_C_per_m2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return surface_charge_density<coulomb_per_metre_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_C_per_m2(long double l) { return surface_charge_density<coulomb_per_metre_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+47
View File
@@ -0,0 +1,47 @@
// 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 <units/isq/dimensions/concentration.h>
#include <units/isq/si/length.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/quantity.h>
namespace units::isq::si {
struct mol_per_metre_cub : unit<mol_per_metre_cub> {};
struct dim_concentration : isq::dim_concentration<dim_concentration, mol_per_metre_cub, dim_amount_of_substance, dim_length> {};
template<UnitOf<dim_concentration> U, QuantityValue Rep = double>
using concentration = quantity<dim_concentration, U, Rep>;
inline namespace literals {
// mol/m³
constexpr auto operator"" _q_mol_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return concentration<mol_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mol_per_m3(long double l) { return concentration<mol_per_metre_cub, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+150
View File
@@ -0,0 +1,150 @@
// 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 <units/isq/dimensions/conductance.h>
#include <units/isq/si/resistance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct siemens : named_unit<siemens, "S", prefix> {};
struct yoctosiemens : prefixed_unit<yoctosiemens, yocto, siemens> {};
struct zeptosiemens : prefixed_unit<zeptosiemens, zepto, siemens> {};
struct attosiemens : prefixed_unit<attosiemens, atto, siemens> {};
struct femtosiemens : prefixed_unit<femtosiemens, femto, siemens> {};
struct picosiemens : prefixed_unit<picosiemens, pico, siemens> {};
struct nanosiemens : prefixed_unit<nanosiemens, nano, siemens> {};
struct microsiemens : prefixed_unit<microsiemens, micro, siemens> {};
struct millisiemens : prefixed_unit<millisiemens, milli, siemens> {};
struct kilosiemens : prefixed_unit<kilosiemens, kilo, siemens> {};
struct megasiemens : prefixed_unit<megasiemens, mega, siemens> {};
struct gigasiemens : prefixed_unit<gigasiemens, giga, siemens> {};
struct terasiemens : prefixed_unit<terasiemens, tera, siemens> {};
struct petasiemens : prefixed_unit<petasiemens, peta, siemens> {};
struct exasiemens : prefixed_unit<exasiemens, exa, siemens> {};
struct zettasiemens : prefixed_unit<zettasiemens, zetta, siemens> {};
struct yottasiemens : prefixed_unit<yottasiemens, yotta, siemens> {};
struct dim_conductance : isq::dim_conductance<dim_conductance, siemens, dim_resistance> {};
template<UnitOf<dim_conductance> U, QuantityValue Rep = double>
using conductance = quantity<dim_conductance, U, Rep>;
inline namespace literals {
// R
constexpr auto operator"" _q_S(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<siemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_S(long double l) { return conductance<siemens, long double>(l); }
// yS
constexpr auto operator"" _q_yS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<yoctosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yS(long double l) { return conductance<yoctosiemens, long double>(l); }
// zS
constexpr auto operator"" _q_zS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<zeptosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zS(long double l) { return conductance<zeptosiemens, long double>(l); }
// aS
constexpr auto operator"" _q_aS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<attosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aS(long double l) { return conductance<attosiemens, long double>(l); }
// fS
constexpr auto operator"" _q_fS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<femtosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fS(long double l) { return conductance<femtosiemens, long double>(l); }
// pS
constexpr auto operator"" _q_pS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<picosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pS(long double l) { return conductance<picosiemens, long double>(l); }
// nS
constexpr auto operator"" _q_nS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<nanosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nS(long double l) { return conductance<nanosiemens, long double>(l); }
// µS
constexpr auto operator"" _q_uS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<microsiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uS(long double l) { return conductance<microsiemens, long double>(l); }
// mS
constexpr auto operator"" _q_mS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<millisiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mS(long double l) { return conductance<millisiemens, long double>(l); }
// kS
constexpr auto operator"" _q_kS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<kilosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kS(long double l) { return conductance<kilosiemens, long double>(l); }
// MS
constexpr auto operator"" _q_MS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<megasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MS(long double l) { return conductance<megasiemens, long double>(l); }
// GS
constexpr auto operator"" _q_GS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<gigasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GS(long double l) { return conductance<gigasiemens, long double>(l); }
// TS
constexpr auto operator"" _q_TS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<terasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TS(long double l) { return conductance<terasiemens, long double>(l); }
// PS
constexpr auto operator"" _q_PS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<petasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PS(long double l) { return conductance<petasiemens, long double>(l); }
// ES
constexpr auto operator"" _q_ES(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<exasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ES(long double l) { return conductance<exasiemens, long double>(l); }
// ZS
constexpr auto operator"" _q_ZS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<zettasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZS(long double l) { return conductance<zettasiemens, long double>(l); }
// YS
constexpr auto operator"" _q_YS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<yottasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YS(long double l) { return conductance<yottasiemens, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto S = conductance<siemens, one_rep>{};
inline constexpr auto yS = conductance<yoctosiemens, one_rep>{};
inline constexpr auto zS = conductance<zeptosiemens, one_rep>{};
inline constexpr auto aS = conductance<attosiemens, one_rep>{};
inline constexpr auto fS = conductance<femtosiemens, one_rep>{};
inline constexpr auto pS = conductance<picosiemens, one_rep>{};
inline constexpr auto nS = conductance<nanosiemens, one_rep>{};
inline constexpr auto uS = conductance<microsiemens, one_rep>{};
inline constexpr auto mS = conductance<millisiemens, one_rep>{};
inline constexpr auto kS = conductance<kilosiemens, one_rep>{};
inline constexpr auto MS = conductance<megasiemens, one_rep>{};
inline constexpr auto GS = conductance<gigasiemens, one_rep>{};
inline constexpr auto TS = conductance<terasiemens, one_rep>{};
inline constexpr auto PS = conductance<petasiemens, one_rep>{};
inline constexpr auto ES = conductance<exasiemens, one_rep>{};
inline constexpr auto ZS = conductance<zettasiemens, one_rep>{};
inline constexpr auto YS = conductance<yottasiemens, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
+62
View File
@@ -0,0 +1,62 @@
// 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 <units/isq/si/amount_of_substance.h>
#include <units/isq/si/thermodynamic_temperature.h>
#include <units/isq/si/electric_charge.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/frequency.h>
#include <units/isq/si/power.h>
#include <units/isq/si/speed.h>
namespace units::isq::si::si2019 {
template<QuantityValue Rep = double>
inline constexpr auto planck_constant = energy<joule, Rep>(6.62607015e-34) * time<second, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto reduced_planck_constant = energy<gigaelectronvolt, Rep>(6.582119569e-10) * time<second, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto elementary_charge = electric_charge<coulomb, Rep>(1.602176634e-19);
template<QuantityValue Rep = double>
inline constexpr auto boltzmann_constant = energy<joule, Rep>(1.380649e-23) / temperature<kelvin, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto avogadro_constant = Rep(6.02214076e23) / substance<mole, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto speed_of_light = speed<metre_per_second, Rep>(299'792'458);
template<QuantityValue Rep = double>
inline constexpr auto hyperfine_structure_transition_frequency = frequency<hertz, Rep>(9'192'631'770);
// template<QuantityValue Rep = double>
// inline constexpr auto luminous_efficacy = 683_q_lm / 1_q_W;
template<QuantityValue Rep = double>
inline constexpr auto standard_gravity = acceleration<metre_per_second_sq, Rep>(9.80665);
} // namespace units::isq::si::si2019
@@ -0,0 +1,48 @@
// 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 <units/isq/dimensions/current_density.h>
#include <units/isq/si/electric_current.h>
#include <units/isq/si/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct ampere_per_metre_sq : unit<ampere_per_metre_sq> {};
struct dim_current_density : isq::dim_current_density<dim_current_density, ampere_per_metre_sq, dim_electric_current, dim_length> {};
template<UnitOf<dim_current_density> U, QuantityValue Rep = double>
using current_density = quantity<dim_current_density, U, Rep>;
inline namespace literals {
// A / m²
constexpr auto operator"" _q_A_per_m2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return current_density<ampere_per_metre_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_A_per_m2(long double l) { return current_density<ampere_per_metre_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+48
View File
@@ -0,0 +1,48 @@
// 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 <units/isq/dimensions/density.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct kilogram_per_metre_cub : unit<kilogram_per_metre_cub> {};
struct dim_density : isq::dim_density<dim_density, kilogram_per_metre_cub, dim_mass, dim_length> {};
template<UnitOf<dim_density> U, QuantityValue Rep = double>
using density = quantity<dim_density, U, Rep>;
inline namespace literals {
// kg / m³
constexpr auto operator"" _q_kg_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return density<kilogram_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kg_per_m3(long double l) { return density<kilogram_per_metre_cub, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,53 @@
// 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 <units/isq/dimensions/dynamic_viscosity.h>
#include <units/isq/si/time.h>
#include <units/isq/si/pressure.h>
#include <units/quantity.h>
namespace units::isq::si {
struct pascal_second : unit<pascal_second> {};
struct dim_dynamic_viscosity : isq::dim_dynamic_viscosity<dim_dynamic_viscosity, pascal_second, dim_pressure, dim_time> {};
template<UnitOf<dim_dynamic_viscosity> U, QuantityValue Rep = double>
using dynamic_viscosity = quantity<dim_dynamic_viscosity, U, Rep>;
inline namespace literals {
// Pa·s
constexpr auto operator"" _q_Pa_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return dynamic_viscosity<pascal_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pa_s(long double l) { return dynamic_viscosity<pascal_second, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto Pa_s = dynamic_viscosity<pascal_second, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,53 @@
// 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 <units/isq/dimensions/electric_charge.h>
#include <units/isq/si/electric_current.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct coulomb : named_unit<coulomb, "C", prefix> {};
struct dim_electric_charge : isq::dim_electric_charge<dim_electric_charge, coulomb, dim_time, dim_electric_current> {};
template<UnitOf<dim_electric_charge> U, QuantityValue Rep = double>
using electric_charge = quantity<dim_electric_charge, U, Rep>;
inline namespace literals {
// C
constexpr auto operator"" _q_C(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_charge<coulomb, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_C(long double l) { return electric_charge<coulomb, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto C = electric_charge<coulomb, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
+173
View File
@@ -0,0 +1,173 @@
// 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 <units/one_rep.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct ampere : named_unit<ampere, "A", prefix> {};
struct yoctoampere : prefixed_unit<yoctoampere, yocto, ampere> {};
struct zeptoampere : prefixed_unit<zeptoampere, zepto, ampere> {};
struct attoampere : prefixed_unit<attoampere, atto, ampere> {};
struct femtoampere : prefixed_unit<femtoampere, femto, ampere> {};
struct picoampere : prefixed_unit<picoampere, pico, ampere> {};
struct nanoampere : prefixed_unit<nanoampere, nano, ampere> {};
struct microampere : prefixed_unit<microampere, micro, ampere> {};
struct milliampere : prefixed_unit<milliampere, milli, ampere> {};
struct centiampere : prefixed_unit<centiampere, centi, ampere> {};
struct deciampere : prefixed_unit<deciampere, deci, ampere> {};
struct decaampere : prefixed_unit<decaampere, deca, ampere> {};
struct hectoampere : prefixed_unit<hectoampere, hecto, ampere> {};
struct kiloampere : prefixed_unit<kiloampere, kilo, ampere> {};
struct megaampere : prefixed_unit<megaampere, mega, ampere> {};
struct gigaampere : prefixed_unit<gigaampere, giga, ampere> {};
struct teraampere : prefixed_unit<teraampere, tera, ampere> {};
struct petaampere : prefixed_unit<petaampere, peta, ampere> {};
struct exaampere : prefixed_unit<exaampere, exa, ampere> {};
struct zettaampere : prefixed_unit<zettaampere, zetta, ampere> {};
struct yottaampere : prefixed_unit<yottaampere, yotta, ampere> {};
struct dim_electric_current : isq::dim_electric_current<ampere> {};
template<UnitOf<dim_electric_current> U, QuantityValue Rep = double>
using electric_current = quantity<dim_electric_current, U, Rep>;
inline namespace literals {
// A
constexpr auto operator"" _q_A(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<ampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_A(long double l) { return electric_current<ampere, long double>(l); }
// yA
constexpr auto operator"" _q_yA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<yoctoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yA(long double l) { return electric_current<yoctoampere, long double>(l); }
// zA
constexpr auto operator"" _q_zA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<zeptoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zA(long double l) { return electric_current<zeptoampere, long double>(l); }
// aA
constexpr auto operator"" _q_aA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<attoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aA(long double l) { return electric_current<attoampere, long double>(l); }
// fA
constexpr auto operator"" _q_fA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<femtoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fA(long double l) { return electric_current<femtoampere, long double>(l); }
// pA
constexpr auto operator"" _q_pA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<picoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pA(long double l) { return electric_current<picoampere, long double>(l); }
// nA
constexpr auto operator"" _q_nA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<nanoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nA(long double l) { return electric_current<nanoampere, long double>(l); }
// uA
constexpr auto operator"" _q_uA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<microampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uA(long double l) { return electric_current<microampere, long double>(l); }
// mA
constexpr auto operator"" _q_mA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<milliampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mA(long double l) { return electric_current<milliampere, long double>(l); }
// cA
constexpr auto operator"" _q_cA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<centiampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cA(long double l) { return electric_current<centiampere, long double>(l); }
// dA
constexpr auto operator"" _q_dA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<deciampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dA(long double l) { return electric_current<deciampere, long double>(l); }
// daA
constexpr auto operator"" _q_daA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<decaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daA(long double l) { return electric_current<decaampere, long double>(l); }
// hA
constexpr auto operator"" _q_hA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<hectoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hA(long double l) { return electric_current<hectoampere, long double>(l); }
// kA
constexpr auto operator"" _q_kA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<kiloampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kA(long double l) { return electric_current<kiloampere, long double>(l); }
// MA
constexpr auto operator"" _q_MA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<megaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MA(long double l) { return electric_current<megaampere, long double>(l); }
// GA
constexpr auto operator"" _q_GA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<gigaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GA(long double l) { return electric_current<gigaampere, long double>(l); }
// TA
constexpr auto operator"" _q_TA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<teraampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TA(long double l) { return electric_current<teraampere, long double>(l); }
// PA
constexpr auto operator"" _q_PA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<petaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PA(long double l) { return electric_current<petaampere, long double>(l); }
// EA
constexpr auto operator"" _q_EA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<exaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EA(long double l) { return electric_current<exaampere, long double>(l); }
// ZA
constexpr auto operator"" _q_ZA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<zettaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZA(long double l) { return electric_current<zettaampere, long double>(l); }
// YA
constexpr auto operator"" _q_YA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<yottaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YA(long double l) { return electric_current<yottaampere, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto A = electric_current<ampere, one_rep>{};
inline constexpr auto yA = electric_current<yoctoampere, one_rep>{};
inline constexpr auto zA = electric_current<zeptoampere, one_rep>{};
inline constexpr auto aA = electric_current<attoampere, one_rep>{};
inline constexpr auto fA = electric_current<femtoampere, one_rep>{};
inline constexpr auto pA = electric_current<picoampere, one_rep>{};
inline constexpr auto nA = electric_current<nanoampere, one_rep>{};
inline constexpr auto uA = electric_current<microampere, one_rep>{};
inline constexpr auto mA = electric_current<milliampere, one_rep>{};
inline constexpr auto cA = electric_current<centiampere, one_rep>{};
inline constexpr auto dA = electric_current<deciampere, one_rep>{};
inline constexpr auto daA = electric_current<decaampere, one_rep>{};
inline constexpr auto hA = electric_current<hectoampere, one_rep>{};
inline constexpr auto kA = electric_current<kiloampere, one_rep>{};
inline constexpr auto MA = electric_current<megaampere, one_rep>{};
inline constexpr auto GA = electric_current<gigaampere, one_rep>{};
inline constexpr auto TA = electric_current<teraampere, one_rep>{};
inline constexpr auto PA = electric_current<petaampere, one_rep>{};
inline constexpr auto EA = electric_current<exaampere, one_rep>{};
inline constexpr auto ZA = electric_current<zettaampere, one_rep>{};
inline constexpr auto YA = electric_current<yottaampere, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,45 @@
// 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 <units/isq/dimensions/electric_field_strength.h>
#include <units/isq/si/voltage.h>
#include <units/quantity.h>
namespace units::isq::si {
struct volt_per_metre : unit<volt_per_metre> {};
struct dim_electric_field_strength : isq::dim_electric_field_strength<dim_electric_field_strength, volt_per_metre, dim_voltage, dim_length> {};
template<UnitOf<dim_electric_field_strength> U, QuantityValue Rep = double>
using electric_field_strength = quantity<dim_electric_field_strength, U, Rep>;
inline namespace literals {
// V/m
constexpr auto operator"" _q_V_per_m(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_field_strength<volt_per_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_V_per_m(long double l) { return electric_field_strength<volt_per_metre, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+162
View File
@@ -0,0 +1,162 @@
// 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 <units/isq/dimensions/energy.h>
#include <units/isq/si/force.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct joule : named_unit<joule, "J", prefix> {};
struct yoctojoule : prefixed_unit<yoctojoule, yocto, joule> {};
struct zeptojoule : prefixed_unit<zeptojoule, zepto, joule> {};
struct attojoule : prefixed_unit<attojoule, atto, joule> {};
struct femtojoule : prefixed_unit<femtojoule, femto, joule> {};
struct picojoule : prefixed_unit<picojoule, pico, joule> {};
struct nanojoule : prefixed_unit<nanojoule, nano, joule> {};
struct microjoule : prefixed_unit<microjoule, micro, joule> {};
struct millijoule : prefixed_unit<millijoule, milli, joule> {};
struct kilojoule : prefixed_unit<kilojoule, kilo, joule> {};
struct megajoule : prefixed_unit<megajoule, mega, joule> {};
struct gigajoule : prefixed_unit<gigajoule, giga, joule> {};
struct terajoule : prefixed_unit<terajoule, tera, joule> {};
struct petajoule : prefixed_unit<petajoule, peta, joule> {};
struct exajoule : prefixed_unit<exajoule, exa, joule> {};
struct zettajoule : prefixed_unit<zettajoule, zetta, joule> {};
struct yottajoule : prefixed_unit<yottajoule, yotta, joule> {};
struct electronvolt : named_scaled_unit<electronvolt, "eV", prefix, ratio(1'602'176'634, 1'000'000'000, -19), joule> {};
struct gigaelectronvolt : prefixed_unit<gigaelectronvolt, giga, electronvolt> {};
struct dim_energy : isq::dim_energy<dim_energy, joule, dim_force, dim_length> {};
template<UnitOf<dim_energy> U, QuantityValue Rep = double>
using energy = quantity<dim_energy, U, Rep>;
inline namespace literals {
// J
constexpr auto operator"" _q_J(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<joule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J(long double l) { return energy<joule, long double>(l); }
// yJ
constexpr auto operator"" _q_yJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<yoctojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yJ(long double l) { return energy<yoctojoule, long double>(l); }
// zJ
constexpr auto operator"" _q_zJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<zeptojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zJ(long double l) { return energy<zeptojoule, long double>(l); }
// aJ
constexpr auto operator"" _q_aJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<attojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aJ(long double l) { return energy<attojoule, long double>(l); }
// fJ
constexpr auto operator"" _q_fJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<femtojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fJ(long double l) { return energy<femtojoule, long double>(l); }
// pJ
constexpr auto operator"" _q_pJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<picojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pJ(long double l) { return energy<picojoule, long double>(l); }
// nJ
constexpr auto operator"" _q_nJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<nanojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nJ(long double l) { return energy<nanojoule, long double>(l); }
// uJ
constexpr auto operator"" _q_uJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<microjoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uJ(long double l) { return energy<microjoule, long double>(l); }
// mJ
constexpr auto operator"" _q_mJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<millijoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mJ(long double l) { return energy<millijoule, long double>(l); }
// kJ
constexpr auto operator"" _q_kJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<kilojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kJ(long double l) { return energy<kilojoule, long double>(l); }
// MJ
constexpr auto operator"" _q_MJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<megajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MJ(long double l) { return energy<megajoule, long double>(l); }
// GJ
constexpr auto operator"" _q_GJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<gigajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GJ(long double l) { return energy<gigajoule, long double>(l); }
// TJ
constexpr auto operator"" _q_TJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<terajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TJ(long double l) { return energy<terajoule, long double>(l); }
// PJ
constexpr auto operator"" _q_PJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<petajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PJ(long double l) { return energy<petajoule, long double>(l); }
// EJ
constexpr auto operator"" _q_EJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<exajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EJ(long double l) { return energy<exajoule, long double>(l); }
// ZJ
constexpr auto operator"" _q_ZJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<zettajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZJ(long double l) { return energy<zettajoule, long double>(l); }
// YJ
constexpr auto operator"" _q_YJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<yottajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YJ(long double l) { return energy<yottajoule, long double>(l); }
// eV
constexpr auto operator"" _q_eV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<electronvolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_eV(long double l) { return energy<electronvolt, long double>(l); }
// GeV
constexpr auto operator"" _q_GeV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<gigaelectronvolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GeV(long double l) { return energy<gigaelectronvolt, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto J = energy<joule, one_rep>{};
inline constexpr auto yJ = energy<yoctojoule, one_rep>{};
inline constexpr auto zJ = energy<zeptojoule, one_rep>{};
inline constexpr auto aJ = energy<attojoule, one_rep>{};
inline constexpr auto fJ = energy<femtojoule, one_rep>{};
inline constexpr auto pJ = energy<picojoule, one_rep>{};
inline constexpr auto nJ = energy<nanojoule, one_rep>{};
inline constexpr auto uJ = energy<microjoule, one_rep>{};
inline constexpr auto mJ = energy<millijoule, one_rep>{};
inline constexpr auto kJ = energy<kilojoule, one_rep>{};
inline constexpr auto MJ = energy<megajoule, one_rep>{};
inline constexpr auto GJ = energy<gigajoule, one_rep>{};
inline constexpr auto TJ = energy<terajoule, one_rep>{};
inline constexpr auto PJ = energy<petajoule, one_rep>{};
inline constexpr auto EJ = energy<exajoule, one_rep>{};
inline constexpr auto ZJ = energy<zettajoule, one_rep>{};
inline constexpr auto YJ = energy<yottajoule, one_rep>{};
inline constexpr auto eV = energy<electronvolt, one_rep>{};
inline constexpr auto GeV = energy<gigaelectronvolt, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
+46
View File
@@ -0,0 +1,46 @@
// 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 <units/isq/dimensions/energy_density.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/volume.h>
#include <units/quantity.h>
namespace units::isq::si {
struct joule_per_metre_cub : unit<joule_per_metre_cub> {};
struct dim_energy_density : isq::dim_energy_density<dim_energy_density, joule_per_metre_cub, dim_energy, dim_volume> {};
template<UnitOf<dim_energy_density> U, QuantityValue Rep = double>
using energy_density = quantity<dim_energy_density, U, Rep>;
inline namespace literals {
// N/m
constexpr auto operator"" _q_J_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy_density<joule_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_m3(long double l) { return energy_density<joule_per_metre_cub, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+174
View File
@@ -0,0 +1,174 @@
// 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 <units/isq/dimensions/force.h>
#include <units/isq/si/acceleration.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct newton : named_unit<newton, "N", prefix> {};
struct yoctonewton : prefixed_unit<yoctonewton, yocto, newton> {};
struct zeptonewton : prefixed_unit<zeptonewton, zepto, newton> {};
struct attonewton : prefixed_unit<attonewton, atto, newton> {};
struct femtonewton : prefixed_unit<femtonewton, femto, newton> {};
struct piconewton : prefixed_unit<piconewton, pico, newton> {};
struct nanonewton : prefixed_unit<nanonewton, nano, newton> {};
struct micronewton : prefixed_unit<micronewton, micro, newton> {};
struct millinewton : prefixed_unit<millinewton, milli, newton> {};
struct centinewton : prefixed_unit<centinewton, centi, newton> {};
struct decinewton : prefixed_unit<decinewton, deci, newton> {};
struct decanewton : prefixed_unit<decanewton, deca, newton> {};
struct hectonewton : prefixed_unit<hectonewton, hecto, newton> {};
struct kilonewton : prefixed_unit<kilonewton, kilo, newton> {};
struct meganewton : prefixed_unit<meganewton, mega, newton> {};
struct giganewton : prefixed_unit<giganewton, giga, newton> {};
struct teranewton : prefixed_unit<teranewton, tera, newton> {};
struct petanewton : prefixed_unit<petanewton, peta, newton> {};
struct exanewton : prefixed_unit<exanewton, exa, newton> {};
struct zettanewton : prefixed_unit<zettanewton, zetta, newton> {};
struct yottanewton : prefixed_unit<yottanewton, yotta, newton> {};
struct dim_force : isq::dim_force<dim_force, newton, dim_mass, dim_acceleration> {};
template<UnitOf<dim_force> U, QuantityValue Rep = double>
using force = quantity<dim_force, U, Rep>;
inline namespace literals {
// N
constexpr auto operator"" _q_N(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<newton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_N(long double l) { return force<newton, long double>(l); }
// yN
constexpr auto operator"" _q_yN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<yoctonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yN(long double l) { return force<yoctonewton, long double>(l); }
// zN
constexpr auto operator"" _q_zN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<zeptonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zN(long double l) { return force<zeptonewton, long double>(l); }
// aN
constexpr auto operator"" _q_aN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<attonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aN(long double l) { return force<attonewton, long double>(l); }
// fN
constexpr auto operator"" _q_fN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<femtonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fN(long double l) { return force<femtonewton, long double>(l); }
// pN
constexpr auto operator"" _q_pN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<piconewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pN(long double l) { return force<piconewton, long double>(l); }
// nN
constexpr auto operator"" _q_nN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<nanonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nN(long double l) { return force<nanonewton, long double>(l); }
// uN
constexpr auto operator"" _q_uN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<micronewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uN(long double l) { return force<micronewton, long double>(l); }
// mN
constexpr auto operator"" _q_mN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<millinewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mN(long double l) { return force<millinewton, long double>(l); }
// cN
constexpr auto operator"" _q_cN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<centinewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cN(long double l) { return force<centinewton, long double>(l); }
// dN
constexpr auto operator"" _q_dN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<decinewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dN(long double l) { return force<decinewton, long double>(l); }
// daN
constexpr auto operator"" _q_daN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<decanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daN(long double l) { return force<decanewton, long double>(l); }
// hN
constexpr auto operator"" _q_hN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<hectonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hN(long double l) { return force<hectonewton, long double>(l); }
// kN
constexpr auto operator"" _q_kN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<kilonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kN(long double l) { return force<kilonewton, long double>(l); }
// MN
constexpr auto operator"" _q_MN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<meganewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MN(long double l) { return force<meganewton, long double>(l); }
// GN
constexpr auto operator"" _q_GN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<giganewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GN(long double l) { return force<giganewton, long double>(l); }
// TN
constexpr auto operator"" _q_TN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<teranewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TN(long double l) { return force<teranewton, long double>(l); }
// PN
constexpr auto operator"" _q_PN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<petanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PN(long double l) { return force<petanewton, long double>(l); }
// EN
constexpr auto operator"" _q_EN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<exanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EN(long double l) { return force<exanewton, long double>(l); }
// ZN
constexpr auto operator"" _q_ZN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<zettanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZN(long double l) { return force<zettanewton, long double>(l); }
// YN
constexpr auto operator"" _q_YN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<yottanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YN(long double l) { return force<yottanewton, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto N = force<newton, one_rep>{};
inline constexpr auto yN = force<yoctonewton, one_rep>{};
inline constexpr auto zN = force<zeptonewton, one_rep>{};
inline constexpr auto aN = force<attonewton, one_rep>{};
inline constexpr auto fN = force<femtonewton, one_rep>{};
inline constexpr auto pN = force<piconewton, one_rep>{};
inline constexpr auto nN = force<nanonewton, one_rep>{};
inline constexpr auto uN = force<micronewton, one_rep>{};
inline constexpr auto mN = force<millinewton, one_rep>{};
inline constexpr auto cN = force<centinewton, one_rep>{};
inline constexpr auto dN = force<decinewton, one_rep>{};
inline constexpr auto daN = force<decanewton, one_rep>{};
inline constexpr auto hN = force<hectonewton, one_rep>{};
inline constexpr auto kN = force<kilonewton, one_rep>{};
inline constexpr auto MN = force<meganewton, one_rep>{};
inline constexpr auto GN = force<giganewton, one_rep>{};
inline constexpr auto TN = force<teranewton, one_rep>{};
inline constexpr auto PN = force<petanewton, one_rep>{};
inline constexpr auto EN = force<exanewton, one_rep>{};
inline constexpr auto ZN = force<zettanewton, one_rep>{};
inline constexpr auto YN = force<yottanewton, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,45 @@
// 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 <units/isq/dimensions/acceleration.h>
#include <units/isq/si/fps/speed.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
struct foot_per_second_sq : unit<foot_per_second_sq> {};
struct dim_acceleration : isq::dim_acceleration<dim_acceleration, foot_per_second_sq, dim_length, dim_time> {};
template<UnitOf<dim_acceleration> U, QuantityValue Rep = double>
using acceleration = quantity<dim_acceleration, U, Rep>;
inline namespace literals {
// ft/s2
constexpr auto operator"" _q_ft_per_s2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return acceleration<foot_per_second_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft_per_s2(long double l) { return acceleration<foot_per_second_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si::fps
+52
View File
@@ -0,0 +1,52 @@
// 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 <units/isq/dimensions/area.h>
#include <units/isq/si/fps/length.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
struct square_foot : unit<square_foot> {};
struct dim_area : isq::dim_area<dim_area, square_foot, dim_length> {};
template<UnitOf<dim_area> U, QuantityValue Rep = double>
using area = quantity<dim_area, U, Rep>;
inline namespace literals {
// ft2
constexpr auto operator"" _q_ft2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_foot, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft2(long double l) { return area<square_foot, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto ft2 = area<square_foot, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+47
View File
@@ -0,0 +1,47 @@
// 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 <units/isq/dimensions/density.h>
#include <units/isq/si/fps/mass.h>
#include <units/isq/si/fps/length.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
struct pound_per_foot_cub : unit<pound_per_foot_cub> {};
struct dim_density : isq::dim_density<dim_density, pound_per_foot_cub, dim_mass, dim_length> {};
template<UnitOf<dim_density> U, QuantityValue Rep = double>
using density = quantity<dim_density, U, Rep>;
inline namespace literals {
// lb/ft³
constexpr auto operator"" _q_lb_per_ft3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return density<pound_per_foot_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_lb_per_ft3(long double l) { return density<pound_per_foot_cub, long double>(l); }
} // namespace literals
} // namespace units::isq::si::fps
+65
View File
@@ -0,0 +1,65 @@
// 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 <units/isq/dimensions/energy.h>
#include <units/isq/si/fps/force.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
// https://en.wikipedia.org/wiki/Foot-poundal
struct foot_poundal : unit<foot_poundal> {};
struct dim_energy : isq::dim_energy<dim_energy, foot_poundal, dim_force, dim_length> {};
// https://en.wikipedia.org/wiki/Foot-pound_(energy)
struct foot_pound_force : noble_deduced_unit<foot_pound_force, dim_energy, pound_force, foot> {};
template<UnitOf<dim_energy> U, QuantityValue Rep = double>
using energy = quantity<dim_energy, U, Rep>;
inline namespace literals {
// foot poundal
constexpr auto operator"" _q_ft_pdl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<foot_poundal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft_pdl(long double l) { return energy<foot_poundal, long double>(l); }
// foot_pound force
constexpr auto operator"" _q_ft_lbf(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<foot_pound_force, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft_lbf(long double l) { return energy<foot_pound_force, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto ft_pdl = energy<foot_poundal, one_rep>{};
inline constexpr auto ft_lbf = energy<foot_pound_force, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+73
View File
@@ -0,0 +1,73 @@
// 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 <units/isq/dimensions/force.h>
#include <units/isq/si/fps/acceleration.h>
#include <units/isq/si/fps/mass.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
// https://en.wikipedia.org/wiki/Poundal
struct poundal : named_unit<poundal, "pdl", no_prefix> {};
// https://en.wikipedia.org/wiki/Pound_(force)
struct pound_force : named_scaled_unit<pound_force, "lbf", si::prefix, ratio(32'174'049, 1'000'000), poundal> {};
struct kilopound_force : prefixed_unit<kilopound_force, si::kilo, pound_force> {};
// https://en.wikipedia.org/wiki/Kip_(unit),
struct kip : alias_unit<kilopound_force, "klbf", no_prefix> {};
struct dim_force : isq::dim_force<dim_force, poundal, dim_mass, dim_acceleration> {};
template<UnitOf<dim_force> U, QuantityValue Rep = double>
using force = quantity<dim_force, U, Rep>;
inline namespace literals {
// poundal
constexpr auto operator"" _q_pdl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<poundal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pdl(long double l) { return force<poundal, long double>(l); }
// pound force
constexpr auto operator"" _q_lbf(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<pound_force, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_lbf(long double l) { return force<pound_force, long double>(l); }
// kilopound force
constexpr auto operator"" _q_klbf(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<kilopound_force, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_klbf(long double l) { return force<kilopound_force, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto pdl = force<poundal, one_rep>{};
inline constexpr auto lbf = force<pound_force, one_rep>{};
inline constexpr auto klbf = force<kilopound_force, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+37
View File
@@ -0,0 +1,37 @@
// 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 <units/isq/si/fps/length.h>
#include <units/isq/si/fps/mass.h>
#include <units/isq/si/fps/time.h>
#include <units/isq/si/fps/acceleration.h>
#include <units/isq/si/fps/area.h>
#include <units/isq/si/fps/density.h>
#include <units/isq/si/fps/energy.h>
#include <units/isq/si/fps/force.h>
#include <units/isq/si/fps/power.h>
#include <units/isq/si/fps/pressure.h>
#include <units/isq/si/fps/speed.h>
#include <units/isq/si/fps/volume.h>
+111
View File
@@ -0,0 +1,111 @@
// 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 <units/isq/si/length.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
// https://en.wikipedia.org/wiki/Foot_(unit)
struct foot : named_scaled_unit<foot, "ft", no_prefix, ratio(3'048, 1'000, -1), si::metre> {};
struct inch : named_scaled_unit<inch, "in", no_prefix, ratio(1, 12), foot> {};
// thousandth of an inch
struct thousandth : named_scaled_unit<thousandth, "thou", no_prefix, ratio(1, 1'000), inch> {};
struct thou : alias_unit<thousandth, "thou", no_prefix>{};
struct mil : alias_unit<thousandth, "mil", no_prefix>{};
struct yard : named_scaled_unit<yard, "yd", si::prefix, ratio(3, 1), foot> {};
struct fathom : named_scaled_unit<fathom, "ftm", no_prefix, ratio(6, 1), foot> {};
struct kiloyard : prefixed_unit<kiloyard, si::kilo, yard> {};
struct mile : named_scaled_unit<mile, "mile", no_prefix, ratio(5'280), foot> {};
struct nautical_mile : named_scaled_unit<nautical_mile, "mi(naut)", no_prefix, ratio(2'000), yard> {};
struct dim_length : isq::dim_length<foot> {};
template<UnitOf<dim_length> U, QuantityValue Rep = double>
using length = quantity<dim_length, U, Rep>;
inline namespace literals {
// Thousandth
constexpr auto operator"" _q_thou(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<thousandth, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_thou(long double l) { return length<thousandth, long double>(l); }
constexpr auto operator"" _q_mil(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<thousandth, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mil(long double l) { return length<thousandth, long double>(l); }
// Inch
constexpr auto operator"" _q_in(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<inch, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_in(long double l) { return length<inch, long double>(l); }
// Foot
constexpr auto operator"" _q_ft(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<foot, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft(long double l) { return length<foot, long double>(l); }
// Yard
constexpr auto operator"" _q_yd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<yard, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yd(long double l) { return length<yard, long double>(l); }
// Fathom
constexpr auto operator"" _q_ftm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<fathom, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ftm(long double l) { return length<fathom, long double>(l); }
// Kiloyard
constexpr auto operator"" _q_kyd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<kiloyard, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kyd(long double l) { return length<kiloyard, long double>(l); }
// Mile
constexpr auto operator"" _q_mile(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<mile, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mile(long double l) { return length<mile, long double>(l); }
// Nautical mile
constexpr auto operator"" _q_naut_mi(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<nautical_mile, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_naut_mi(long double l) { return length<nautical_mile, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto thou = length<thousandth, one_rep>{};
inline constexpr auto mil = thou;
inline constexpr auto in = length<inch, one_rep>{};
inline constexpr auto ft = length<foot, one_rep>{};
inline constexpr auto yd = length<yard, one_rep>{};
inline constexpr auto ftm = length<fathom, one_rep>{};
inline constexpr auto kyd = length<kiloyard, one_rep>{};
inline constexpr auto mile = length<fps::mile, one_rep>{};
inline constexpr auto naut_mi = length<nautical_mile, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+108
View File
@@ -0,0 +1,108 @@
// 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 <units/isq/si/mass.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
// https://en.wikipedia.org/wiki/Pound_(mass)
struct pound : named_scaled_unit<pound, "lb", no_prefix, ratio(45'359'237, 100'000'000), si::kilogram> {};
struct dim_mass : isq::dim_mass<pound> {};
template<UnitOf<dim_mass> U, QuantityValue Rep = double>
using mass = quantity<dim_mass, U, Rep>;
struct grain : named_scaled_unit<grain, "gr", no_prefix, ratio(1, 7000), pound>{};
struct dram : named_scaled_unit<dram, "dr", no_prefix, ratio(1, 256), pound>{};
struct ounce : named_scaled_unit<ounce, "oz", no_prefix, ratio(1, 16), pound>{};
struct stone : named_scaled_unit<stone, "st", no_prefix, ratio(14, 1), pound>{};
struct quarter : named_scaled_unit<quarter, "qr", no_prefix, ratio(28, 1), pound>{};
struct hundredweight : named_scaled_unit<hundredweight, "cwt", no_prefix, ratio(112, 1), pound>{};
struct short_ton : named_scaled_unit<short_ton, "ton (short)", no_prefix, ratio(2'000, 1), pound>{};
struct long_ton : named_scaled_unit<long_ton, "ton (long)", no_prefix, ratio(2'240, 1), pound>{};
inline namespace literals {
// Grain
constexpr auto operator"" _q_gr(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<grain, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_gr(long double l) { return mass<grain, long double>(l); }
// Dram
constexpr auto operator"" _q_dr(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<dram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dr(long double l) { return mass<dram, long double>(l); }
// Ounce
constexpr auto operator"" _q_oz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<ounce, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_oz(long double l) { return mass<ounce, long double>(l); }
// Pound
constexpr auto operator"" _q_lb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<pound, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_lb(long double l) { return mass<pound, long double>(l); }
// Stone
constexpr auto operator"" _q_st(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<stone, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_st(long double l) { return mass<stone, long double>(l); }
// Quarter
constexpr auto operator"" _q_qr(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<quarter, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_qr(long double l) { return mass<quarter, long double>(l); }
// Hundredweight
constexpr auto operator"" _q_cwt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<hundredweight, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cwt(long double l) { return mass<hundredweight, long double>(l); }
// Short ton
constexpr auto operator"" _q_ston(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<short_ton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ston(long double l) { return mass<short_ton, long double>(l); }
// Long Ton
constexpr auto operator"" _q_lton(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<long_ton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_lton(long double l) { return mass<long_ton, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto gr = mass<grain, one_rep>{};
inline constexpr auto dr = mass<dram, one_rep>{};
inline constexpr auto oz = mass<ounce, one_rep>{};
inline constexpr auto lb = mass<pound, one_rep>{};
inline constexpr auto st = mass<stone, one_rep>{};
inline constexpr auto qr = mass<quarter, one_rep>{};
inline constexpr auto cwt = mass<hundredweight, one_rep>{};
inline constexpr auto ston = mass<short_ton, one_rep>{};
inline constexpr auto lton = mass<long_ton, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+65
View File
@@ -0,0 +1,65 @@
// 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 <units/isq/dimensions/power.h>
#include <units/isq/si/fps/energy.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
struct foot_poundal_per_second : unit<foot_poundal_per_second> {};
struct dim_power : isq::dim_power<dim_power, foot_poundal_per_second, dim_energy, dim_time> {};
struct foot_pound_force_per_second : deduced_unit<foot_pound_force_per_second, dim_power, foot_pound_force, second> {};
struct horse_power : named_scaled_unit<horse_power, "hp", no_prefix, ratio(550), foot_pound_force_per_second> {};
template<UnitOf<dim_power> U, QuantityValue Rep = double>
using power = quantity<dim_power, U, Rep>;
inline namespace literals {
// foot pound force per second
constexpr auto operator"" _q_ft_pdl_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<foot_poundal_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft_pdl_per_s(long double l) { return power<foot_poundal_per_second, long double>(l); }
// foot pound force per second
constexpr auto operator"" _q_ft_lbf_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<foot_pound_force_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft_lbf_per_s(long double l) { return power<foot_pound_force_per_second, long double>(l); }
// horse power
constexpr auto operator"" _q_hp(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<horse_power, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hp(long double l) { return power<horse_power, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto hp = power<horse_power, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+69
View File
@@ -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 <units/isq/dimensions/pressure.h>
#include <units/isq/si/fps/area.h>
#include <units/isq/si/fps/force.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
struct poundal_per_foot_sq : unit<poundal_per_foot_sq> {};
struct dim_pressure : isq::dim_pressure<dim_pressure, poundal_per_foot_sq, dim_force, dim_area> {};
template<UnitOf<dim_pressure> U, QuantityValue Rep = double>
using pressure = quantity<dim_pressure, U, Rep>;
struct pound_force_per_foot_sq : named_scaled_unit<pound_force_per_foot_sq, "lbf ft2", si::prefix, ratio(32'174'049, 1'000'000), poundal_per_foot_sq> {};
struct pound_force_per_inch_sq : named_scaled_unit<pound_force_per_inch_sq, "psi", si::prefix, ratio(1, 144), pound_force_per_foot_sq> {};
struct kilopound_force_per_inch_sq : prefixed_unit<kilopound_force_per_inch_sq, si::kilo, pound_force_per_inch_sq> {};
inline namespace literals {
// Poundal per square foot
constexpr auto operator"" _q_pdl_per_ft2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<poundal_per_foot_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pdl_per_ft2(long double l) { return pressure<poundal_per_foot_sq, long double>(l); }
// Pounds per square inch
constexpr auto operator"" _q_psi(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<pound_force_per_inch_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_psi(long double l) { return pressure<pound_force_per_inch_sq, long double>(l); }
// kilopounds per square inch
constexpr auto operator"" _q_kpsi(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<kilopound_force_per_inch_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kpsi(long double l) { return pressure<kilopound_force_per_inch_sq, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto psi = pressure<pound_force_per_inch_sq, one_rep>{};
inline constexpr auto kpsi = pressure<kilopound_force_per_inch_sq, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+68
View File
@@ -0,0 +1,68 @@
// 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 <units/isq/dimensions/speed.h>
#include <units/isq/si/fps/length.h>
#include <units/isq/si/fps/time.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
struct foot_per_second : unit<foot_per_second> {};
struct dim_speed : isq::dim_speed<dim_speed, foot_per_second, dim_length, dim_time> {};
template<UnitOf<dim_speed> U, QuantityValue Rep = double>
using speed = quantity<dim_speed, U, Rep>;
struct mile_per_hour : deduced_unit<mile_per_hour, dim_speed, mile, hour>{};
struct nautical_mile_per_hour : named_deduced_unit<nautical_mile_per_hour, dim_speed, "knot", no_prefix, nautical_mile, hour>{};
struct knot : alias_unit<nautical_mile_per_hour, "knot", no_prefix> {};
inline namespace literals {
// ft/s
constexpr auto operator"" _q_ft_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return speed<foot_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft_per_s(long double l) { return speed<foot_per_second, long double>(l); }
// mph
constexpr auto operator"" _q_mph(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return speed<mile_per_hour, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mph(long double l) { return speed<mile_per_hour, long double>(l); }
// kn
constexpr auto operator"" _q_knot(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return speed<knot, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_knot(long double l) { return speed<knot, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto mph = speed<mile_per_hour, one_rep>{};
inline constexpr auto knot = speed<fps::knot, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+49
View File
@@ -0,0 +1,49 @@
// 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 <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
using si::second;
using si::minute;
using si::hour;
using si::dim_time;
using si::time;
inline namespace literals {
using si::literals::operator"" _q_s;
} // namespace literals
namespace unit_constants {
using si::unit_constants::s;
} // namespace unit_constants
} // namespace units::isq::si::fps
+58
View File
@@ -0,0 +1,58 @@
// 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 <units/isq/dimensions/volume.h>
#include <units/isq/si/fps/length.h>
#include <units/quantity.h>
namespace units::isq::si::fps {
struct cubic_foot : unit<cubic_foot> {};
struct dim_volume : isq::dim_volume<dim_volume, cubic_foot, dim_length> {};
struct cubic_yard : deduced_unit<cubic_yard, dim_volume, yard> {};
template<UnitOf<dim_volume> U, QuantityValue Rep = double>
using volume = quantity<dim_volume, U, Rep>;
inline namespace literals {
// ft3
constexpr auto operator"" _q_ft3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_foot, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft3(long double l) { return volume<cubic_foot, long double>(l); }
// yd3
constexpr auto operator"" _q_yd3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_yard, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yd3(long double l) { return volume<cubic_yard, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto ft3 = volume<cubic_foot, one_rep>{};
inline constexpr auto yd3 = volume<cubic_yard, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::fps
+148
View File
@@ -0,0 +1,148 @@
// 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 <units/isq/dimensions/frequency.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct hertz : named_unit<hertz, "Hz", prefix> {};
struct yoctohertz : prefixed_unit<yoctohertz, yocto, hertz> {};
struct zeptohertz : prefixed_unit<zeptohertz, zepto, hertz> {};
struct attohertz : prefixed_unit<attohertz, atto, hertz> {};
struct femtohertz : prefixed_unit<femtohertz, femto, hertz> {};
struct picohertz : prefixed_unit<picohertz, pico, hertz> {};
struct nanohertz : prefixed_unit<nanohertz, nano, hertz> {};
struct microhertz : prefixed_unit<microhertz, micro, hertz> {};
struct millihertz : prefixed_unit<millihertz, milli, hertz> {};
struct kilohertz : prefixed_unit<kilohertz, kilo, hertz> {};
struct megahertz : prefixed_unit<megahertz, mega, hertz> {};
struct gigahertz : prefixed_unit<gigahertz, giga, hertz> {};
struct terahertz : prefixed_unit<terahertz, tera, hertz> {};
struct petahertz : prefixed_unit<petahertz, peta, hertz> {};
struct exahertz : prefixed_unit<exahertz, exa, hertz> {};
struct zettahertz : prefixed_unit<zettahertz, zetta, hertz> {};
struct yottahertz : prefixed_unit<yottahertz, yotta, hertz> {};
struct dim_frequency : isq::dim_frequency<dim_frequency, hertz, dim_time> {};
template<UnitOf<dim_frequency> U, QuantityValue Rep = double>
using frequency = quantity<dim_frequency, U, Rep>;
inline namespace literals {
// Hz
constexpr auto operator"" _q_Hz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<hertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Hz(long double l) { return frequency<hertz, long double>(l); }
// yHz
constexpr auto operator"" _q_yHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<yoctohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yHz(long double l) { return frequency<yoctohertz, long double>(l); }
// zHz
constexpr auto operator"" _q_zHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<zeptohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zHz(long double l) { return frequency<zeptohertz, long double>(l); }
// aHz
constexpr auto operator"" _q_aHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<attohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aHz(long double l) { return frequency<attohertz, long double>(l); }
// fHz
constexpr auto operator"" _q_fHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<femtohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fHz(long double l) { return frequency<femtohertz, long double>(l); }
// pHz
constexpr auto operator"" _q_pHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<picohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pHz(long double l) { return frequency<picohertz, long double>(l); }
// nHz
constexpr auto operator"" _q_nHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<nanohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nHz(long double l) { return frequency<nanohertz, long double>(l); }
// uHz
constexpr auto operator"" _q_uHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<microhertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uHz(long double l) { return frequency<microhertz, long double>(l); }
// mHz
constexpr auto operator"" _q_mHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<millihertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mHz(long double l) { return frequency<millihertz, long double>(l); }
// kHz
constexpr auto operator"" _q_kHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<kilohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kHz(long double l) { return frequency<kilohertz, long double>(l); }
// MHz
constexpr auto operator"" _q_MHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<megahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MHz(long double l) { return frequency<megahertz, long double>(l); }
// GHz
constexpr auto operator"" _q_GHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<gigahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GHz(long double l) { return frequency<gigahertz, long double>(l); }
// THz
constexpr auto operator"" _q_THz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<terahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_THz(long double l) { return frequency<terahertz, long double>(l); }
// PHz
constexpr auto operator"" _q_PHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<petahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PHz(long double l) { return frequency<petahertz, long double>(l); }
// EHz
constexpr auto operator"" _q_EHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<exahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EHz(long double l) { return frequency<exahertz, long double>(l); }
// ZHz
constexpr auto operator"" _q_ZHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<zettahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZHz(long double l) { return frequency<zettahertz, long double>(l); }
// YHz
constexpr auto operator"" _q_YHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<yottahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YHz(long double l) { return frequency<yottahertz, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto Hz = frequency<hertz, one_rep>{};
inline constexpr auto yHz = frequency<yoctohertz, one_rep>{};
inline constexpr auto zHz = frequency<zeptohertz, one_rep>{};
inline constexpr auto aHz = frequency<attohertz, one_rep>{};
inline constexpr auto fHz = frequency<femtohertz, one_rep>{};
inline constexpr auto pHz = frequency<picohertz, one_rep>{};
inline constexpr auto nHz = frequency<nanohertz, one_rep>{};
inline constexpr auto uHz = frequency<microhertz, one_rep>{};
inline constexpr auto mHz = frequency<millihertz, one_rep>{};
inline constexpr auto kHz = frequency<kilohertz, one_rep>{};
inline constexpr auto MHz = frequency<megahertz, one_rep>{};
inline constexpr auto GHz = frequency<gigahertz, one_rep>{};
inline constexpr auto THz = frequency<terahertz, one_rep>{};
inline constexpr auto PHz = frequency<petahertz, one_rep>{};
inline constexpr auto EHz = frequency<exahertz, one_rep>{};
inline constexpr auto ZHz = frequency<zettahertz, one_rep>{};
inline constexpr auto YHz = frequency<yottahertz, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
+68
View File
@@ -0,0 +1,68 @@
// 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 <units/isq/dimensions/heat_capacity.h>
#include <units/isq/si/thermodynamic_temperature.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/quantity.h>
namespace units::isq::si {
struct joule_per_kelvin : unit<joule_per_kelvin> {};
struct joule_per_kilogram_kelvin : unit<joule_per_kilogram_kelvin> {};
struct joule_per_mole_kelvin : unit<joule_per_mole_kelvin> {};
struct dim_heat_capacity : isq::dim_heat_capacity<dim_heat_capacity, joule_per_kelvin, dim_energy, dim_thermodynamic_temperature> {};
struct dim_specific_heat_capacity : isq::dim_specific_heat_capacity<dim_specific_heat_capacity, joule_per_kilogram_kelvin, dim_heat_capacity, dim_mass> {};
struct dim_molar_heat_capacity : isq::dim_molar_heat_capacity<dim_molar_heat_capacity, joule_per_mole_kelvin, dim_heat_capacity, dim_amount_of_substance> {};
template<UnitOf<dim_heat_capacity> U, QuantityValue Rep = double>
using heat_capacity = quantity<dim_heat_capacity, U, Rep>;
template<UnitOf<dim_specific_heat_capacity> U, QuantityValue Rep = double>
using specific_heat_capacity = quantity<dim_specific_heat_capacity, U, Rep>;
template<UnitOf<dim_molar_heat_capacity> U, QuantityValue Rep = double>
using molar_heat_capacity = quantity<dim_molar_heat_capacity, U, Rep>;
inline namespace literals {
// J/K
constexpr auto operator"" _q_J_per_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return heat_capacity<joule_per_kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_K(long double l) { return heat_capacity<joule_per_kelvin, long double>(l); }
// J/(kg·K)
constexpr auto operator"" _q_J_per_kg_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return specific_heat_capacity<joule_per_kilogram_kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_kg_K(long double l) { return specific_heat_capacity<joule_per_kilogram_kelvin, long double>(l); }
// J/(mol·K)
constexpr auto operator"" _q_J_per_mol_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return molar_heat_capacity<joule_per_mole_kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_mol_K(long double l) { return molar_heat_capacity<joule_per_mole_kelvin, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+25
View File
@@ -0,0 +1,25 @@
// 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 <units/isq/si/iau/length.h>
+63
View File
@@ -0,0 +1,63 @@
// 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 <units/isq/si/length.h>
namespace units::isq::si::iau {
// https://en.wikipedia.org/wiki/Light-year
struct light_year : named_scaled_unit<light_year, "ly", no_prefix, ratio(9460730472580800), si::metre> {};
// https://en.wikipedia.org/wiki/Parsec
struct parsec : named_scaled_unit<parsec, "pc", si::prefix, ratio(30'856'775'814'913'673), si::metre> {};
// https://en.wikipedia.org/wiki/Angstrom
struct angstrom : named_scaled_unit<angstrom, "angstrom", no_prefix, ratio(1, 1, -10), si::metre> {};
inline namespace literals {
// ly
constexpr auto operator"" _q_ly(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return si::length<light_year, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ly(long double l) { return si::length<light_year, long double>(l); }
// pc
constexpr auto operator"" _q_pc(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return si::length<parsec, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pc(long double l) { return si::length<parsec, long double>(l); }
// angstrom
constexpr auto operator"" _q_angstrom(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return si::length<angstrom, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_angstrom(long double l) { return si::length<angstrom, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto ly = si::length<light_year, one_rep>{};
inline constexpr auto pc = si::length<parsec, one_rep>{};
inline constexpr auto angstrom = si::length<iau::angstrom, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::iau
@@ -0,0 +1,25 @@
// 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 <units/isq/si/imperial/length.h>
@@ -0,0 +1,54 @@
// 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 <units/isq/si/international/length.h>
namespace units::isq::si::imperial {
// https://en.wikipedia.org/wiki/Chain_(unit)
struct chain : named_scaled_unit<chain, "ch", no_prefix, ratio(22, 1), si::international::yard> {};
// https://en.wikipedia.org/wiki/Rod_(unit)
struct rod : named_scaled_unit<rod, "rd", no_prefix, ratio(1, 4), chain> {};
inline namespace literals {
// ch
constexpr auto operator"" _q_ch(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return si::length<chain, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ch(long double l) { return si::length<chain, long double>(l); }
// rd
constexpr auto operator"" _q_rd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return si::length<rod, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_rd(long double l) { return si::length<rod, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto ch = si::length<chain, one_rep>{};
inline constexpr auto rd = si::length<rod, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si::imperial
+150
View File
@@ -0,0 +1,150 @@
// 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 <units/isq/dimensions/inductance.h>
#include <units/isq/si/magnetic_flux.h>
#include <units/isq/si/electric_current.h>
#include <units/quantity.h>
namespace units::isq::si {
struct henry : named_unit<henry, "H", prefix> {};
struct yoctohenry : prefixed_unit<yoctohenry, yocto, henry> {};
struct zeptohenry : prefixed_unit<zeptohenry, zepto, henry> {};
struct attohenry : prefixed_unit<attohenry, atto, henry> {};
struct femtohenry : prefixed_unit<femtohenry, femto, henry> {};
struct picohenry : prefixed_unit<picohenry, pico, henry> {};
struct nanohenry : prefixed_unit<nanohenry, nano, henry> {};
struct microhenry : prefixed_unit<microhenry, micro, henry> {};
struct millihenry : prefixed_unit<millihenry, milli, henry> {};
struct kilohenry : prefixed_unit<kilohenry, kilo, henry> {};
struct megahenry : prefixed_unit<megahenry, mega, henry> {};
struct gigahenry : prefixed_unit<gigahenry, giga, henry> {};
struct terahenry : prefixed_unit<terahenry, tera, henry> {};
struct petahenry : prefixed_unit<petahenry, peta, henry> {};
struct exahenry : prefixed_unit<exahenry, exa, henry> {};
struct zettahenry : prefixed_unit<zettahenry, zetta, henry> {};
struct yottahenry : prefixed_unit<yottahenry, yotta, henry> {};
struct dim_inductance : isq::dim_inductance<dim_inductance, henry, dim_magnetic_flux, dim_electric_current> {};
template<UnitOf<dim_inductance> U, QuantityValue Rep = double>
using inductance = quantity<dim_inductance, U, Rep>;
inline namespace literals {
// H
constexpr auto operator"" _q_H(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<henry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_H(long double l) { return inductance<henry, long double>(l); }
// yH
constexpr auto operator"" _q_yH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<yoctohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yH(long double l) { return inductance<yoctohenry, long double>(l); }
// zH
constexpr auto operator"" _q_zH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<zeptohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zH(long double l) { return inductance<zeptohenry, long double>(l); }
// aH
constexpr auto operator"" _q_aH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<attohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aH(long double l) { return inductance<attohenry, long double>(l); }
// fH
constexpr auto operator"" _q_fH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<femtohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fH(long double l) { return inductance<femtohenry, long double>(l); }
// pH
constexpr auto operator"" _q_pH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<picohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pH(long double l) { return inductance<picohenry, long double>(l); }
// nH
constexpr auto operator"" _q_nH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<nanohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nH(long double l) { return inductance<nanohenry, long double>(l); }
// µH
constexpr auto operator"" _q_uH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<microhenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uH(long double l) { return inductance<microhenry, long double>(l); }
// mH
constexpr auto operator"" _q_mH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<millihenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mH(long double l) { return inductance<millihenry, long double>(l); }
// kH
constexpr auto operator"" _q_kH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<kilohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kH(long double l) { return inductance<kilohenry, long double>(l); }
// MH
constexpr auto operator"" _q_MH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<megahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MH(long double l) { return inductance<megahenry, long double>(l); }
// GH
constexpr auto operator"" _q_GH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<gigahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GH(long double l) { return inductance<gigahenry, long double>(l); }
// TH
constexpr auto operator"" _q_TH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<terahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TH(long double l) { return inductance<terahenry, long double>(l); }
// PH
constexpr auto operator"" _q_PH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<petahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PH(long double l) { return inductance<petahenry, long double>(l); }
// EH
constexpr auto operator"" _q_EH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<exahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EH(long double l) { return inductance<exahenry, long double>(l); }
// ZH
constexpr auto operator"" _q_ZH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<zettahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZH(long double l) { return inductance<zettahenry, long double>(l); }
// YH
constexpr auto operator"" _q_YH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<yottahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YH(long double l) { return inductance<yottahenry, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto H = inductance<henry, one_rep>{};
inline constexpr auto yH = inductance<yoctohenry, one_rep>{};
inline constexpr auto zH = inductance<zeptohenry, one_rep>{};
inline constexpr auto aH = inductance<attohenry, one_rep>{};
inline constexpr auto fH = inductance<femtohenry, one_rep>{};
inline constexpr auto pH = inductance<picohenry, one_rep>{};
inline constexpr auto nH = inductance<nanohenry, one_rep>{};
inline constexpr auto uH = inductance<microhenry, one_rep>{};
inline constexpr auto mH = inductance<millihenry, one_rep>{};
inline constexpr auto kH = inductance<kilohenry, one_rep>{};
inline constexpr auto MH = inductance<megahenry, one_rep>{};
inline constexpr auto GH = inductance<gigahenry, one_rep>{};
inline constexpr auto TH = inductance<terahenry, one_rep>{};
inline constexpr auto PH = inductance<petahenry, one_rep>{};
inline constexpr auto EH = inductance<exahenry, one_rep>{};
inline constexpr auto ZH = inductance<zettahenry, one_rep>{};
inline constexpr auto YH = inductance<yottahenry, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si

Some files were not shown because too many files have changed in this diff Show More