Skip to content

Commit

Permalink
Move things around for MIRK
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 11, 2023
1 parent 2b6f326 commit 6f40df9
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 220 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
TruncatedStacktraces = "781d530d-4396-4725-bb49-402e4bee1e77"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

Expand Down
11 changes: 6 additions & 5 deletions src/BoundaryValueDiffEq.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module BoundaryValueDiffEq

using Adapt, LinearAlgebra, PreallocationTools, Reexport, Setfield, SparseArrays, SciMLBase,
RecursiveArrayTools, ForwardDiff
Static, RecursiveArrayTools, ForwardDiff
@reexport using ADTypes, DiffEqBase, NonlinearSolve, SparseDiffTools, SciMLBase

import ADTypes: AbstractADType
Expand All @@ -10,7 +10,7 @@ import ConcreteStructs: @concrete
import DiffEqBase: solve
import ForwardDiff: pickchunksize
import RecursiveArrayTools: ArrayPartition, DiffEqArray
import SciMLBase: AbstractDiffEqInterpolation
import SciMLBase: AbstractDiffEqInterpolation, StandardBVProblem
import RecursiveArrayTools: ArrayPartition
import SparseDiffTools: AbstractSparseADType
import TruncatedStacktraces: @truncate_stacktrace
Expand All @@ -20,15 +20,16 @@ include("types.jl")
include("utils.jl")
include("algorithms.jl")
include("alg_utils.jl")

include("mirk_tableaus.jl")
include("cache.jl")
include("collocation.jl")
include("sparse_jacobians.jl")

include("solve/single_shooting.jl")
include("solve/multiple_shooting.jl")
include("solve/mirk.jl")

include("collocation.jl")
include("sparse_jacobians.jl")

include("adaptivity.jl")
include("interpolation.jl")

Expand Down
67 changes: 0 additions & 67 deletions src/cache.jl

This file was deleted.

6 changes: 0 additions & 6 deletions src/collocation.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
__initial_state_from_prob(prob::BVProblem, mesh) = __initial_state_from_prob(prob.u0, mesh)
__initial_state_from_prob(u0::AbstractArray, mesh) = [copy(vec(u0)) for _ in mesh]
function __initial_state_from_prob(u0::AbstractVector{<:AbstractVector}, _)
[copy(vec(u)) for u in u0]
end

function Φ!(residual, cache::MIRKCache, y, u, p = cache.p)
return Φ!(residual, cache.fᵢ_cache, cache.k_discrete, cache.f, cache.TU,
y, u, p, cache.mesh, cache.mesh_dt, cache.stage)
Expand Down
Loading

0 comments on commit 6f40df9

Please sign in to comment.