Skip to content

Commit

Permalink
Cleanup test PTE structure and remove variant from shared header
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Sep 25, 2024
1 parent 9492f25 commit a3bef97
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ if(SINGULARITY_USE_HIGH_RISK_MATH)
target_compile_definitions(singularity-eos_Interface
INTERFACE SINGULARITY_USE_HIGH_RISK_MATH)
endif()
if (SINGULARITY_USE_TRUE_LOG_GRIDDING)
target_compile_definitions(singularity-eos_Interface
SINGULARITY_USE_TRUE_LOG_GRIDDING)
endif()
if(SINGULARITY_TEST_SESAME)
target_compile_definitions(singularity-eos_Interface INTERFACE SINGULARITY_TEST_SESAME)
endif()
Expand Down
8 changes: 4 additions & 4 deletions test/pte_longtest_2phaseVinetSn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ inline void set_eos(T *eos) {
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};

EOS Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
EOS Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405,
0.2161e07, 1.025e09, 0.5051e07, d2to40);
T Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
T Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405, 0.2161e07,
1.025e09, 0.5051e07, d2to40);
eos[0] = Snbeta.GetOnDevice();
eos[1] = Sngamma.GetOnDevice();
return;
Expand Down
8 changes: 4 additions & 4 deletions test/pte_test_2phaseVinetSn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ inline void set_eos(T *eos) {
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};

EOS Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
EOS Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405,
0.2161e07, 1.025e09, 0.5051e07, d2to40);
T Snbeta = singularity::Vinet(7.285, 298.0, 0.529e12, 5.3345, 0.000072977, 0.2149e07,
0.658e09, 0.4419e07, d2to40);
T Sngamma = singularity::Vinet(7.271, 298.0, 0.3878e12, 6.0532, 0.0001085405, 0.2161e07,
1.025e09, 0.5051e07, d2to40);
eos[0] = Snbeta.GetOnDevice();
eos[1] = Sngamma.GetOnDevice();
return;
Expand Down
14 changes: 6 additions & 8 deletions test/pte_test_first.hpp → test/pte_test_3mat_analytic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ constexpr int HIST_SIZE = 10;
using singularity::DavisProducts;
using singularity::DavisReactants;
using singularity::Gruneisen;
using singularity::Variant;
using EOS = Variant<Gruneisen, DavisReactants, DavisProducts>;

template <typename T>
inline void set_eos(T *eos) {
EOS gr = singularity::Gruneisen(394000.0, 1.489, 0.0, 0.0, 2.02, 0.47, 8.93, 297.0,
1.0e6, 0.383e7);
EOS dr = singularity::DavisReactants(1.890, 4.115e10, 1.0e6, 297.0, 1.8e5, 4.6, 0.34,
0.56, 0.0, 0.4265, 0.001074e10);
EOS dp = singularity::DavisProducts(0.798311, 0.58, 1.35, 2.66182, 0.75419, 3.2e10,
0.001072e10);
T gr = singularity::Gruneisen(394000.0, 1.489, 0.0, 0.0, 2.02, 0.47, 8.93, 297.0, 1.0e6,
0.383e7);
T dr = singularity::DavisReactants(1.890, 4.115e10, 1.0e6, 297.0, 1.8e5, 4.6, 0.34,
0.56, 0.0, 0.4265, 0.001074e10);
T dp = singularity::DavisProducts(0.798311, 0.58, 1.35, 2.66182, 0.75419, 3.2e10,
0.001072e10);
eos[0] = gr.GetOnDevice();
eos[1] = dr.GetOnDevice();
eos[2] = dp.GetOnDevice();
Expand Down
6 changes: 3 additions & 3 deletions test/pte_test_5phaseSesameSn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ inline void set_eos(T *eos) {

// bool invert_at_setup = true;

EOS Snbeta = singularity::EOSPAC(SnbetaID);
EOS Sngamma = singularity::EOSPAC(SngammaID);
T Snbeta = singularity::EOSPAC(SnbetaID);
T Sngamma = singularity::EOSPAC(SngammaID);
// EOS Sndelta = singularity::EOSPAC(SndeltaID);
EOS Snhcp = singularity::EOSPAC(SnhcpID);
T Snhcp = singularity::EOSPAC(SnhcpID);
// EOS Snliquid = singularity::EOSPAC(SnliquidID);

eos[0] = Snbeta.GetOnDevice();
Expand Down
1 change: 1 addition & 0 deletions test/test_get_sg_eos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <stdlib.h>

#include <ports-of-call/portability.hpp>
#include <pte_test_3mat_analytic.hpp>
#include <pte_test_utils.hpp>
#include <singularity-eos/closure/mixed_cell_models.hpp>
#include <singularity-eos/eos/eos.hpp>
Expand Down
4 changes: 3 additions & 1 deletion test/test_pte.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <ports-of-call/portability.hpp>
#include <ports-of-call/portable_arrays.hpp>
#include <pte_test_first.hpp>
#include <pte_test_3mat_analytic.hpp>
#include <pte_test_utils.hpp>
#include <singularity-eos/closure/mixed_cell_models.hpp>
#include <spiner/databox.hpp>
Expand All @@ -32,6 +32,8 @@
using DataBox = Spiner::DataBox<Real>;
using singularity::PTESolverRhoT;
using singularity::PTESolverRhoTRequiredScratch;
using singularity::Variant;
using EOS = Variant<Gruneisen, DavisReactants, DavisProducts>;

int main(int argc, char *argv[]) {

Expand Down
3 changes: 1 addition & 2 deletions test/test_pte_2phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
#include <singularity-eos/eos/eos_models.hpp>
#include <singularity-eos/eos/eos_variant.hpp>

// these two headers share a variant
using EOS = singularity::Variant<singularity::Vinet>;
#include <pte_longtest_2phaseVinetSn.hpp>
#include <pte_test_2phaseVinetSn.hpp>

using namespace pte_longtest_2phaseVinetSn;
using singularity::PTESolverRhoT;
using singularity::PTESolverRhoTRequiredScratch;
using EOS = singularity::Variant<singularity::Vinet>;

using DataBox = Spiner::DataBox<Real>;

Expand Down
2 changes: 1 addition & 1 deletion test/test_pte_3phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include <singularity-eos/eos/eos_models.hpp>
#include <singularity-eos/eos/eos_variant.hpp>

using EOS = singularity::Variant<singularity::EOSPAC>;
#include <pte_test_5phaseSesameSn.hpp>

using DataBox = Spiner::DataBox<Real>;
using singularity::PTESolverRhoT;
using singularity::PTESolverRhoTRequiredScratch;
using EOS = singularity::Variant<singularity::EOSPAC>;

int main(int argc, char *argv[]) {

Expand Down

0 comments on commit a3bef97

Please sign in to comment.