Skip to content

Commit

Permalink
Update nomenclature (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
acodcha authored Aug 5, 2024
1 parent 96ff419 commit dccb6f1
Show file tree
Hide file tree
Showing 12 changed files with 621 additions and 592 deletions.
58 changes: 29 additions & 29 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ phq_library(
":DimensionalScalar",
":ScalarStrain",
":TemperatureDifference",
":Unit/ThermalExpansion",
":Unit/ReciprocalTemperature",
],
)

Expand Down Expand Up @@ -2736,6 +2736,33 @@ phq_test(
],
)

phq_library(
name = "Unit/ReciprocalTemperature",
hdrs = ["include/PhQ/Unit/ReciprocalTemperature.hpp"],
deps = [
":Base",
":Dimension/ElectricCurrent",
":Dimension/Length",
":Dimension/LuminousIntensity",
":Dimension/Mass",
":Dimension/SubstanceAmount",
":Dimension/Temperature",
":Dimension/Time",
":Dimensions",
":Unit",
":UnitSystem",
],
)

phq_test(
name = "test/Unit/ReciprocalTemperature",
srcs = ["test/Unit/ReciprocalTemperature.cpp"],
deps = [
":Unit/ReciprocalTemperature",
":test/Unit",
],
)

phq_library(
name = "Unit/SolidAngle",
hdrs = ["include/PhQ/Unit/SolidAngle.hpp"],
Expand Down Expand Up @@ -3006,33 +3033,6 @@ phq_test(
],
)

phq_library(
name = "Unit/ThermalExpansion",
hdrs = ["include/PhQ/Unit/ThermalExpansion.hpp"],
deps = [
":Base",
":Dimension/ElectricCurrent",
":Dimension/Length",
":Dimension/LuminousIntensity",
":Dimension/Mass",
":Dimension/SubstanceAmount",
":Dimension/Temperature",
":Dimension/Time",
":Dimensions",
":Unit",
":UnitSystem",
],
)

phq_test(
name = "test/Unit/ThermalExpansion",
srcs = ["test/Unit/ThermalExpansion.cpp"],
deps = [
":Unit/ThermalExpansion",
":test/Unit",
],
)

phq_library(
name = "Unit/Time",
hdrs = ["include/PhQ/Unit/Time.hpp"],
Expand Down Expand Up @@ -3288,7 +3288,7 @@ phq_library(
":DimensionalScalar",
":Strain",
":TemperatureDifference",
":Unit/ThermalExpansion",
":Unit/ReciprocalTemperature",
],
)

Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,9 @@ if(PHYSICAL_QUANTITIES_PHQ_TEST)
target_link_libraries(unit_thermal_conductivity GTest::gtest_main)
gtest_discover_tests(unit_thermal_conductivity)

add_executable(unit_thermal_expansion ${PROJECT_SOURCE_DIR}/test/Unit/ThermalExpansion.cpp)
target_link_libraries(unit_thermal_expansion GTest::gtest_main)
gtest_discover_tests(unit_thermal_expansion)
add_executable(unit_reciprocal_temperature ${PROJECT_SOURCE_DIR}/test/Unit/ReciprocalTemperature.cpp)
target_link_libraries(unit_reciprocal_temperature GTest::gtest_main)
gtest_discover_tests(unit_reciprocal_temperature)

add_executable(unit_time ${PROJECT_SOURCE_DIR}/test/Unit/Time.cpp)
target_link_libraries(unit_time GTest::gtest_main)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ The Physical Quantities library features the following units of measure:
- [PhQ::Unit::MemoryRate](include/PhQ/Unit/MemoryRate.hpp)
- [PhQ::Unit::Power](include/PhQ/Unit/Power.hpp)
- [PhQ::Unit::Pressure](include/PhQ/Unit/Pressure.hpp)
- [PhQ::Unit::ReciprocalTemperature](include/PhQ/Unit/ReciprocalTemperature.hpp)
- [PhQ::Unit::SolidAngle](include/PhQ/Unit/SolidAngle.hpp)
- [PhQ::Unit::SpecificEnergy](include/PhQ/Unit/SpecificEnergy.hpp)
- [PhQ::Unit::SpecificHeatCapacity](include/PhQ/Unit/SpecificHeatCapacity.hpp)
Expand All @@ -717,7 +718,6 @@ The Physical Quantities library features the following units of measure:
- [PhQ::Unit::TemperatureDifference](include/PhQ/Unit/TemperatureDifference.hpp)
- [PhQ::Unit::TemperatureGradient](include/PhQ/Unit/TemperatureGradient.hpp)
- [PhQ::Unit::ThermalConductivity](include/PhQ/Unit/ThermalConductivity.hpp)
- [PhQ::Unit::ThermalExpansion](include/PhQ/Unit/ThermalExpansion.hpp)
- [PhQ::Unit::Time](include/PhQ/Unit/Time.hpp)
- [PhQ::Unit::TransportEnergyConsumption](include/PhQ/Unit/TransportEnergyConsumption.hpp)
- [PhQ::Unit::Volume](include/PhQ/Unit/Volume.hpp)
Expand Down
2 changes: 1 addition & 1 deletion docs/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@
/// - PhQ::Unit::MemoryRate
/// - PhQ::Unit::Power
/// - PhQ::Unit::Pressure
/// - PhQ::Unit::ReciprocalTemperature
/// - PhQ::Unit::SolidAngle
/// - PhQ::Unit::SpecificEnergy
/// - PhQ::Unit::SpecificHeatCapacity
Expand All @@ -719,7 +720,6 @@
/// - PhQ::Unit::TemperatureDifference
/// - PhQ::Unit::TemperatureGradient
/// - PhQ::Unit::ThermalConductivity
/// - PhQ::Unit::ThermalExpansion
/// - PhQ::Unit::Time
/// - PhQ::Unit::TransportEnergyConsumption
/// - PhQ::Unit::Volume
Expand Down
21 changes: 11 additions & 10 deletions include/PhQ/LinearThermalExpansionCoefficient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "DimensionalScalar.hpp"
#include "ScalarStrain.hpp"
#include "TemperatureDifference.hpp"
#include "Unit/ThermalExpansion.hpp"
#include "Unit/ReciprocalTemperature.hpp"

namespace PhQ {

Expand All @@ -42,16 +42,16 @@ namespace PhQ {
/// coefficient.
template <typename NumericType = double>
class LinearThermalExpansionCoefficient
: public DimensionalScalar<Unit::ThermalExpansion, NumericType> {
: public DimensionalScalar<Unit::ReciprocalTemperature, NumericType> {
public:
/// \brief Default constructor. Constructs a linear thermal expansion coefficient with an
/// uninitialized value.
LinearThermalExpansionCoefficient() = default;

/// \brief Constructor. Constructs a linear thermal expansion coefficient with a given value
/// expressed in a given thermal expansion unit.
LinearThermalExpansionCoefficient(const NumericType value, const Unit::ThermalExpansion unit)
: DimensionalScalar<Unit::ThermalExpansion, NumericType>(value, unit) {}
/// expressed in a given reciprocal temperature unit.
LinearThermalExpansionCoefficient(const NumericType value, const Unit::ReciprocalTemperature unit)
: DimensionalScalar<Unit::ReciprocalTemperature, NumericType>(value, unit) {}

/// \brief Destructor. Destroys this linear thermal expansion coefficient.
~LinearThermalExpansionCoefficient() noexcept = default;
Expand Down Expand Up @@ -98,12 +98,13 @@ class LinearThermalExpansionCoefficient
}

/// \brief Statically creates a linear thermal expansion coefficient with a given value expressed
/// in a given thermal expansion unit.
template <Unit::ThermalExpansion Unit>
/// in a given reciprocal temperature unit.
template <Unit::ReciprocalTemperature Unit>
[[nodiscard]] static constexpr LinearThermalExpansionCoefficient<NumericType> Create(
const NumericType value) {
return LinearThermalExpansionCoefficient<NumericType>{
ConvertStatically<Unit::ThermalExpansion, Unit, Standard<Unit::ThermalExpansion>>(value)};
ConvertStatically<Unit::ReciprocalTemperature, Unit, Standard<Unit::ReciprocalTemperature>>(
value)};
}

constexpr LinearThermalExpansionCoefficient<NumericType> operator+(
Expand Down Expand Up @@ -161,9 +162,9 @@ class LinearThermalExpansionCoefficient

private:
/// \brief Constructor. Constructs a linear thermal expansion coefficient with a given value
/// expressed in the standard thermal expansion unit.
/// expressed in the standard reciprocal temperature unit.
explicit constexpr LinearThermalExpansionCoefficient(const NumericType value)
: DimensionalScalar<Unit::ThermalExpansion, NumericType>(value) {}
: DimensionalScalar<Unit::ReciprocalTemperature, NumericType>(value) {}
};

template <typename NumericType>
Expand Down
Loading

0 comments on commit dccb6f1

Please sign in to comment.