Skip to content

Commit

Permalink
Adding a message when we fail to allocate memory for the ODE's state …
Browse files Browse the repository at this point in the history
…vector
  • Loading branch information
rsachetto committed Oct 19, 2023
1 parent e0e6046 commit 224aee3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ode_solver/ode_solver.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,7 @@ void set_ode_initial_conditions_for_all_volumes(struct ode_solver *solver, struc
}

solver->pitch = soicg_fn_pt(solver, ode_extra_config);

if(solver->sv == NULL) {
log_error_and_exit("Error allocating memory for the ODE's state vector. Exiting!");
}
#endif
#endif
} else {

set_ode_initial_conditions_cpu_fn *soicc_fn_pt = solver->set_ode_initial_conditions_cpu;
Expand All @@ -183,7 +179,9 @@ void set_ode_initial_conditions_for_all_volumes(struct ode_solver *solver, struc
soicc_fn_pt(solver, ode_extra_config);
}

assert(solver->sv);
if(solver->sv == NULL) {
log_error_and_exit("Error allocating memory for the ODE's state vector. Exiting!");
}
}

void solve_all_volumes_odes(struct ode_solver *the_ode_solver, real_cpu cur_time, struct string_voidp_hash_entry *stim_configs,
Expand Down

0 comments on commit 224aee3

Please sign in to comment.