More Efficient Forward Euler Advection + New Semi Lagrangian Advection#10
Open
coco-yeung wants to merge 17 commits into
Open
More Efficient Forward Euler Advection + New Semi Lagrangian Advection#10coco-yeung wants to merge 17 commits into
coco-yeung wants to merge 17 commits into
Conversation
* Caching point boundary condition * fixing initialisation * fix struct visibility * Fix visibility issue again * unused field in struct * Split functions into boundary + interior * fix segmentation fault * remove brackets * fix build errors * fix functional bug * New minmod function * Fix const declaration * slightly tweak logic * fix non zero diff * Added comments * WIP * WIP * WIP * WIP * Works i think * Fixed uninitialised memory * One FE Iteration * WIP * WIP * Framework set up: x then y advection * builds but not behaving as expected * fix bug * Added comments and reverted FE changes * Added comments * Added comments --------- Co-authored-by: Coco Yeung <coco.yeung22@imperial.ac.uk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two major changes ot advection are made in this PR:
Separating the computation of interior and boundary points for forwardEulerAdvection
Implementing Semi-Lagrangian advection
Previously in forwardEulerAdvection, a point is checked every time wehter it is a boundary point or not. This was unnecessary as the position of the boundary indices do not change after advection, changes were made to store this information in a struct
PointCache.This resulted in the following performance gain:
Combined with 1), the total performance gain is:
This also resulted in the following change in ice mass:
To demonstrate the validity of this change, we can look at the propagation of a simple square wave with

dx = 0.1,dt = 0.5:Pure Forward Euler advection may lead to diffusive results, depending on the local velocity u:

Pure Semi Lagrangian advection is not diffusive, regardless of local velocity u:
