-
Notifications
You must be signed in to change notification settings - Fork 19
Dynamics switcher #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Dynamics switcher #477
Conversation
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
This was
linked to
issues
Jan 5, 2024
Closed
- added missing functions for DGTransport<8>: mostly just adding the explicit template definitions such as template class DGTransport<8>; only part where new code was required in DGTransport.cpp leftedgeofcell, rightedgeofcell, topedgeofcell, bottomedgeofcell these functions restrict an element-DG function to the edge-DG functions by translating the basis functions 1,(x-1/2),(y-1/2),(x-1/2)(y-1/2), ... to the corresponding functions on the edges, 1,(t-1/2),(t-1/2)^2-1/12 Herefore, the cell-edge functions are evaluated for x=0 (left), x=1 (right) y=0 (bottom) and y=1 (top) and the corresponding edge basis functions are collected - added a new DGTransport-Class to DynamicsKernel Nextsim::DGTransport<CG2DGSTRESS(CGdegree)>* stresstransport; CG2DGSTRESS computes the number of DG-stress unknowns per element depending on the CG discretization of the velocity. This stresstransport is initialized along with dgtransport (used for the advection) - added first version of stress transport to DynamicsKernel::update currently commented out.
I did some minor cleaning of the comments of mEVPStep to make it clearer what "pseduo-timestepping" referred to. I also removed extra lines from the BBMStep function which seem to have been introduced during a merge .
…b/nextsimdg.git into issue378_dynamicsswitcher2
cb23404 to
4ded1b7
Compare
43646f0 to
66e648c
Compare
Collaborator
Author
|
Removing the old dynamics source files causes the CI on Mac to fail, not even in the dynamics tests. The files that have not been removed are
|
einola
approved these changes
Apr 3, 2024
Member
einola
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments and change requests. You can merge once you've addressed them as you see fit.
This was referenced Apr 4, 2024
Closed
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.
Dynamics switcher
Fixes #378
Change Description
This PR converts the structure of the code from the original code where the code for all rheologies is mixed in a single file.
The new structure is designed to allow new implementations to be written and included in nextSIM-DG. It also provides separation of all classes using continuous Galerkin (CG) arrays to hold velocity fields.
Modules
The dynamics are modularized so that the dynamics and rheology implementation can be configured at run time, allowing rapid replacement of the rheology mathematics. This modularization is only used in the modules held in the
corepart of the model. Within thedynamicssubdirectory the code is not modularized, but the classes are part of a class hierarchy. The module implementations control the flow of data from the core of the model to the dynamics (and back) and determine which classes are called to act on this data.Dynamics classes
DynamicsKernel
The new classes in the
dynamicssubdirectory are part of two class hierarchies. The first is based on theDynamicsKernelclass. This is intended to encapsulate all of the dynamics calculations and data. any common data that is based on DG arrays is held here:DGTransportinstances.This class is abstract and should not be instantiated.
CGDynamicsKernel
The only current child class is the
CGDynamicsKernelclass, which defines everything which is common to dynamics classes which use CG velocity fields (currently all of them) and holds the arrays for this data:The class also holds functions common to dynamics implementation using CG arrays, such as:
Again, the class is abstract and should not be instantiated.
VPCGDynamicsKernel
The implementation of CG-based dynamics for visco-plastic rheologies, a child of the CG dynamics kernel class. The update step is defined at this level, with only the stress update step to be defined by child classes. The main piece of code in this class is the momentum solver. The class also holds the parameters object for the VP calculation.
MEVPDynamicsKernel
This is a child class of the CG VP dynamics kernel. The only definition is that the MEVP stress update step class is to be used to calculate stress from strain. This class is the one instantiated by the MEVP dynamics implementation in the core code.
StressUpdateStep
A class that defines an interface to perform the calculation of stress from strain. By using a generic parameters class, the interface can be common between the MEVP, MEB and BBM rheologies that are the initial targets for nextSIM-DG.
MEVPStressUpdateStep
The child class of the stress update class that is instantiated do the MEVP stress calculation. Used by
MEVPDynamicsKernel.Test Description
Do the outputs of the dynamics benchmark and the yearlong run match for MEVP and BBM? As judged by a human.
Documentation Impact
In terms of user documentation, no impact. These changes should be transparent to the user.
Developer documentation should be added.