- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 3
 
Open
Description
If my understanding is correct, to add a sync function to a GenericSplitFunction, you need to overload synchronize_solution_with_parameters!(integrator, params, sync::MySync) where MySync is some type the user must define. To be concrete, at minimum I need to define all the below:
struct MySync end
sync = MySync()
function OrdinaryDiffEqOperatorSplitting.synchronize_solution_with_parameters!(
    outer_integrator::OrdinaryDiffEqOperatorSplitting.OperatorSplittingIntegrator,
    ::SciMLBase.NullParameters,
    ::MySync
)
    @info "Sync called at time $(outer_integrator.t)"
endI feel this is a bit cumbersome and would like to suggest just a function-based approach where the user just needs to supply a function directly such as
my_sync(outer_integrator, params) = ...We would just need to add
function synchronize_solution_with_parameters!(outer_integrator::OperatorSplittingIntegrator, p, sync::F) where {F<:Function}
    sync(outer_integrator, p)
endand we could still keep the other way as well. This should be OK since the functions should be known at compile time.
Am I missing something why this can't work? Or will hamper other wanted behavior?
Metadata
Metadata
Assignees
Labels
No labels