Trixi.jl
                                
                                
                                
                                    Trixi.jl copied to clipboard
                            
                            
                            
                        How to handle default arguments of `solve`
We need some default arguments of solve, e.g., save_everystep=false. With our coming MPI array type, we also need to think about how to handle the parallel norm computations for error-based step size control with MPI. We tried to let length return a global length, but that came with too many problems. Thus, #1104 adds new functions that must be passed as additional keyword arguments as in sol = solve(ode, ...; kwargs..., internalnorm=ode_norm, unstable_check=ode_unstable_check).
We basically have two options I can think of right now:
- Create a function 
ode_default_options()returning the default options we use. - Create a function 
trixi_solve(args...; kwargs...) = solve(args...; save_everystep=false, internalnorm=ode_norm, unstable_check=ode_unstable_check, kwargs...) 
See https://github.com/trixi-framework/Trixi.jl/pull/1104, especially https://github.com/trixi-framework/Trixi.jl/pull/1104#discussion_r840319907
We might also consider turning on multithreading in solve by default this way, couldn't we?
That's a bit more difficult since it's part of the algorithm, not a standard keyword argument (since not all algorithms support that).