-
Notifications
You must be signed in to change notification settings - Fork 51
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
base: main
Are you sure you want to change the base?
Conversation
…ve explicit RK integrator
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.
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
if(PALACE_WITH_CUDA) | ||
list(APPEND SUNDIALS_OPTIONS | ||
"-DENABLE_CUDA=ON" | ||
) | ||
endif() | ||
|
||
if(PALACE_WITH_MAGMA) | ||
list(APPEND SUNDIALS_OPTIONS | ||
"-DENABLE_MAGMA=ON" | ||
"-DMAGMA_DIR=${MAGMA_DIR}" | ||
) | ||
endif() |
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.
What tests have you done with CUDA/MAGMA builds?
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.
I just tried building with CUDA/MAGMA and SUNDIALS' ENABLE_MAGMA was causing a build failure. I removed it and Palace builds without issues but I'm getting NaNs at step 0 of the transient solve. Will try to understand what's going wrong. It happens even with generalized alpha, so I don't think it's SUNDIALS related.
En += E; | ||
Curl->AddMult(En, B, -0.5 * dt); |
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.
Is there a better way to be computing B
as part of this?
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.
I don't think so. We solve the ODE system for E and Edot, not sure how else to get B.
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.