Skip to content

Commit

Permalink
add have_new_refinement flag to after_regrid
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaiton committed Jan 11, 2024
1 parent 92aa794 commit 0d3855c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/fclaw2d_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <fclaw2d_map.h>
#include <fclaw2d_patch.h>
#include <fclaw2d_domain.h>
#include <fclaw2d_vtable.h>

#if defined(_OPENMP)
#include <omp.h>
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/fclaw2d_regrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/fclaw2d_regrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);


Expand Down
4 changes: 2 additions & 2 deletions src/fclaw2d_vtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/fclaw2d_vtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------- */
/**
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0d3855c

Please sign in to comment.