feat(dimensions): added second partial type and new dimensions
This commit is contained in:
@@ -27,6 +27,22 @@ namespace serif::dimensions {
|
||||
template <ThermodynamicQuantityType Quantity>
|
||||
struct WithRespectTo final {};
|
||||
|
||||
/** @brief
|
||||
* A second EOS partial retains both differentiation quantities in its type.
|
||||
*/
|
||||
template <ThermodynamicQuantityType OutputQuantity, ThermodynamicQuantityType FirstInput, ThermodynamicQuantityType SecondInput>
|
||||
class SecondPartialDerivative final {
|
||||
public:
|
||||
/** @brief Store an explicitly evaluated second partial; this type does not differentiate. */
|
||||
explicit constexpr SecondPartialDerivative(double value) noexcept : m_value(value) {}
|
||||
|
||||
/** @brief Return the numeric partial in the caller's physical units. */
|
||||
[[nodiscard]] constexpr double value() const noexcept { return m_value; }
|
||||
|
||||
private:
|
||||
double m_value;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class PartialDerivative
|
||||
*
|
||||
@@ -188,4 +204,4 @@ namespace serif::dimensions {
|
||||
private:
|
||||
double m_value; ///< Numeric value associated with the partial. If this is known at compile time then the compiler can optimize operations with partial.value() to be equivalent to compile time double operations.
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user