Skip to content

Commit

Permalink
Merge pull request #3 from Shreyas-Ekanathan/head
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
Shreyas-Ekanathan authored Jul 24, 2024
2 parents 84ef783 + 0ba696d commit b9083ff
Show file tree
Hide file tree
Showing 23 changed files with 1,898 additions and 1,618 deletions.
27 changes: 27 additions & 0 deletions lib/OrdinaryDiffEqBDF/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name = "OrdinaryDiffEqBDF"
uuid = "6ad6398a-0878-4a85-9266-38940aa047c8"
authors = ["ParamThakkar123 <[email protected]>"]
version = "1.0.0"

[deps]
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
TruncatedStacktraces = "781d530d-4396-4725-bb49-402e4bee1e77"
MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

[extras]
DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
julia = "1.10"

[targets]
test = ["DiffEqDevTools", "Random", "SafeTestsets", "Test"]
41 changes: 41 additions & 0 deletions lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module OrdinaryDiffEqBDF

import OrdinaryDiffEq: alg_order, calculate_residuals!,
initialize!, perform_step!, @unpack, unwrap_alg,
calculate_residuals, alg_extrapolates,
OrdinaryDiffEqAlgorithm,
OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache,
OrdinaryDiffEqNewtonAdaptiveAlgorithm,
OrdinaryDiffEqNewtonAlgorithm,
AbstractController, DEFAULT_PRECS,
CompiledFloats, uses_uprev,
NLNewton, alg_cache, _vec, _reshape, @cache,
isfsal, full_cache, build_nlsolver,
nlsolve!, nlsolvefail, isnewton,
constvalue, _unwrap_val,
DIRK, set_new_W!,
du_alias_or_new, trivial_limiter!,
ImplicitEulerConstantCache,
ImplicitEulerCache, COEFFICIENT_MULTISTEP,
markfirststage!, UJacobianWrapper, mul!,
issplit, qsteady_min_default, qsteady_max_default,
get_current_alg_order, get_current_adaptive_order,
default_controller, stepsize_controller!, step_accept_controller!,
step_reject_controller!, post_newton_controller!,
u_modified!
using TruncatedStacktraces, MuladdMacro, MacroTools, FastBroadcast, RecursiveArrayTools
import StaticArrays: SArray, MVector, SVector, @SVector, StaticArray, MMatrix, SA
using LinearAlgebra: I
using ArrayInterface

include("algorithms.jl")
include("alg_utils.jl")
include("bdf_utils.jl")
include("bdf_caches.jl")
include("controllers.jl")
include("bdf_perform_step.jl")

export ABDF2, QNDF1, QBDF1, QNDF2, QBDF2, QNDF, QBDF, FBDF,
SBDF2, SBDF3, SBDF4, MEBDF2, IMEXEuler, IMEXEulerARK

end
26 changes: 26 additions & 0 deletions lib/OrdinaryDiffEqBDF/src/alg_utils.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
alg_extrapolates(alg::ABDF2) = true
alg_extrapolates(alg::SBDF) = true
alg_extrapolates(alg::MEBDF2) = true

alg_order(alg::ABDF2) = 2
alg_order(alg::SBDF) = alg.order
alg_order(alg::QNDF1) = 1
alg_order(alg::QNDF2) = 2
alg_order(alg::QNDF) = 1 #dummy value
alg_order(alg::MEBDF2) = 2
alg_order(alg::FBDF) = 1 #dummy value

issplit(alg::SBDF) = true

qsteady_min_default(alg::FBDF) = 9 // 10

qsteady_max_default(alg::QNDF) = 2 // 1
qsteady_max_default(alg::QNDF2) = 2 // 1
qsteady_max_default(alg::QNDF1) = 2 // 1
qsteady_max_default(alg::FBDF) = 2 // 1

get_current_alg_order(alg::QNDF, cache) = cache.order
get_current_alg_order(alg::FBDF, cache) = cache.order

get_current_adaptive_order(alg::QNDF, cache) = cache.order
get_current_adaptive_order(alg::FBDF, cache) = cache.order
Loading

0 comments on commit b9083ff

Please sign in to comment.