Skip to content
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

Adaptive time-stepping for transient solver using SUNDIALS #292

Merged
merged 41 commits into from
Dec 3, 2024

Conversation

simlapointe
Copy link
Contributor

Add adaptive time-stepping capability for transient simulations. The default transient solver type remains a fixed time-stepping integrator, but the user can now use SUNDIALS implicit multistep (CVODE) and Runge-Kutta (ARKODE) integrators if desired.

@simlapointe simlapointe requested a review from hughcars November 5, 2024 20:01
@simlapointe simlapointe added enhancement New feature or request transient Related to driven simulations in the time domain labels Nov 6, 2024
Copy link
Collaborator

@hughcars hughcars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. There's a few smaller structural issues, but the two bigger things I am thinking about
a) Can the RUNGE_KUTTA option use instead the mfem internal time integrator? That way the sundials connection is really only used for the adaptivity. This would slightly tidy the interface for adaptivity, along with making the non-adaptive slightly more fully featured. There are some SDIRK options in there that would probably be good choices.
b) Is there a way to compute B implicit to this process?

I have some of my suggestions on hughcars/transient-adapt-dt if you want to take a look.

cmake/ExternalSUNDIALS.cmake Outdated Show resolved Hide resolved
cmake/ExternalSUNDIALS.cmake Outdated Show resolved Hide resolved
docs/src/config/solver.md Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
cmake/ExternalMFEM.cmake Outdated Show resolved Hide resolved
@simlapointe
Copy link
Contributor Author

I updated the config file defaults and parameter checking so we can use appropriate constraints in the json script. Using some existence checks and a few if's in config.cpp to remove the need for the exhaustive if/else's I had in iodata.cpp.

Copy link
Collaborator

@hughcars hughcars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, some small things I missed on the previous pass and thinking a little about if there's more we can delete. Additionally, need to rebase on top of main.

docs/src/config/solver.md Outdated Show resolved Hide resolved
docs/src/config/solver.md Outdated Show resolved Hide resolved
docs/src/reference.md Outdated Show resolved Hide resolved
cmake/ExternalMFEM.cmake Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/models/timeoperator.hpp Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/models/timeoperator.cpp Outdated Show resolved Hide resolved
palace/utils/configfile.hpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@hughcars hughcars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Merge away 🚀

@simlapointe simlapointe merged commit 421a637 into main Dec 3, 2024
17 checks passed
@simlapointe simlapointe deleted the simlapointe/transient-adapt-dt branch December 3, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request transient Related to driven simulations in the time domain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants