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

use more specialized eos types than eos_t #446

Merged
merged 1 commit into from
May 7, 2024
Merged
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
2 changes: 1 addition & 1 deletion Source/MaestroAdvection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void Maestro::UpdateScal(

if (do_eos_h_above_cutoff &&
snew_arr(i, j, k, Rho) <= base_cutoff_density) {
eos_t eos_state;
eos_rh_t eos_state;

eos_state.rho = snew_arr(i, j, k, Rho);
eos_state.T = sold_arr(i, j, k, Temp);
Expand Down
2 changes: 1 addition & 1 deletion Source/MaestroBaseState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void Maestro::InitBaseState(BaseState<Real>& rho0, BaseState<Real>& rhoh0,
aux_ambient[iabar] = 1.0_rt / aux_ambient[iabar];
#endif

eos_t eos_state;
eos_rh_t eos_state;

// use the EOS to make the state consistent
eos_state.T = t_ambient;
Expand Down
2 changes: 1 addition & 1 deletion Source/MaestroDt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ void Maestro::FirstDt() {
spd.setVal<RunOn::Device>(0.0, tileBox, 0, 1);

ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rep_t eos_state;

// compute the sound speed from rho and temp
eos_state.rho = scal_arr(i, j, k, Rho);
Expand Down
4 changes: 2 additions & 2 deletions Source/MaestroForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ void Maestro::MakeTempForce(
gradp0 = 0.5 * (p0_arr(i,j,k+1) - p0_arr(i,j,k-1)) / dx[2];
}
#endif
eos_t eos_state;
eos_rep_t eos_state;

eos_state.T = scal_arr(i, j, k, Temp);
eos_state.rho = scal_arr(i, j, k, Rho);
Expand Down Expand Up @@ -799,7 +799,7 @@ void Maestro::MakeTempForce(
} else {
#if AMREX_SPACEDIM == 3
ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rep_t eos_state;

eos_state.T = scal_arr(i, j, k, Temp);
eos_state.rho = scal_arr(i, j, k, Rho);
Expand Down
2 changes: 1 addition & 1 deletion Source/MaestroGamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Maestro::MakeGamma1bar(const Vector<MultiFab>& scal,
const Array4<const Real> p0_arr = p0_cart[lev].array(mfi);

ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rep_t eos_state;

eos_state.rho = scal_arr(i, j, k, Rho);

Expand Down
2 changes: 1 addition & 1 deletion Source/MaestroInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void Maestro::InitLevelDataSphr(const int lev, [[maybe_unused]] const Real time,
}

// initialize (rho h) and T using the EOS
eos_t eos_state;
eos_rh_t eos_state;
eos_state.T = scal_arr(i, j, k, Temp);
eos_state.p = p0_arr(i, j, k);
eos_state.rho = scal_arr(i, j, k, Rho);
Expand Down
4 changes: 2 additions & 2 deletions Source/MaestroPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ void Maestro::MakeAdExcess(const Vector<MultiFab>& state,
#endif

ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rep_t eos_state;

eos_state.rho = state_arr(i, j, k, Rho);
eos_state.T = state_arr(i, j, k, Temp);
Expand Down Expand Up @@ -2191,7 +2191,7 @@ void Maestro::MakeDeltaGamma(const Vector<MultiFab>& state,
const Array4<Real> deltagamma_arr = deltagamma[lev].array(mfi);

ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rep_t eos_state;

eos_state.rho = state_arr(i, j, k, Rho);
eos_state.T = state_arr(i, j, k, Temp);
Expand Down
24 changes: 12 additions & 12 deletions Source/MaestroRhoHT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void Maestro::TfromRhoH(Vector<MultiFab>& scal, const BaseState<Real>& p0) {
if (use_eos_e_instead_of_h_loc) {
// (rho, (h->e)) --> T, p
ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_re_t eos_state;

eos_state.rho = state(i, j, k, Rho);
eos_state.T = state(i, j, k, Temp);
Expand All @@ -58,7 +58,7 @@ void Maestro::TfromRhoH(Vector<MultiFab>& scal, const BaseState<Real>& p0) {
} else {
// (rho, h) --> T, p
ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

eos_state.rho = state(i, j, k, Rho);
eos_state.T = state(i, j, k, Temp);
Expand Down Expand Up @@ -116,7 +116,7 @@ void Maestro::TfromRhoP(Vector<MultiFab>& scal, const BaseState<Real>& p0,

// (rho, p) --> T
ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

eos_state.rho = state(i, j, k, Rho);
eos_state.T = state(i, j, k, Temp);
Expand Down Expand Up @@ -179,7 +179,7 @@ void Maestro::PfromRhoH(const Vector<MultiFab>& state,

// (rho, H) --> T, p
ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

eos_state.rho = state_arr(i, j, k, Rho);
eos_state.T = temp_old(i, j, k);
Expand Down Expand Up @@ -255,7 +255,7 @@ void Maestro::MachfromRhoH(const Vector<MultiFab>& scal,
(u(i,j,k,2) + w0_arr(i,j,k))*(u(i,j,k,2) + w0_arr(i,j,k)));
#endif

eos_t eos_state;
eos_rh_t eos_state;

eos_state.rho = state(i, j, k, Rho);
eos_state.T = state(i, j, k, Temp);
Expand Down Expand Up @@ -314,7 +314,7 @@ void Maestro::CsfromRhoH(const Vector<MultiFab>& scal,
const Array4<Real> cs_arr = cs[lev].array(mfi);

ParallelFor(tileBox, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

eos_state.rho = state(i, j, k, Rho);
eos_state.T = state(i, j, k, Temp);
Expand Down Expand Up @@ -462,7 +462,7 @@ void Maestro::HfromRhoTedge(
tempbar_edge_cart[lev].array(mfi);
// x-edge
ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

// get edge-centered temperature
if (enthalpy_pred_type_loc == predict_Tprime_then_h_loc) {
Expand Down Expand Up @@ -532,7 +532,7 @@ void Maestro::HfromRhoTedge(

// y-edge
ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

// get edge-centered temperature
if (enthalpy_pred_type_loc == predict_Tprime_then_h_loc) {
Expand Down Expand Up @@ -614,7 +614,7 @@ void Maestro::HfromRhoTedge(
#if (AMREX_SPACEDIM == 3)
// z-edge
ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

// get edge-centered temperature
if (enthalpy_pred_type_loc == predict_Tprime_then_h_loc) {
Expand Down Expand Up @@ -686,7 +686,7 @@ void Maestro::HfromRhoTedge(
#if (AMREX_SPACEDIM == 3)
// x-edge
ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

// get edge-centered temperature
if (enthalpy_pred_type_loc == predict_Tprime_then_h_loc) {
Expand Down Expand Up @@ -759,7 +759,7 @@ void Maestro::HfromRhoTedge(

// y-edge
ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

// get edge-centered temperature
if (enthalpy_pred_type_loc == predict_Tprime_then_h_loc) {
Expand Down Expand Up @@ -832,7 +832,7 @@ void Maestro::HfromRhoTedge(

// z-edge
ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) {
eos_t eos_state;
eos_rh_t eos_state;

// get edge-centered temperature
if (enthalpy_pred_type_loc == predict_Tprime_then_h_loc) {
Expand Down
Loading