forked from mpusz/mp-units
feat: ISQ quantity names conflicts resolved with inline namespaces
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include <units/isq/space_and_time.h>
|
||||
#include <units/quantity_spec.h>
|
||||
|
||||
namespace units::isq {
|
||||
namespace units::isq::inline electromagnetism {
|
||||
|
||||
QUANTITY_SPEC(electric_charge, electric_current* time);
|
||||
QUANTITY_SPEC(electric_charge_density, electric_charge / volume);
|
||||
@@ -106,9 +106,8 @@ QUANTITY_SPEC(coupling_factor, mutual_inductance / pow<1, 2>(pow<2>(self_inducta
|
||||
QUANTITY_SPEC(leakage_factor, pow<2>(coupling_factor));
|
||||
QUANTITY_SPEC(conductivity, electric_current_density / electric_field_strength, quantity_character::scalar);
|
||||
QUANTITY_SPEC(resistivity, 1 / conductivity);
|
||||
// QUANTITY_SPEC(power, voltage* electric_current); // TODO conflicts with mechanical power
|
||||
// inline constexpr auto instantaneous_power = power;
|
||||
QUANTITY_SPEC(instantaneous_power, voltage* electric_current);
|
||||
QUANTITY_SPEC(power, voltage* electric_current);
|
||||
inline constexpr auto instantaneous_power = power;
|
||||
QUANTITY_SPEC(resistance, voltage / electric_current);
|
||||
QUANTITY_SPEC(conductance, 1 / resistance);
|
||||
QUANTITY_SPEC(phase_difference, phase_angle);
|
||||
@@ -135,4 +134,4 @@ QUANTITY_SPEC(reactive_power, complex_power);
|
||||
QUANTITY_SPEC(non_active_power, pow<1, 2>(pow<2>(apparent_power)));
|
||||
QUANTITY_SPEC(active_energy, instantaneous_power* time);
|
||||
|
||||
} // namespace units::isq
|
||||
} // namespace units::isq::inline electromagnetism
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <units/isq/space_and_time.h>
|
||||
#include <units/quantity_spec.h>
|
||||
|
||||
namespace units::isq {
|
||||
namespace units::isq::inline mechanics {
|
||||
|
||||
QUANTITY_SPEC(mass_density, mass / volume);
|
||||
inline constexpr auto density = mass_density;
|
||||
@@ -99,11 +99,11 @@ QUANTITY_SPEC(kinetic_energy, mass* pow<2>(speed));
|
||||
QUANTITY_SPEC(mechanical_energy, potential_energy);
|
||||
QUANTITY_SPEC(mechanical_work, force* displacement, quantity_character::scalar);
|
||||
inline constexpr auto work = mechanical_work;
|
||||
QUANTITY_SPEC(efficiency_mechanics, power / power);
|
||||
QUANTITY_SPEC(efficiency, power / power);
|
||||
QUANTITY_SPEC(mass_flow, mass_density* velocity); // vector
|
||||
QUANTITY_SPEC(mass_flow_rate, mass_flow* area, quantity_character::scalar);
|
||||
QUANTITY_SPEC(mass_change_rate, mass / time);
|
||||
QUANTITY_SPEC(volume_flow_rate, velocity* area, quantity_character::scalar);
|
||||
QUANTITY_SPEC(action, mechanical_energy* time);
|
||||
|
||||
} // namespace units::isq
|
||||
} // namespace units::isq::inline mechanics
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <units/isq/base_quantities.h>
|
||||
#include <units/quantity_spec.h>
|
||||
|
||||
namespace units::isq {
|
||||
namespace units::isq::inline space_and_time {
|
||||
|
||||
QUANTITY_SPEC(width, length);
|
||||
inline constexpr auto breadth = width;
|
||||
@@ -82,4 +82,4 @@ QUANTITY_SPEC(phase_coefficient, phase_angle / path_length);
|
||||
QUANTITY_SPEC(propagation_coefficient, 1 / length); // γ = α + iβ where α denotes attenuation
|
||||
// and β the phase coefficient of a plane wave
|
||||
|
||||
} // namespace units::isq
|
||||
} // namespace units::isq::inline space_and_time
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <units/isq/space_and_time.h>
|
||||
#include <units/quantity_spec.h>
|
||||
|
||||
namespace units::isq {
|
||||
namespace units::isq::inline thermodynamics {
|
||||
|
||||
QUANTITY_SPEC(Celsius_temperature, thermodynamic_temperature); // TODO should we account for T0 here?
|
||||
QUANTITY_SPEC(linear_expansion_coefficient, 1 / length * (length / thermodynamic_temperature));
|
||||
@@ -79,7 +79,7 @@ inline constexpr auto specific_Gibbs_function = specific_Gibbs_energy;
|
||||
QUANTITY_SPEC(Massieu_function, Helmholtz_energy / thermodynamic_temperature); // TODO how to handle "negative" part
|
||||
QUANTITY_SPEC(Planck_function, Gibbs_energy / thermodynamic_temperature); // TODO how to handle "negative" part
|
||||
QUANTITY_SPEC(Joule_Thomson_coefficient, thermodynamic_temperature / pressure);
|
||||
QUANTITY_SPEC(efficiency_thermodynamics, work / heat);
|
||||
QUANTITY_SPEC(efficiency, work / heat);
|
||||
QUANTITY_SPEC(maximum_efficiency, thermodynamic_temperature / thermodynamic_temperature);
|
||||
QUANTITY_SPEC(specific_gas_constant, entropy / mass);
|
||||
QUANTITY_SPEC(mass_concentration_of_water, mass / volume);
|
||||
@@ -95,4 +95,4 @@ QUANTITY_SPEC(relative_mass_ratio_of_vapour,
|
||||
mass_ratio_of_water_vapour_to_dry_gas / mass_ratio_of_water_vapour_to_dry_gas);
|
||||
QUANTITY_SPEC(dew_point_temperature, thermodynamic_temperature);
|
||||
|
||||
} // namespace units::isq
|
||||
} // namespace units::isq::inline thermodynamics
|
||||
|
||||
Reference in New Issue
Block a user