From e62a6ed8c5cae366aff2c75e72f0be62cf0832be Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 16:43:43 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/EOS.hpp | 63 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/EOS.hpp b/src/EOS.hpp index 9cfe1f679..5dd288163 100644 --- a/src/EOS.hpp +++ b/src/EOS.hpp @@ -46,7 +46,8 @@ template class EOS [[nodiscard]] AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE static auto ComputeEintFromTgas(amrex::Real rho, amrex::Real Tgas, const std::optional> massScalars = {}) -> amrex::Real; [[nodiscard]] AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE static auto - ComputeEintFromPres(amrex::Real rho, amrex::Real Pressure, const std::optional> massScalars = {}) -> amrex::Real; + ComputeEintFromPres(amrex::Real rho, amrex::Real Pressure, const std::optional> massScalars = {}) + -> amrex::Real; [[nodiscard]] AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE static auto ComputeEintTempDerivative(amrex::Real rho, amrex::Real Tgas, const std::optional> massScalars = {}) -> amrex::Real; @@ -142,47 +143,45 @@ AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintFromTga return Eint; } - template AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintFromPres(amrex::Real rho, amrex::Real Pressure, - const std::optional> massScalars) + const std::optional> massScalars) -> amrex::Real { - // return internal energy density given density and pressure - amrex::Real Eint = NAN; + // return internal energy density given density and pressure + amrex::Real Eint = NAN; #ifdef PRIMORDIAL_CHEM - eos_t chemstate; - chemstate.rho = rho; - chemstate.p = Pressure; - // initialize array of number densities - for (int ii = 0; ii < NumSpec; ++ii) { - chemstate.xn[ii] = -1.0; - } - - if (massScalars) { - const auto &massArray = *massScalars; - for (int nn = 0; nn < nmscalars_; ++nn) { - chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) - } - } - - eos(eos_input_rp, chemstate); - Eint = chemstate.e * chemstate.rho; + eos_t chemstate; + chemstate.rho = rho; + chemstate.p = Pressure; + // initialize array of number densities + for (int ii = 0; ii < NumSpec; ++ii) { + chemstate.xn[ii] = -1.0; + } + + if (massScalars) { + const auto &massArray = *massScalars; + for (int nn = 0; nn < nmscalars_; ++nn) { + chemstate.xn[nn] = massArray[nn] / spmasses[nn]; // massScalars are partial densities (massFractions * rho) + } + } + + eos(eos_input_rp, chemstate); + Eint = chemstate.e * chemstate.rho; #else - if constexpr (gamma_ != 1.0) { - chem_eos_t estate; - estate.rho = rho; - estate.p = Pressure; - estate.mu = mean_molecular_weight_ / C::m_u; - eos(eos_input_rp, estate); - Eint = estate.e * rho * boltzmann_constant_ / C::k_B; - } + if constexpr (gamma_ != 1.0) { + chem_eos_t estate; + estate.rho = rho; + estate.p = Pressure; + estate.mu = mean_molecular_weight_ / C::m_u; + eos(eos_input_rp, estate); + Eint = estate.e * rho * boltzmann_constant_ / C::k_B; + } #endif - return Eint; + return Eint; } - template AMREX_FORCE_INLINE AMREX_GPU_HOST_DEVICE auto EOS::ComputeEintTempDerivative(const amrex::Real rho, const amrex::Real Tgas,