diff --git a/src/DormandPrince.jl b/src/DormandPrince.jl index feb5d21..05852dc 100644 --- a/src/DormandPrince.jl +++ b/src/DormandPrince.jl @@ -5,6 +5,7 @@ using Base.Iterators:repeated, Repeated # internal imports include("types.jl") include("hinit.jl") +include("checks.jl") include("interface.jl") include("dp5/mod.jl") diff --git a/src/dp5/checks.jl b/src/checks.jl similarity index 100% rename from src/dp5/checks.jl rename to src/checks.jl diff --git a/src/dp5/mod.jl b/src/dp5/mod.jl index d1983e1..9239506 100644 --- a/src/dp5/mod.jl +++ b/src/dp5/mod.jl @@ -1,10 +1,19 @@ module DP5 -using ..DormandPrince: DormandPrince, DP5Solver, Vars, Consts, Options, Report, hinit +using ..DormandPrince: DormandPrince, + DP5Solver, + Vars, + Consts, + Options, + Report, + hinit, + check_beta, + check_max_allowed_steps, + check_safety_factor, + check_uround include("params.jl") include("helpers.jl") -include("checks.jl") include("solver.jl") end \ No newline at end of file diff --git a/src/dp8/checks.jl b/src/dp8/checks.jl deleted file mode 100644 index 4daf0f2..0000000 --- a/src/dp8/checks.jl +++ /dev/null @@ -1,34 +0,0 @@ -# include("types.jl") - -# make enums for every error type and return that instead of printing errors -function check_max_allowed_steps(options::Options{T}) where T - if options.maximum_allowed_steps < 0 - return false - else - return true - end -end - -function check_uround(options::Options{T}) where T - if (options.uround <= 1e-35) || (options.uround >= 1.0) - return false - else - return true - end -end - -function check_beta(options::Options{T}) where T - if options.beta > 0.2 - return false - else - return true - end -end - -function check_safety_factor(options::Options{T}) where T - if (options.safety_factor >= 1.0) || (options.safety_factor <= 1e-4) - return false - else - return true - end -end \ No newline at end of file diff --git a/src/dp8/mod.jl b/src/dp8/mod.jl index 0143398..5cf07d6 100644 --- a/src/dp8/mod.jl +++ b/src/dp8/mod.jl @@ -1,10 +1,19 @@ module DP8 -using ..DormandPrince: DormandPrince, DP8Solver, Vars, Consts, Options, Report, hinit +using ..DormandPrince: DormandPrince, + DP8Solver, + Vars, + Consts, + Options, + Report, + hinit, + check_beta, + check_max_allowed_steps, + check_safety_factor, + check_uround include("params.jl") include("helpers.jl") -include("checks.jl") include("solver.jl") end \ No newline at end of file