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
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f0ef4f2
Add SUNDIALS dependency and build MFEM with SUNDIALS
simlapointe Oct 14, 2024
e2edda8
Add weak curl operator for first-order transient formulation
simlapointe Oct 14, 2024
0c4d8e1
Add new transient solver config options for adaptive time-stepping
simlapointe Oct 14, 2024
d437156
Add first-order transient formulation with SUNDIALS ARKode schemes
simlapointe Oct 14, 2024
0c10b67
Change first order ODE system formulation, add CVODE integrator, remo…
simlapointe Oct 21, 2024
983cc9c
Use explicit RHS (y' = M^-1 f(y,t)) for both ARKODE and CVODE
simlapointe Oct 25, 2024
cff74b9
Remove weakCurl operator, no longer needed
simlapointe Oct 30, 2024
e5b1e1d
Remove unnecessary ODE integrator prints
simlapointe Oct 30, 2024
2f10218
Merge branch 'main' into simlapointe/transient-adapt-dt
simlapointe Oct 30, 2024
c4b4a01
Remove 2nd order ODE formulation
simlapointe Nov 5, 2024
937fb47
Update reference for transient solver tests
simlapointe Nov 5, 2024
b9ce371
Clean up
simlapointe Nov 5, 2024
11092e9
Add SUNDIALS to spack install instructions
simlapointe Nov 5, 2024
11ad777
Change SUNDIALS version for spack installer
simlapointe Nov 5, 2024
aea8d7f
Fix formatting issues
simlapointe Nov 5, 2024
1bb2a95
Merge branch 'main' into simlapointe/transient-adapt-dt
simlapointe Nov 6, 2024
cd7cfc4
Use MFEM's SDIRK23 solver as the fixed step Runge-Kutta option, along…
simlapointe Nov 7, 2024
c86a4c6
Remove SUNDIALS MAGMA dependency
simlapointe Nov 8, 2024
100d2f4
Fix formatting issues
simlapointe Nov 8, 2024
8ed5f1e
Change Vector management to avoid GPU memory issue
simlapointe Nov 11, 2024
f1ebc29
Fix formatting issues
simlapointe Nov 11, 2024
cc65463
Fix typo
simlapointe Nov 11, 2024
2c59a02
Make rhs/RHS lower/upper case consistent
simlapointe Nov 13, 2024
47a04e9
Use MakeRef instead of Get/SetSubVector to split ODE system vectors
simlapointe Nov 13, 2024
137ec8b
Fix formatting issues
simlapointe Nov 13, 2024
df38dbb
Simplify transient solver config file verification
simlapointe Nov 13, 2024
1fd974c
Merge branch 'main' into simlapointe/transient-adapt-dt
simlapointe Nov 13, 2024
9ecd6d1
fix formatting issues
simlapointe Nov 13, 2024
db8c2a5
Add dB/dt to ODE system instead of using trapezoidal integration
simlapointe Nov 19, 2024
1b0b6b2
Remove unused En vector
simlapointe Nov 19, 2024
56844da
Fix formatting issues
simlapointe Nov 19, 2024
7469ea9
Merge branch 'main' into simlapointe/transient-adapt-dt
simlapointe Nov 19, 2024
d615337
Update coaxial example reference
simlapointe Nov 19, 2024
d36f954
Update time domain formulation reference doc
simlapointe Nov 19, 2024
443b3b8
Add SUNDIALS to configuration options doc
simlapointe Nov 19, 2024
863aee4
Fix formatting issues
simlapointe Nov 19, 2024
4eab1b5
Doc fixes
simlapointe Dec 2, 2024
e6034e5
Remove unnecessary sundials options
simlapointe Dec 2, 2024
abde1ec
Merge main
simlapointe Dec 2, 2024
2c2b9a8
Incorporate PR feedback
simlapointe Dec 2, 2024
d3d18d7
Fix formatting
simlapointe Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/ExternalMFEM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ Intel C++ compiler for MUMPS and STRUMPACK dependencies")
list(APPEND MFEM_OPTIONS
"-DSUNDIALS_DIR=${CMAKE_INSTALL_PREFIX}"
"-DSUNDIALS_OPT=-I${CMAKE_INSTALL_PREFIX}/include"
"-DSUNDIALS_LIB=-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib64 -L${CMAKE_INSTALL_PREFIX}/lib64 -lsundials_arkode, -lsundials_cvode -lsundials_nvecserial -lsundials_kinsol -lsundials_nvecparhyp -lsundials_nvecparallel"
"-DSUNDIALS_LIB=-Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib64 -L${CMAKE_INSTALL_PREFIX}/lib64 -lsundials_arkode, -lsundials_cvode -lsundials_kinsol -lsundials_nvecparhyp -lsundials_nvecparallel"
"-DSUNDIALS_REQUIRED_PACKAGES=${SUNDIALS_REQUIRED_PACKAGES}"
)
if(NOT "${SUNDIALS_REQUIRED_LIBRARIES}" STREQUAL "")
Expand Down
11 changes: 2 additions & 9 deletions cmake/ExternalSUNDIALS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

# Force build order
set(SUNDIALS_DEPENDENCIES )
set(SUNDIALS_DEPENDENCIES)

set(SUNDIALS_OPTIONS ${PALACE_SUPERBUILD_DEFAULT_ARGS})
list(APPEND SUNDIALS_OPTIONS
Expand Down Expand Up @@ -42,18 +42,11 @@ endif()

if(PALACE_WITH_CUDA)
list(APPEND SUNDIALS_OPTIONS
"-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}"
"-DENABLE_CUDA=ON"
)
endif()

if(PALACE_WITH_MAGMA)
list(APPEND SUNDIALS_OPTIONS
"-DENABLE_MAGMA=ON"
"-DMAGMA_DIR=${MAGMA_DIR}"
)
endif()


string(REPLACE ";" "; " SUNDIALS_OPTIONS_PRINT "${SUNDIALS_OPTIONS}")
message(STATUS "SUNDIALS_OPTIONS: ${SUNDIALS_OPTIONS_PRINT}")

Expand Down
8 changes: 4 additions & 4 deletions docs/src/config/solver.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ the second-order system of differential equations. The available options are:
ODE system for the electric field with adaptive time-stepping. This option is only available when *Palace* has been [built with SUNDIALS support](../install.md#Configuration-options).
- `"CVODE"` : SUNDIALS CVODE implicit multistep method scheme applied to the first-order
ODE system for the electric field with adaptive time-stepping. This option is only available when *Palace* has been [built with SUNDIALS support](../install.md#Configuration-options).
- `"RungeKutta"` : SUNDIALS ARKode implicit Runge-Kutta scheme applied to the first-order
ODE system for the electric field with fixed time-stepping. This option is only available when *Palace* has been [built with SUNDIALS support](../install.md#Configuration-options).
- `"RungeKutta"` : Two stage, singly diagonal implicit Runge-Kutta (SDIRK) method. Second order and L-stable.
- `"Default"` : Use the default `"GeneralizedAlpha"` time integration scheme.

`"Excitation" [None]` : Controls the time dependence of the source excitation. The
Expand Down Expand Up @@ -262,8 +261,9 @@ disk for [visualization with ParaView](../guide/postprocessing.md#Visualization)
saved in the `paraview/` directory under the directory specified by
[`config["Problem"]["Output"]`](problem.md#config%5B%22Problem%22%5D).

`"Order" [2]` : Order of the Runge-Kutta integrators or maximum order of the multistep method.
Only relevant when `"Type"` is `"ARKODE"`, `"Runge-Kutta"` or `"CVODE"`.
`"Order" [0]` : Order of the adaptive Runge-Kutta integrators or maximum order of the multistep method.
Only relevant when `"Type"` is `"ARKODE"` or `"CVODE"`. A value less than 1 defaults to 3 for `"ARKODE"`
and 2 for `"CVODE"`.
simlapointe marked this conversation as resolved.
Show resolved Hide resolved

`"RelTol" [1e-4]` : Relative tolerance used in adaptive time-stepping schemes. Only relevant
when `"Type"` is `"CVODE"` or `"ARKODE"` .
Expand Down
2 changes: 1 addition & 1 deletion palace/drivers/transientsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TransientSolver::Solve(const std::vector<std::unique_ptr<Mesh>> &mesh) const
{
Mpi::Print("\n");
t += delta_t;
time_op.Init(delta_t); // Initial conditions
time_op.Init(); // Initial conditions
}
else
{
Expand Down
Loading
Loading