Commit 8637788b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Generalized the mechanism to add an extra initialisation loop to the SPH set-up.

parent aefe3c71
......@@ -2658,8 +2658,15 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
TIMER_TOC(timer_runners);
/* Apply some conversions (e.g. internal energy -> entropy) */
if (!flag_entropy_ICs) space_map_cells_pre(s, 0, cell_convert_hydro, NULL);
if (1) engine_launch(e, e->nr_threads, mask, submask);
if (!flag_entropy_ICs) {
/* Apply the conversion */
space_map_cells_pre(s, 0, cell_convert_hydro, NULL);
/* Correct what we did (e.g. in PE-SPH, need to recompute rho_bar) */
if (hydro_need_extra_init_loop)
engine_launch(e, e->nr_threads, mask, submask);
}
clocks_gettime(&time2);
......
......@@ -42,14 +42,19 @@
/* Import the right hydro particle definition */
#if defined(MINIMAL_SPH)
#include "./hydro/Minimal/hydro_part.h"
#define hydro_need_extra_init_loop 0
#elif defined(GADGET2_SPH)
#include "./hydro/Gadget2/hydro_part.h"
#define hydro_need_extra_init_loop 0
#elif defined(HOPKINS_PE_SPH)
#include "./hydro/PressureEntropy/hydro_part.h"
#define hydro_need_extra_init_loop 1
#elif defined(DEFAULT_SPH)
#include "./hydro/Default/hydro_part.h"
#define hydro_need_extra_init_loop 0
#elif defined(GIZMO_SPH)
#include "./hydro/Gizmo/hydro_part.h"
#define hydro_need_extra_init_loop 0
#define EXTRA_HYDRO_LOOP
#else
#error "Invalid choice of SPH variant"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment