Skip to content

Commit

Permalink
fix single star case
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Apr 20, 2024
1 parent 52ce088 commit 380a69d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Exec/science/wdmerger/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,21 @@ void problem_initialize_state_data (int i, int j, int k,
loc[1] - problem::center_P_initial[1],
loc[2] - problem::center_P_initial[2]};

auto rho_P = interpolate_3d(pos_P, dx, model::idens, problem::nsub, 0);
double rho_P{0.0};

if (problem::mass_P > 0.0_rt) {
rho_P = interpolate_3d(pos_P, dx, model::idens, problem::nsub, 0);
}

Real pos_S[3] = {loc[0] - problem::center_S_initial[0],
loc[1] - problem::center_S_initial[1],
loc[2] - problem::center_S_initial[2]};

auto rho_S = interpolate_3d(pos_S, dx, model::idens, problem::nsub, 1);
double rho_S{0.0};

if (problem::mass_S > 0.0_rt) {
rho_S = interpolate_3d(pos_S, dx, model::idens, problem::nsub, 1);
}

if (rho_P > rho_S) {
// use the primary star initialization
Expand Down

0 comments on commit 380a69d

Please sign in to comment.