Can I impose a super type for an existing struct?

It seems to me that you have in your mind the limitation that your function/solver can only take concrete subtypes of InitialValueProblem. Why do not define (or just let the user define) a new method of the same function/solver which takes an OrdinaryDiffEq.ODEProblem instead of a subtype of InitialValueProblem? Functions are extensible.

Another option is the user defining a new struct which is a subtype of InitialValueProblem and has a OrdinaryDiffEq.ODEProblem inside it, and extends for this new struct any of the functions you expect to work on a InitialValueProblem subtype.

2 Likes