Program Listing for File Winds.hpp
↰ Return to documentation for file (src/feedback/Winds.hpp)
#ifndef WINDS_HPP
#define WINDS_HPP
#include "../specsyn/Specsyn.hpp"
#include <array>
namespace io
{
class SimControls;
} // namespace io
namespace feedback
{
class Winds
{
public:
explicit Winds(const io::SimControls& controls) :
controls_(controls) { }
// Copyable and movable (matching the C++ reference semantics
// of controls_, which just gets rebound to the same referent
// on copy), but assignment is deleted since a reference member
// cannot be rebound after construction -- same pattern as
// Specsyn's own controls_ (see its own comment)
Winds(const Winds&) = default;
Winds(Winds&&) = default;
auto operator=(const Winds&) -> Winds& = delete;
auto operator=(Winds&&) -> Winds& = delete;
~Winds() = default;
[[nodiscard]] auto controls() const -> const io::SimControls& { return controls_; }
[[nodiscard]] auto vWindWR(const specsyn::Specsyn::StarData& props) const -> double;
[[nodiscard]] auto vWindOB(const specsyn::Specsyn::StarData& props, double feh) const -> double;
[[nodiscard]] auto vWindAGB(const specsyn::Specsyn::StarData& props, double feh) const -> double;
[[nodiscard]] auto vWindOther(const specsyn::Specsyn::StarData& props) const -> double;
[[nodiscard]] auto vWind(const specsyn::Specsyn::StarData& props, double feh) const -> double;
private:
const io::SimControls& controls_; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members) -- deliberately a live reference, not a copy, matching Specsyn's/Extinct's/Yields's own identical controls_ members exactly -- see any of their own comments for why. Only ever used through the same non-copyable-by-assignment pattern as those, so the usual objection (disabling implicit copy/move assignment) doesn't apply in practice.
};
[[nodiscard]] auto windFluxes(const specsyn::Specsyn::StarData& props, const Winds* winds,
double feh) -> std::array<double, 3>;
} // namespace feedback
#endif // WINDS_HPP