boutproject / BOUT-dev

BOUT++: Plasma fluid finite-difference simulation code in curvilinear coordinate systems
http://boutproject.github.io/
GNU Lesser General Public License v3.0
179 stars 93 forks source link

CVODE solver: Pass linear flag to rhs() #2932

Open bendudson opened 3 weeks ago

bendudson commented 3 weeks ago

Uses CVodeSetNlsRhsFn (https://sundials.readthedocs.io/en/latest/cvode/Usage/index.html#c.CVodeSetNlsRhsFn) to set different callback functions for linear and nonlinear solves. Both callbacks end up calling the same user rhs() function, but with a boolean argument that differs.