Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/OrdinaryDiffEqOperatorSplitting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import SciMLBase: DEIntegrator, NullParameters, isadaptive

import RecursiveArrayTools

import OrdinaryDiffEqCore
import OrdinaryDiffEqCore: OrdinaryDiffEqCore, isdtchangeable,
stepsize_controller!, step_accept_controller!, step_reject_controller!

abstract type AbstractOperatorSplitFunction <: SciMLBase.AbstractODEFunction{true} end
abstract type AbstractOperatorSplittingAlgorithm end
abstract type AbstractOperatorSplittingCache end

@inline SciMLBase.isadaptive(::AbstractOperatorSplittingAlgorithm) = false
@inline isdtchangeable(alg::AbstractOperatorSplittingAlgorithm) = all(isdtchangeable.(alg.inner_algs))

include("function.jl")
include("problem.jl")
Expand Down
15 changes: 14 additions & 1 deletion src/function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@ struct GenericSplitFunction{fSetType <: Tuple, idxSetType <: Tuple, sSetType <:
# Operators to update the ode function parameters.
synchronizers::sSetType
function GenericSplitFunction(fs::Tuple, drs::Tuple, syncers::Tuple)
@assert length(fs) == length(drs) == length(syncers)
@assert length(fs) == length(drs) == length(syncers) "Number of input tuples does not match."
gsf_recursive_function_type_safety_check.(fs)
return new{typeof(fs), typeof(drs), typeof(syncers)}(fs, drs, syncers)
end
end

function gsf_recursive_function_type_safety_check(f::GenericSplitFunction)
return gsf_recursive_function_type_safety_check.(f.functions)
end

function gsf_recursive_function_type_safety_check(dunno)
return @warn "One of the inner functions in GenericSplitFunction is of type $(typeof(dunno)) which is not a subtype of SciMLBase.AbstractDiffEqFunction."
end

function gsf_recursive_function_type_safety_check(::SciMLBase.AbstractDiffEqFunction)
# OK
end

num_operators(f::GenericSplitFunction) = length(f.functions)

"""
Expand Down
Loading
Loading