.. _program_listing_file_src_specsyn_SpecsynLibWR.hpp: Program Listing for File SpecsynLibWR.hpp ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/specsyn/SpecsynLibWR.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef SPECSYNLIBWR_HPP #define SPECSYNLIBWR_HPP #include "../io/SimControls.hpp" #include "Specsyn.hpp" #include "SpecsynCommons.hpp" #include "SpecsynLib.hpp" #include #include #include #include #include // NOLINT(misc-include-cleaner) #include #include #include namespace specsyn { template class SpecsynLibWR : public SpecsynLib { public: SpecsynLibWR( const std::string& spectraName, double fehMin, double fehMax, const std::string& registryName, double wlMin, double wlMax, std::size_t nWl, const io::SimControls& controls); [[nodiscard]] auto spec(const Specsyn::StarData& props, double feh) const -> std::vector override; [[nodiscard]] auto specForce(const Specsyn::StarData& props, double feh) const -> std::vector override; enum class WRType : std::uint8_t { None, // NOLINT(readability-identifier-naming) -- capitalized to match WNE/WNL/WC's fixed spectral-classification naming below, rather than the project's usual camelBack enum-constant convention WNE, // NOLINT(readability-identifier-naming) -- WNE is a fixed spectral-classification abbreviation; lowercasing it would make it unrecognizable WNLH20, // NOLINT(readability-identifier-naming) -- see WNE WNLH40, // NOLINT(readability-identifier-naming) -- see WNE WNLH60, // NOLINT(readability-identifier-naming) -- see WNE WC // NOLINT(readability-identifier-naming) -- see WNE }; [[nodiscard]] static auto getWRType( const Specsyn::StarData& props, const std::array, 3>& wnlTeffRanges, double normalLogTeffMax) -> WRType; [[nodiscard]] auto type() const -> WRType { return type_; } void setWNLTeffRanges(const std::array, 3>& ranges) { wnlTeffRanges_ = ranges; } void setNormalLogTeffMax(const double logTeffMax) { normalLogTeffMax_ = logTeffMax; } [[nodiscard]] auto wnlTeffRanges() const -> const std::array, 3>& { return wnlTeffRanges_; } [[nodiscard]] auto normalLogTeffMax() const -> double { return normalLogTeffMax_; } [[nodiscard]] auto logTeff() const -> const std::vector& { return logTeff_; } [[nodiscard]] auto fehMin() const -> double override { return FeH_.front(); } [[nodiscard]] auto fehMax() const -> double override { return FeH_.back(); } private: [[nodiscard]] auto computeRawLogRt(const Specsyn::StarData& props, double feh) const -> double; using ScalarGrid = std::mdspan>; // NOLINT(misc-include-cleaner) -- see the identical NOLINT on SpecsynLib.hpp's SpectraGrid alias // References into the parent class's dim1_/dim2_/dim3_, named // for what they actually hold in this (FeH, log_rt, log_teff) // specialization -- see SpecsynLibNoWind's identical FeH_, // logg_, Teff_ pattern, and its own NOLINT justification for // why these are references rather than owned copies. std::vector& FeH_; // NOLINT(readability-identifier-naming, cppcoreguidelines-avoid-const-or-ref-data-members) std::vector& logRt_; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members) std::vector& logTeff_; // NOLINT(readability-identifier-naming, cppcoreguidelines-avoid-const-or-ref-data-members) std::vector logL_; ScalarGrid logLGrid_; std::vector dInf_; WRType type_; std::array, 3> wnlTeffRanges_ = {{ {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}, {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}, {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}, }}; double normalLogTeffMax_ = std::numeric_limits::quiet_NaN(); }; } // namespace specsyn #endif // SPECSYNLIBWR_HPP