diff --git a/src/fclaw2d_initialize.c b/src/fclaw2d_initialize.c index 2b3d8f72a..2e5b7c42b 100644 --- a/src/fclaw2d_initialize.c +++ b/src/fclaw2d_initialize.c @@ -41,6 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #if defined(_OPENMP) #include @@ -237,7 +238,7 @@ void fclaw2d_initialize(fclaw2d_global_t *glob) fclaw2d_diagnostics_initialize(glob); fclaw_locate_gauges(glob); - fclaw2d_after_regrid(glob); + fclaw2d_after_regrid(glob, 1); /* Print global minimum and maximum levels */ fclaw_global_infof("Global minlevel %d maxlevel %d\n", diff --git a/src/fclaw2d_regrid.c b/src/fclaw2d_regrid.c index 304803d0f..2a57ec5ed 100644 --- a/src/fclaw2d_regrid.c +++ b/src/fclaw2d_regrid.c @@ -321,7 +321,7 @@ void fclaw2d_regrid(fclaw2d_global_t *glob) } /* User defined */ - fclaw2d_after_regrid(glob); + fclaw2d_after_regrid(glob, have_new_refinement); /* Only if gauges count > 0 */ fclaw_locate_gauges(glob); diff --git a/src/fclaw2d_regrid.h b/src/fclaw2d_regrid.h index 300d470be..1662981a9 100644 --- a/src/fclaw2d_regrid.h +++ b/src/fclaw2d_regrid.h @@ -67,8 +67,6 @@ void fclaw2d_regrid_set_neighbor_types(struct fclaw2d_global *glob); void fclaw2d_regrid(struct fclaw2d_global *glob); -void fclaw2d_after_regrid(struct fclaw2d_global *glob); - void fclaw2d_regrid_set_neighbor_types(struct fclaw2d_global *glob); diff --git a/src/fclaw2d_vtable.c b/src/fclaw2d_vtable.c index 7fb39adc1..50ff239f2 100644 --- a/src/fclaw2d_vtable.c +++ b/src/fclaw2d_vtable.c @@ -52,12 +52,12 @@ fclaw2d_vtable_t* fclaw2d_vt(fclaw2d_global_t *glob) } -void fclaw2d_after_regrid(fclaw2d_global_t *glob) +void fclaw2d_after_regrid(fclaw2d_global_t *glob, int have_new_refinement) { fclaw2d_vtable_t *fclaw_vt = fclaw2d_vt(glob); if (fclaw_vt->after_regrid != NULL) { - fclaw_vt->after_regrid(glob); + fclaw_vt->after_regrid(glob, have_new_refinement); } } diff --git a/src/fclaw2d_vtable.h b/src/fclaw2d_vtable.h index 88d3e1f09..fa0ba7d23 100644 --- a/src/fclaw2d_vtable.h +++ b/src/fclaw2d_vtable.h @@ -62,8 +62,9 @@ typedef void (*fclaw2d_output_frame_t)(struct fclaw2d_global * glob, int iframe) * @brief Called after each regridding * * @param glob the global context + * @param have_new_refinement true if there is a new refinement */ -typedef void (*fclaw2d_after_regrid_t)(struct fclaw2d_global *glob); +typedef void (*fclaw2d_after_regrid_t)(struct fclaw2d_global *glob, int have_new_refinement); /* ------------------------------------ vtable ---------------------------------------- */ /** @@ -104,8 +105,9 @@ void fclaw2d_vtable_initialize(struct fclaw2d_global* glob); * @brief Called after each regridding * * @param glob the global context + * @param have_new_refinement true if there is a new refinement */ -void fclaw2d_after_regrid(struct fclaw2d_global *glob); +void fclaw2d_after_regrid(struct fclaw2d_global *glob, int have_new_refinement); #ifdef __cplusplus #if 0