Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dholladay00/separate get sg eos #245

Merged
merged 57 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
289f39c
Initial commit on splitting out get_sg_eos to a separate compilation …
dholladay00 Mar 23, 2023
e56b44b
Merge main.
dholladay00 Mar 23, 2023
4c948da
format.
dholladay00 Mar 27, 2023
8ba8a2a
Included file locations moved to correct place, mixed cell models onl…
dholladay00 Mar 27, 2023
ef62d59
format
dholladay00 Mar 27, 2023
27a66ee
Merge branch 'main' into dholladay00/separate_get_sg_eos
dholladay00 Apr 17, 2023
fffa84c
Split get sg eos into several compilation units to reduce compile tim…
Apr 25, 2023
98ad54c
Fixing non-kokkos build issues.
dholladay00 Apr 25, 2023
4d35a16
Formatting.
dholladay00 Apr 25, 2023
da798cc
guard the nowarn.
dholladay00 Apr 25, 2023
c5df26b
remove erroneous pragma from copy-paste.
dholladay00 Apr 25, 2023
acd3349
Added missing portable function.
dholladay00 Apr 25, 2023
1fbcfac
More missing function decorators.
dholladay00 Apr 26, 2023
54dfeec
Minor syntax change to preprocessor logic.
dholladay00 Apr 26, 2023
de35b08
Make macro on new line.
dholladay00 Apr 26, 2023
7f1997a
The macro I created won't work b/c the pragma needs a new line and ne…
dholladay00 Apr 26, 2023
30de7d3
Removed commented out code, get rid of warnings, try to improve compi…
dholladay00 Apr 26, 2023
53ef4db
Remove rdc references in spackages and cmake files.
dholladay00 May 22, 2023
cf23fd5
Make modifier checking/modification functionality inline constexpr to…
dholladay00 May 22, 2023
e196b55
Reverting template parameters, this change was an incorrect change.
dholladay00 May 22, 2023
be1268d
Using execution space arguments for deep copies. This may not improve…
dholladay00 May 22, 2023
2080ef6
Merge main, resolve conflict.
dholladay00 May 22, 2023
ecff459
Format
dholladay00 May 22, 2023
52dc1c9
Make cuda builds release and everything else the default value of rel…
dholladay00 May 22, 2023
9151751
fix mistakes in gitlab changes.
dholladay00 May 23, 2023
3f2cbf9
Updating the cuda compatibility patch to make more usage of constexpr…
dholladay00 May 23, 2023
ea59f83
Moving to earlier cuda versions that passed tests.
dholladay00 May 23, 2023
1c284b2
Adding fences to see if asynchrony was source of issues.
dholladay00 May 23, 2023
946720c
Fixing test failure from setting mutable member in a GPU kernel which…
dholladay00 May 26, 2023
fc07762
format.
dholladay00 May 26, 2023
9b3bdb0
Undoing unneccessary changes.
dholladay00 May 26, 2023
7650792
use global var and anchor in gitlab-ci.yml
ktsai7 May 26, 2023
05231e9
Merge branch 'main' into dholladay00/separate_get_sg_eos
dholladay00 Jun 21, 2023
cc6e5d1
First pass at cleaning up unneccessary functionality in variadic utils.
dholladay00 Jun 28, 2023
4fd4cfd
Merge main.
dholladay00 Aug 3, 2023
63456b3
Only build the get_sg files when closure and (fortran or testing), sh…
dholladay00 Aug 3, 2023
f7736f8
Fix more warnings. Some related to capturing this in modifiers, this …
dholladay00 Aug 3, 2023
0aab253
Fix ci warnings + format.
dholladay00 Aug 4, 2023
1f77a51
try to fix warning.
dholladay00 Aug 4, 2023
1d4fc85
Remove unused variables.
dholladay00 Aug 4, 2023
3748a69
Merge branch 'main' into dholladay00/separate_get_sg_eos
dholladay00 Aug 4, 2023
0dd0268
format.
dholladay00 Aug 4, 2023
ed4e55a
Merge branch 'main' into dholladay00/separate_get_sg_eos
dholladay00 Aug 8, 2023
9774621
Test refactor. The getsgeos tests are now in their own file that resp…
dholladay00 Aug 14, 2023
c9823d2
Merge branch 'main' into dholladay00/separate_get_sg_eos
dholladay00 Aug 14, 2023
bdf02e3
Format.
dholladay00 Aug 14, 2023
a77b090
Switch from lambdas with macros to functors.
dholladay00 Aug 15, 2023
0e37800
Merg main.
dholladay00 Aug 15, 2023
4179042
Merge branch 'main' into dholladay00/cleanup_variadic
dholladay00 Aug 15, 2023
7129f96
Merge branch 'dholladay00/cleanup_variadic' into dholladay00/separate…
dholladay00 Aug 15, 2023
ff334d2
Using individual functions instead of ptofre, this was the source of …
dholladay00 Aug 15, 2023
4b6c859
Change file name to reflect move from lambdas to functors.
dholladay00 Aug 15, 2023
a225052
Remove unused variables.
dholladay00 Aug 15, 2023
5ad4058
Merge branch 'main' into dholladay00/separate_get_sg_eos
dholladay00 Aug 15, 2023
55ceed2
format.
dholladay00 Aug 15, 2023
305f7e6
Correct cmake logic for get_sg_eos. Previously, built with closure an…
dholladay00 Aug 16, 2023
ed5a121
Edit changelog.
dholladay00 Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive
SINGULARITY_EOS_GCC_VERSION: "9.3.0"
SINGULARITY_EOS_OPENMPI_VERSION: "4.1.3"
SINGULARITY_EOS_CUDA_VERSION: "11.6.0"
SINGULARITY_EOS_CUDA_VERSION: "11.4.2"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to change this back, but other than that, can you live with these changes @ktsai7 @Yurlungur ?

Copy link
Contributor

@ktsai7 ktsai7 May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dholladay00 I would probably say to use a global SINGULARITY_EOS_BUILD_TYPE variable and use anchors to change the value in the appropriate jobs instead of doing the export in the lines of code... it's just easier to see this way

I could add a commit for this if you want or don't fully understand what I'm saying

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be appreciated @ktsai7 I don't know what an anchor is.

SINGULARITY_EOS_SPACK_SPEC: "singularity-eos@main+mpi+python+tests%gcc@${SINGULARITY_EOS_GCC_VERSION} ^openmpi@${SINGULARITY_EOS_OPENMPI_VERSION}"
COLOR_CYAN: '\033[1;36m'
COLOR_PLAIN: '\033[0m'
Expand Down Expand Up @@ -121,17 +121,20 @@ before_script:
- spack add ${SINGULARITY_EOS_SPACK_SPEC}
- spack install -j $(nproc) --show-log-on-error --no-checksum --yes-to-all -u cmake
- echo -e "\e[0Ksection_end:`date +%s`:spack_env\r\e[0K"
- export SINGULARITY_BUILD_TYPE="RelWithDebInfo"
- |
if [[ -n ${SINGULARITY_USE_CUDA} ]];
then
export SINGULARITY_NVCC_WRAPPER="$(which nvcc_wrapper)";
export SINGULARITY_CMAKE_CXX_COMPILER_FLAG="-DCMAKE_CXX_COMPILER=${SINGULARITY_NVCC_WRAPPER}";
echo "passing '${SINGULARITY_CMAKE_CXX_COMPILER_FLAG}' to cmake"
export SINGULARITY_BUILD_TYPE="Release";
fi
- mkdir -p build
- cd build
- |
cmake -DCMAKE_INSTALL_PREFIX=${CI_PROJECT_DIR}/install ${SINGULARITY_CMAKE_CXX_COMPILER_FLAG} \
-DCMAKE_BUILD_TYPE=${SINGULARITY_BUILD_TYPE} \
-DSINGULARITY_USE_EOSPAC=ON \
-DSINGULARITY_USE_HDF5=ON \
-DSINGULARITY_BUILD_SESAME2SPINER=ON \
Expand Down
1 change: 0 additions & 1 deletion cmake/submodule_configs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ macro(singularity_cmake_config pkg)
if(SINGULARITY_USE_CUDA)
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "" FORCE)
set(Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE ON CACHE BOOL "" FORCE)
endif()
elseif(${pkg} STREQUAL "KokkosKernels")
# Disable TPLs
Expand Down
18 changes: 15 additions & 3 deletions singularity-eos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#------------------------------------------------------------------------------#

set(EOS_HEADERS
closure/mixed_cell_models.hpp
base/fast-math/logs.hpp
base/robust_utils.hpp
base/root-finding-1d/root_finding.hpp
Expand Down Expand Up @@ -47,12 +46,25 @@ set(EOS_SRCS
)

if (SINGULARITY_BUILD_CLOSURE)
list(APPEND EOS_SRCS eos/singularity_eos.cpp)
list(APPEND EOS_HEADERS eos/singularity_eos.hpp closure/mixed_cell_models.hpp)
list(APPEND EOS_SRCS
eos/get_sg_eos.cpp)
if (SINGULARITY_USE_KOKKOS)
list(APPEND EOS_SRCS
eos/get_sg_eos_p_t.cpp
eos/get_sg_eos_rho_t.cpp
eos/get_sg_eos_rho_p.cpp
eos/get_sg_eos_rho_e.cpp)
endif()
dholladay00 marked this conversation as resolved.
Show resolved Hide resolved
list(APPEND EOS_HEADERS
closure/mixed_cell_models.hpp
eos/get_sg_eos.hpp
eos/get_sg_eos_lambdas.hpp)
endif()

if (SINGULARITY_USE_FORTRAN)
list(APPEND EOS_SRCS eos/singularity_eos.f90)
list(APPEND EOS_SRCS eos/singularity_eos.cpp)
list(APPEND EOS_HEADERS eos/singularity_eos.hpp)
# would rather handle this more robustly, being sloppy for now
list(APPEND EOS_MODS singularity_eos.mod singularity_eos_types.mod)
endif()
Expand Down
12 changes: 6 additions & 6 deletions singularity-eos/closure/mixed_cell_models.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class PTESolverBase {
Cache = CacheAccessor(AssignIncrement(scratch, nmat * MAX_NUM_LAMBDAS));
}

PORTABLE_FORCEINLINE_FUNCTION
PORTABLE_INLINE_FUNCTION
dholladay00 marked this conversation as resolved.
Show resolved Hide resolved
void InitRhoBarandRho() {
// rhobar is a fixed quantity: the average density of
// material m averaged over the full PTE volume
Expand All @@ -217,7 +217,7 @@ class PTESolverBase {
}
}

PORTABLE_FORCEINLINE_FUNCTION
PORTABLE_INLINE_FUNCTION
void SetVfracFromT(const Real T) {
Real vsum = 0.0;
// set volume fractions
Expand All @@ -233,7 +233,7 @@ class PTESolverBase {
}
}

PORTABLE_FORCEINLINE_FUNCTION
PORTABLE_INLINE_FUNCTION
Real GetTguess() {
// guess some non-zero temperature to start
// If a guess was passed in, it's saved in Tnorm
Expand Down Expand Up @@ -272,9 +272,9 @@ class PTESolverBase {
return Tguess;
}

PORTABLE_FORCEINLINE_FUNCTION
static Real GetPressureFromPreferred(const EOS &eos, const Real rho, const Real T,
Real sie, Real *lambda, const bool do_e_lookup) {
PORTABLE_INLINE_FUNCTION
Real GetPressureFromPreferred(const EOS &eos, const Real rho, const Real T, Real sie,
Real *lambda, const bool do_e_lookup) const {
Real P{};
if (eos.PreferredInput() ==
(thermalqs::density | thermalqs::specific_internal_energy)) {
Expand Down
2 changes: 1 addition & 1 deletion singularity-eos/eos/eos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace singularity {
template <typename... Ts>
using tl = singularity::detail::type_list<Ts...>;

template <template <typename> typename... Ts>
template <template <typename> class... Ts>
using al = singularity::detail::adapt_list<Ts...>;

// transform variadic list: applies modifiers to eos's
Expand Down
18 changes: 11 additions & 7 deletions singularity-eos/eos/eos_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ char *StrCat(char *destination, const char *source) {
using EosBase<EOSDERIVED>::FillEos; \
using EosBase<EOSDERIVED>::EntropyFromDensityTemperature; \
using EosBase<EOSDERIVED>::EntropyFromDensityInternalEnergy; \
using EosBase<EOSDERIVED>::EntropyIsNotEnabled;
using EosBase<EOSDERIVED>::EntropyIsNotEnabled; \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume these would be required @Yurlungur, is any of this machinery tested on unmodified Eos's?

Copy link
Collaborator

@jhp-lanl jhp-lanl May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an FYI - I think you can remove this line completely since it's automatically slurped in via inheritance

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @jhp-lanl is correct. I think the machinery is checked on unmodified EOS's explicitly. But even if it is not, the "pull out an unmodified EOS" gets automatically tested on unmodified EOS's because that's the base case of the recursion algorithm.

using EosBase<EOSDERIVED>::IsModified; \
using EosBase<EOSDERIVED>::UnmodifyOnce; \
using EosBase<EOSDERIVED>::GetUnmodifiedObject;

/*
This is a CRTP that allows for static inheritance so that default behavior for
Expand Down Expand Up @@ -426,12 +429,13 @@ class EosBase {
}

// Tooling for modifiers
PORTABLE_FORCEINLINE_FUNCTION
bool IsModified() const { return false; }
PORTABLE_FORCEINLINE_FUNCTION
auto UnmodifyOnce() { return *static_cast<CRTP *>(this); }
PORTABLE_FORCEINLINE_FUNCTION
auto GetUnmodifiedObject() { return *static_cast<CRTP *>(this); }
inline constexpr bool IsModified() const { return false; }
dholladay00 marked this conversation as resolved.
Show resolved Hide resolved

inline constexpr decltype(auto) UnmodifyOnce() { return *static_cast<CRTP *>(this); }

inline constexpr decltype(auto) GetUnmodifiedObject() {
return *static_cast<CRTP *>(this);
}
};
} // namespace eos_base
} // namespace singularity
Expand Down
64 changes: 51 additions & 13 deletions singularity-eos/eos/eos_eospac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,41 +41,62 @@ using namespace eos_base;

// Only really works in serial
// Not really supported on device
#if defined(__CUDACC__)
#define SG_PIF_NOWARN #pragma nv_exec_check_disable
dholladay00 marked this conversation as resolved.
Show resolved Hide resolved
#else
#define SG_PIF_NOWARN
#endif

Yurlungur marked this conversation as resolved.
Show resolved Hide resolved
class EOSPAC : public EosBase<EOSPAC> {
public:
inline EOSPAC() = default;
inline EOSPAC(int matid, bool invert_at_setup = false);
inline EOSPAC GetOnDevice() { return *this; }
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real TemperatureFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real InternalEnergyFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real PressureFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real PressureFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EntropyFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EntropyFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real GruneisenParamFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda = nullptr) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION void FillEos(Real &rho, Real &temp, Real &energy, Real &press,
Real &cv, Real &bmod, const unsigned long output,
Real *lambda = nullptr) const;
PORTABLE_INLINE_FUNCTION
void DensityEnergyFromPressureTemperature(const Real press, const Real temp,
Real *lambda, Real &rho, Real &sie) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION void
DensityEnergyFromPressureTemperature(const Real press, const Real temp, Real *lambda,
Real &rho, Real &sie) const;
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION void ValuesAtReferenceState(Real &rho, Real &temp, Real &sie,
Real &press, Real &cv, Real &bmod,
Real &dpde, Real &dvdt,
Expand Down Expand Up @@ -871,9 +892,10 @@ class EOSPAC : public EosBase<EOSPAC> {
});
}

PORTABLE_INLINE_FUNCTION
void PTofRE(Real &rho, Real &sie, Real *lambda, Real &press, Real &temp, Real &dpdr,
Real &dpde, Real &dtdr, Real &dtde) const {
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION void PTofRE(Real &rho, Real &sie, Real *lambda, Real &press,
Real &temp, Real &dpdr, Real &dpde, Real &dtdr,
Real &dtde) const {

press = PressureFromDensityInternalEnergy(rho, sie, lambda);
temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda);
Expand Down Expand Up @@ -912,7 +934,9 @@ class EOSPAC : public EosBase<EOSPAC> {
inline void Finalize() {}
static std::string EosType() { return std::string("EOSPAC"); }
static std::string EosPyType() { return EosType(); }
inline void PrintParams() const { printf("EOSPAC parameters:\nmatid = %s\n", matid_); }
PORTABLE_INLINE_FUNCTION void PrintParams() const {
printf("EOSPAC parameters:\nmatid = %i\n", matid_);
}
PORTABLE_FORCEINLINE_FUNCTION Real MinimumDensity() const { return rho_min_; }
PORTABLE_FORCEINLINE_FUNCTION Real MinimumTemperature() const { return temp_min_; }

Expand Down Expand Up @@ -1006,6 +1030,7 @@ inline EOSPAC::EOSPAC(const int matid, bool invert_at_setup) : matid_(matid) {
robust::ratio(dpde_ref_ * cv_ref_, rho_ref_ * rho_ref_ * pressureFromSesame(DPDR));
}

SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::TemperatureFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda) const {
using namespace EospacWrapper;
Expand All @@ -1016,6 +1041,7 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::TemperatureFromDensityInternalEnergy(
return Real(temperatureFromSesame(T[0]));
}

SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::PressureFromDensityTemperature(const Real rho,
const Real temp,
Real *lambda) const {
Expand All @@ -1027,12 +1053,14 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::PressureFromDensityTemperature(const Real
return Real(pressureFromSesame(P[0]));
}

SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::EntropyFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda) const {
EntropyIsNotEnabled("EOSPAC");
return 1.0;
}

SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION void EOSPAC::FillEos(Real &rho, Real &temp, Real &sie,
Real &press, Real &cv, Real &bmod,
const unsigned long output,
Expand All @@ -1042,7 +1070,7 @@ PORTABLE_INLINE_FUNCTION void EOSPAC::FillEos(Real &rho, Real &temp, Real &sie,
EOS_REAL E[1] = {sie}, P[1] = {pressureToSesame(press)};
EOS_REAL dx[1], dy[1];
EOS_INTEGER nxypairs = 1;
Real CV, BMOD_T, BMOD, SIE, PRESS, DPDE, DPDT, DPDR, DEDT, DEDR;
Real /*CV,*/ BMOD_T, BMOD, SIE, PRESS, DPDE, DPDT, DPDR, DEDT, DEDR;
const unsigned long input = ~output;
if (output == thermalqs::none) {
UNDEFINED_ERROR;
Expand Down Expand Up @@ -1116,6 +1144,7 @@ PORTABLE_INLINE_FUNCTION void EOSPAC::FillEos(Real &rho, Real &temp, Real &sie,
}
}

SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::InternalEnergyFromDensityTemperature(
const Real rho, const Real temp, Real *lambda) const {
using namespace EospacWrapper;
Expand All @@ -1124,6 +1153,7 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::InternalEnergyFromDensityTemperature(
FillEos(RHO, TEMP, sie, press, cv, bmod, output, lambda);
return sie;
}
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::BulkModulusFromDensityTemperature(
const Real rho, const Real temp, Real *lambda) const {
using namespace EospacWrapper;
Expand All @@ -1132,6 +1162,7 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::BulkModulusFromDensityTemperature(
FillEos(RHO, TEMP, sie, press, cv, bmod, output, lambda);
return bmod;
}
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::SpecificHeatFromDensityTemperature(
const Real rho, const Real temp, Real *lambda) const {
using namespace EospacWrapper;
Expand All @@ -1140,31 +1171,36 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::SpecificHeatFromDensityTemperature(
FillEos(RHO, TEMP, sie, press, cv, bmod, output, lambda);
return cv;
}
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::PressureFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda) const {
using namespace EospacWrapper;
Real temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda);
return PressureFromDensityTemperature(rho, temp, lambda);
}
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::EntropyFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda) const {
using namespace EospacWrapper;
const Real temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda);
return EntropyFromDensityTemperature(rho, temp, lambda);
}
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::SpecificHeatFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda) const {
using namespace EospacWrapper;
Real temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda);
return SpecificHeatFromDensityTemperature(rho, temp, lambda);
}
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::BulkModulusFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda) const {
using namespace EospacWrapper;
Real temp = TemperatureFromDensityInternalEnergy(rho, sie, lambda);
return BulkModulusFromDensityTemperature(rho, temp, lambda);
}

SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::GruneisenParamFromDensityTemperature(
const Real rho, const Real temperature, Real *lambda) const {
using namespace EospacWrapper;
Expand All @@ -1181,22 +1217,23 @@ PORTABLE_INLINE_FUNCTION Real EOSPAC::GruneisenParamFromDensityTemperature(
DPDE = DPDT / DEDT;
return robust::ratio(pressureFromSesame(sieToSesame(DPDE)), rho);
}
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION Real EOSPAC::GruneisenParamFromDensityInternalEnergy(
const Real rho, const Real sie, Real *lambda) const {
Real temperature = TemperatureFromDensityInternalEnergy(rho, sie, lambda);
return GruneisenParamFromDensityTemperature(rho, temperature, lambda);
}

PORTABLE_INLINE_FUNCTION
void EOSPAC::DensityEnergyFromPressureTemperature(const Real press, const Real temp,
Real *lambda, Real &rho,
Real &sie) const {
SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION void
EOSPAC::DensityEnergyFromPressureTemperature(const Real press, const Real temp,
Real *lambda, Real &rho, Real &sie) const {
using namespace EospacWrapper;
EOS_REAL P[1] = {pressureToSesame(press)};
EOS_REAL T[1] = {temperatureToSesame(temp)};
EOS_REAL dx[1], dy[1], R[1], E[1];
EOS_INTEGER nxypairs = 1;
EOS_INTEGER errorCode;
// EOS_INTEGER errorCode;
dholladay00 marked this conversation as resolved.
Show resolved Hide resolved
EOS_INTEGER table;

table = RofPT_table_;
Expand All @@ -1208,6 +1245,7 @@ void EOSPAC::DensityEnergyFromPressureTemperature(const Real press, const Real t
sie = sieFromSesame(E[0]);
}

SG_PIF_NOWARN
PORTABLE_INLINE_FUNCTION void
EOSPAC::ValuesAtReferenceState(Real &rho, Real &temp, Real &sie, Real &press, Real &cv,
Real &bmod, Real &dpde, Real &dvdt, Real *lambda) const {
Expand Down
Loading