diff --git a/src/include/serif/equations/angular_momentum.hpp b/src/include/serif/equations/angular_momentum.hpp index 31cc8a19..dfae06d6 100644 --- a/src/include/serif/equations/angular_momentum.hpp +++ b/src/include/serif/equations/angular_momentum.hpp @@ -201,6 +201,9 @@ namespace serif::equations serif_ensure(std::isfinite(axial_moment_of_inertia) && axial_moment_of_inertia >= 0.0, "The moment of inertia must be finite and nonnegative."); } + /** @brief Inspect the physical rotation axis and origin. */ + [[nodiscard]] const RigidRotation& rotation() const noexcept { return m_unit_rotation; } + private: double m_target_axial_angular_momentum; ///< The prescribed total angular momentum along the rotation axis, \f$ J_{\text{target}} \geq 0 \f$. RigidRotation m_unit_rotation; ///< The unit rotation, storing the normalized axis and its origin, used to compute \f$s^{2}\f$ and its gradient. diff --git a/src/include/serif/equations/arithmetic.hpp b/src/include/serif/equations/arithmetic.hpp index 46eac4ad..0d0d9976 100644 --- a/src/include/serif/equations/arithmetic.hpp +++ b/src/include/serif/equations/arithmetic.hpp @@ -7,7 +7,7 @@ * @brief File containing the EquationScale and EquationSum templates, which allow for scaling and summing equations. * * The astute observer will notice that none of the code in this file or indeed in in any part of the equations module actually implements summation or scaled - * addition more generally. Rather, the code to manage that is implemented in the operator/backend/mfem module. Effectively these + * addition more generally. Rather, the code to manage that is implemented in the backend/mfem/operators module. Effectively these * templates are compile time tags telling that system how to combine weak contributions. The reason for this comes down to we dont really want to sum * at the point wise level; rather, we generally want to sum already integrated contributions. Since equations, by design, do not know any details about * the global system they are unable to manage this themselves. diff --git a/src/include/serif/equations/barotropic_closure.hpp b/src/include/serif/equations/barotropic_closure.hpp index 7990a142..d8f637b5 100644 --- a/src/include/serif/equations/barotropic_closure.hpp +++ b/src/include/serif/equations/barotropic_closure.hpp @@ -162,6 +162,12 @@ namespace serif::equations { return 0; } + /** @brief Inspect the immutable EOS defining this closure. */ + [[nodiscard]] const EOST& equation_of_state() const noexcept { return m_eos; } + + /** @brief Inspect the declared power used to choose quadrature. */ + [[nodiscard]] double enthalpy_power() const noexcept { return m_enthalpy_power; } + private: EOST m_eos; ///< The equation of state to use for the barotropic closure. (@todo should this be a reference?) double m_enthalpy_power; ///< The power of the enthalpy to use for the quadrature. Must be positive and finite. This is only used if the ::additional_order method is called. diff --git a/src/include/serif/equations/central_density.hpp b/src/include/serif/equations/central_density.hpp index c7e097f5..cd831b05 100644 --- a/src/include/serif/equations/central_density.hpp +++ b/src/include/serif/equations/central_density.hpp @@ -123,6 +123,9 @@ namespace serif::equations { return eos::evaluate(m_eos, enthalpy); } + /** @brief Inspect the EOS defining the target central enthalpy. */ + [[nodiscard]] const EOST& equation_of_state() const noexcept { return m_eos; } + private: EOST m_eos; ///< The EOS model to use for evaluating the enthalpy from the prescribed density. dimensions::DensityValue m_target_density; ///< The prescribed central density, which must be finite and strictly positive. diff --git a/src/include/serif/equations/equations.hpp b/src/include/serif/equations/equations.hpp index e69de29b..e3d15656 100644 --- a/src/include/serif/equations/equations.hpp +++ b/src/include/serif/equations/equations.hpp @@ -0,0 +1,29 @@ +#pragma once + +/** + * @file equations.hpp + * @author Emily M. Boudreaux + * + * @brief File containing the equations module. This module contains the equations used in the SERiF framework. + */ + +//TODO: Add a detailed worked example here +namespace serif::equations {} + +#include "serif/equations/angular_momentum.hpp" +#include "serif/equations/arithmetic.hpp" +#include "serif/equations/barotropic_closure.hpp" +#include "serif/equations/centering.hpp" +#include "serif/equations/central_density.hpp" +#include "serif/equations/concepts.hpp" +#include "serif/equations/contributions.hpp" +#include "serif/equations/displacement_force.hpp" +#include "serif/equations/gravity_force.hpp" +#include "serif/equations/hydrostatic_equilibrium.hpp" +#include "serif/equations/mass_normalization.hpp" +#include "serif/equations/mixed_gravity.hpp" +#include "serif/equations/point.hpp" +#include "serif/equations/pressure_force.hpp" +#include "serif/equations/registry.hpp" +#include "serif/equations/rigid_rotation.hpp" +#include "serif/equations/rotational_force.hpp" diff --git a/src/include/serif/equations/hydrostatic_equilibrium.hpp b/src/include/serif/equations/hydrostatic_equilibrium.hpp index 5b9eec95..80ad8d8b 100644 --- a/src/include/serif/equations/hydrostatic_equilibrium.hpp +++ b/src/include/serif/equations/hydrostatic_equilibrium.hpp @@ -184,6 +184,9 @@ namespace serif::equations { } } + /** @brief Inspect the physical rotation axis and origin. */ + [[nodiscard]] const RigidRotation& rotation() const noexcept { return m_rotation; } + private: RigidRotation m_rotation; ///< The rigid rotation object used to compute the centrifugal potential and its gradient. This is constructed from the axis and center of rotation provided to the constructor. }; diff --git a/src/include/serif/equations/pressure_force.hpp b/src/include/serif/equations/pressure_force.hpp index 63f21ff2..ecdd9d34 100644 --- a/src/include/serif/equations/pressure_force.hpp +++ b/src/include/serif/equations/pressure_force.hpp @@ -147,6 +147,12 @@ namespace serif::equations { return static_cast(extra); } + /** @brief Inspect the immutable EOS defining pressure. */ + [[nodiscard]] const EOST& equation_of_state() const noexcept { return m_eos; } + + /** @brief Inspect the declared power used to choose quadrature. */ + [[nodiscard]] double enthalpy_power() const noexcept { return m_enthalpy_power; } + private: EOST m_eos; ///< The EOS model to use for evaluating the pressure from the specific enthalpy. double m_enthalpy_power; ///< The effective power of the pressure as a function of specific enthalpy, which must be positive and finite. This is used for quadrature selection. diff --git a/src/include/serif/equations/rotational_force.hpp b/src/include/serif/equations/rotational_force.hpp index 4ba6c642..0ea5b37f 100644 --- a/src/include/serif/equations/rotational_force.hpp +++ b/src/include/serif/equations/rotational_force.hpp @@ -108,6 +108,9 @@ namespace serif::equations { return Density::FunctionalSpace::order + position_order; } + /** @brief Inspect the physical rotation axis and origin. */ + [[nodiscard]] const RigidRotation& rotation() const noexcept { return m_rotation; } + private: RigidRotation m_rotation; ///< The rigid rotation object used to compute the centrifugal potential and its derivatives, which is constructed from the axis and center of rotation provided to the constructor. };