From 3d18cae364f9a7fc316ff230fe8b43d910c03b86 Mon Sep 17 00:00:00 2001 From: Jonah Miller Date: Mon, 16 Dec 2024 12:10:58 -0700 Subject: [PATCH] tests work --- singularity-eos/eos/modifiers/zsplit_eos.hpp | 12 ++++++------ test/CMakeLists.txt | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/singularity-eos/eos/modifiers/zsplit_eos.hpp b/singularity-eos/eos/modifiers/zsplit_eos.hpp index d8730bfcca..227fa857e0 100644 --- a/singularity-eos/eos/modifiers/zsplit_eos.hpp +++ b/singularity-eos/eos/modifiers/zsplit_eos.hpp @@ -238,13 +238,13 @@ class ZSplit : public EosBase> { private: static constexpr const int NL = 1; - template - PORTABLE_FORCEINLINE_FUNCTION Real GetIonizationState_(const Indexer_t &&lambda) const { + template + PORTABLE_FORCEINLINE_FUNCTION Real GetIonizationState_(Indexer_t &&lambda) const { return std::max(0.0, lambda[t_.nlambda()]); } // TODO(JMM): Runtime? - template - PORTABLE_FORCEINLINE_FUNCTION Real GetScale_(const Indexer_t &&lambda) const { + template + PORTABLE_FORCEINLINE_FUNCTION Real GetScale_(Indexer_t &&lambda) const { Real Z = GetIonizationState_(lambda); if constexpr (ztype == ZSplitComponent::Electrons) { return robust::ratio(Z, Z + 1); @@ -252,8 +252,8 @@ class ZSplit : public EosBase> { return robust::ratio(1.0, Z + 1); } } - template - PORTABLE_FORCEINLINE_FUNCTION Real GetInvScale_(const Indexer_t &&lambda) const { + template + PORTABLE_FORCEINLINE_FUNCTION Real GetInvScale_(Indexer_t &&lambda) const { Real Z = GetIonizationState_(lambda); if constexpr (ztype == ZSplitComponent::Electrons) { return robust::ratio(Z + 1, Z); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 318f469387..77ffc4183c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,6 +24,7 @@ add_executable( test_eos_vinet.cpp test_eos_mgusup.cpp test_eos_powermg.cpp + test_eos_zsplit.cpp ) add_executable(