diff --git a/Exec/science/wdmerger/problem_initialize_state_data.H b/Exec/science/wdmerger/problem_initialize_state_data.H index 85b9975d54..747f8442c4 100644 --- a/Exec/science/wdmerger/problem_initialize_state_data.H +++ b/Exec/science/wdmerger/problem_initialize_state_data.H @@ -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