SciML / BoundaryValueDiffEq.jl

Boundary value problem (BVP) solvers for scientific machine learning (SciML)
Other
41 stars 31 forks source link

Indexing in boundary conditions #185

Open ArnoStrouwen opened 1 month ago

ArnoStrouwen commented 1 month ago

What is the current best way of doing indexing in the boundary conditions? In the following test, evaluating the bc with a solution gives a deprecation warning, but if you follow deprecation advice, the same bc function can no longer be used for solving the problem, since the solver seems to use an Array of Array for evaluation the bc, and not a DiffEqArray.

https://github.com/SciML/BoundaryValueDiffEq.jl/blob/master/test/mirk/nlls_tests.jl#L11-L25

  Test threw exception
  Expression: norm(bc1(sol, nothing, tspan), Inf) < 0.01
  `Base.getindex(A::AbstractDiffEqArray, i::Int)` is deprecated, use `Base.getindex(A, :, i)` instead.
  Stacktrace:
ChrisRackauckas commented 1 month ago

The item in the boundary condition should always be a solution object. That makes its interpolation well-defined. You don't really want to index it because you don't necessarily know where the time points are due to adaptivity, the interpolation is a more solid definition.