Allow skipping of MoL_PostStep and MoL_PseudoEvolutionBoundaries in POSTRESTRICT

Create issue
Issue #1494 open
Ian Hinder created an issue

It is not always necessary to call MoL_PostStep and MoL_PseudoEvolutionBoundaries in POSTRESTRICT, and it can introduce a performance penalty. The main reason for these calls is that restriction does not fill (outer or symmetry) boundary points, and this is usually done in MoL_PostStep. MoL_PseudoEvolutionBoundaries also sets boundary conditions. However, if restriction does not modify boundary points, for example in the case that boundary points are always far from refined regions, there is no reason to apply boundary conditions (e.g. by calling MoL_PostStep) after restriction.

Eventually, Carpet and MoL should be modified to determine automatically whether the BCs need to be applied, but until that is implemented, the attached patch provides parameters for careful users to optimise their simulations in the case where this is safe to do.

Additionally, recalculations performed in MoL_PostStep may replace more accurate restricted values computed on finer grids, leading to a loss of accuracy.

OK to commit?

Keyword:

Comments (9)

  1. Erik Schnetter
    • changed status to open
    • removed comment

    Note that "boundaries" include ghost zones. You probably have to sync the restricted grid functions manually.

    Okay to apply.

  2. Ian Hinder reporter
    • removed comment

    The attached (untested) patch enables a Carpet sync after restrict determined by a new parameter. I want to test this a bit before committing though.

  3. Ian Hinder reporter
    • removed comment

    No, they have not been committed. In light of the recent changes to sync/restrict handling, I'll have to go back and think about these patches again.

  4. Ian Hinder reporter
    • removed comment

    No. The sync-after-restrict patch should not be necessary, as Carpet now either syncs after restriction (cell-centering) or restricts into ghost zones (vertex centering), as far as I remember. The MoL patch probably would still be useful and correct in certain situations, but I would have to think about it more before committing it.

  5. Roland Haas
    • removed comment

    The MoL patch also affects buffer zones. Since the restricted points will be source points for the prolongation operators (being just next to the buffer points on the fine grid). So not running MoL_PostStep will change values in the buffer zones.

  6. Log in to comment