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

[NEVER MERGE!!!] hack out EOSData #1442

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions EOS/helmholtz/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ void single_iter_update (T& state, int var, int dvar,
if (dvar == itemp) {

x = state.T;
smallx = EOSData::mintemp;
//smallx = EOSData::mintemp;
xtol = ttol;

if (var == ipres) {
Expand Down Expand Up @@ -970,7 +970,7 @@ void single_iter_update (T& state, int var, int dvar,
{

x = state.rho;
smallx = EOSData::mindens;
//smallx = EOSData::mindens;
xtol = dtol;

if (var == ipres) {
Expand Down Expand Up @@ -1007,7 +1007,7 @@ void single_iter_update (T& state, int var, int dvar,
xnew = amrex::max(0.5_rt * x, amrex::min(xnew, 2.0_rt * x));

// Don't let us freeze/evacuate
xnew = amrex::max(smallx, xnew);
//xnew = amrex::max(smallx, xnew);

// Store the new temperature/density

Expand Down Expand Up @@ -1123,8 +1123,8 @@ void double_iter_update (T& state, int var1, int var2,
rnew = amrex::max(0.5e0_rt * rold, amrex::min(rnew, 2.0e0_rt * rold));

// Don't let us freeze or evacuate
tnew = amrex::max(EOSData::mintemp, tnew);
rnew = amrex::max(EOSData::mindens, rnew);
//tnew = amrex::max(EOSData::mintemp, tnew);
//rnew = amrex::max(EOSData::mindens, rnew);

// Store the new temperature and density
state.rho = rnew;
Expand Down Expand Up @@ -1468,10 +1468,10 @@ void actual_eos_init ()

// Set up the minimum and maximum possible densities.

EOSData::mintemp = std::pow(10.e0_rt, tlo);
EOSData::maxtemp = std::pow(10.e0_rt, thi);
EOSData::mindens = std::pow(10.e0_rt, dlo);
EOSData::maxdens = std::pow(10.e0_rt, dhi);
//EOSData::mintemp = std::pow(10.e0_rt, tlo);
//EOSData::maxtemp = std::pow(10.e0_rt, thi);
//EOSData::mindens = std::pow(10.e0_rt, dlo);
//EOSData::maxdens = std::pow(10.e0_rt, dhi);
}


Expand Down
48 changes: 24 additions & 24 deletions interfaces/eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void eos_reset (T& state, bool& has_been_reset)
{
state.T = amrex::min(EOSData::maxtemp, amrex::max(EOSData::mintemp, state.T));
state.rho = amrex::min(EOSData::maxdens, amrex::max(EOSData::mindens, state.rho));
//state.T = amrex::min(EOSData::maxtemp, amrex::max(EOSData::mintemp, state.T));
//state.rho = amrex::min(EOSData::maxdens, amrex::max(EOSData::mindens, state.rho));

actual_eos(eos_input_rt, state);

Expand All @@ -84,59 +84,59 @@ template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void reset_rho (T& state)
{
state.rho = amrex::min(EOSData::maxdens, amrex::max(EOSData::mindens, state.rho));
//state.rho = amrex::min(EOSData::maxdens, amrex::max(EOSData::mindens, state.rho));
}

// For temperature, just ensure that it is within mintemp and maxtemp.
template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void reset_T (T& state)
{
state.T = amrex::min(EOSData::maxtemp, amrex::max(EOSData::mintemp, state.T));
//state.T = amrex::min(EOSData::maxtemp, amrex::max(EOSData::mintemp, state.T));
}

template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void reset_e (T& state, bool& has_been_reset)
{
if constexpr (has_energy<T>::value) {
if (state.e < EOSData::mine || state.e > EOSData::maxe) {
eos_reset(state, has_been_reset);
}
}
// if constexpr (has_energy<T>::value) {
// if (state.e < EOSData::mine || state.e > EOSData::maxe) {
// eos_reset(state, has_been_reset);
// }
// }
}

template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void reset_h (T& state, bool& has_been_reset)
{
if constexpr (has_enthalpy<T>::value) {
if (state.h < EOSData::minh || state.h > EOSData::maxh) {
eos_reset(state, has_been_reset);
}
}
// if constexpr (has_enthalpy<T>::value) {
// if (state.h < EOSData::minh || state.h > EOSData::maxh) {
// eos_reset(state, has_been_reset);
// }
// }
}

template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void reset_s (T& state, bool& has_been_reset)
{
if constexpr (has_entropy<T>::value) {
if (state.s < EOSData::mins || state.s > EOSData::maxs) {
eos_reset(state, has_been_reset);
}
}
// if constexpr (has_entropy<T>::value) {
// if (state.s < EOSData::mins || state.s > EOSData::maxs) {
// eos_reset(state, has_been_reset);
// }
// }
}

template <typename T>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void reset_p (T& state, bool& has_been_reset)
{
if constexpr (has_pressure<T>::value) {
if (state.p < EOSData::minp || state.p > EOSData::maxp) {
eos_reset(state, has_been_reset);
}
}
// if constexpr (has_pressure<T>::value) {
// if (state.p < EOSData::minp || state.p > EOSData::maxp) {
// eos_reset(state, has_been_reset);
// }
// }
}

template <typename I, typename T>
Expand Down
Loading