Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b3ab1f2
created function basic_patankar_step for oop
SKopecz Dec 29, 2025
6229255
revised MPRK43
SKopecz Dec 29, 2025
71f8d53
revised SSPMPRK oop implementations
SKopecz Dec 29, 2025
75e3f63
format
SKopecz Dec 29, 2025
d14efde
fix SSPMPRK43
SKopecz Dec 30, 2025
fae4106
bugfix SSPMPRK43
SKopecz Dec 30, 2025
327b15c
more structure, more dispatch
SKopecz Jan 2, 2026
915b796
bugfix
SKopecz Jan 2, 2026
6f0be7d
revised SSPMPRK schemes
SKopecz Jan 2, 2026
facb30d
bugfix
SKopecz Jan 2, 2026
4e1bb6a
revised lincomb function
SKopecz Jan 4, 2026
1de95f5
added @muladd
SKopecz Jan 4, 2026
5bae76e
build_mprk_matrix for StaticMatrix
SKopecz Jan 9, 2026
505c2d0
bugfix build_mprk_matrix for StaticMatrix
SKopecz Jan 9, 2026
852dcda
build_mprk_matrix for StaticMatrix without slicing allocations
SKopecz Jan 9, 2026
84ef5d3
format
SKopecz Jan 9, 2026
5e611f2
Revised implementation of build_mprk_matrix for StaticMatrix. Now tes…
SKopecz Jan 10, 2026
49d43e3
lincomb! in MPRK schemes
SKopecz Jan 12, 2026
2324671
bugfix MPRK22
SKopecz Jan 12, 2026
ed7e8dc
remove stale explicit imports
SKopecz Jan 12, 2026
4cc9721
introduced basic_patankar_step! and basic_patankar_step_conservative!
SKopecz Jan 13, 2026
302836f
revised sspmprk
SKopecz Jan 14, 2026
f066803
removed comments
SKopecz Jan 14, 2026
3249f15
add diagonal of sparse matrix efficiently
SKopecz Jan 14, 2026
5faece7
use naive loop to add diagonal of sparse matrices
SKopecz Jan 14, 2026
27e683f
consolidate broadcasts
SKopecz Jan 15, 2026
0ab817c
removed @unpack
SKopecz Jan 15, 2026
903ad7e
Merge branch 'main' into sk/basic_patankar_step
SKopecz Jan 15, 2026
7427043
additional comments in source file
SKopecz Jan 19, 2026
f52a7c7
Update src/mprk.jl
SKopecz Jan 19, 2026
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
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand All @@ -34,7 +33,6 @@ OrdinaryDiffEqCore = "1.21, 2"
RecipesBase = "1.3.4"
Reexport = "1.2.2"
SciMLBase = "2.78"
SimpleUnPack = "1"
SparseArrays = "1"
StaticArrays = "1.9.7"
Statistics = "1"
Expand Down
8 changes: 3 additions & 5 deletions src/PositiveIntegrators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ module PositiveIntegrators
using LinearAlgebra: LinearAlgebra, Tridiagonal, I, diag, mul!
using Statistics: median

using SparseArrays: SparseArrays, AbstractSparseMatrix,
using SparseArrays: SparseArrays, AbstractSparseMatrix, SparseMatrixCSC,
issparse, nonzeros, nzrange, rowvals, spdiagm
using StaticArrays: SVector, SMatrix, StaticArray, @SVector, @SMatrix, MMatrix
using StaticArrays: SVector, SMatrix, StaticArray, StaticMatrix, @SVector, @SMatrix, MMatrix

using FastBroadcast: @..
using MuladdMacro: @muladd
using SimpleUnPack: @unpack

using Reexport: @reexport

Expand All @@ -28,8 +27,7 @@ using LinearSolve: LinearSolve, LinearProblem, LUFactorization, solve!

import SciMLBase: interp_summary

using OrdinaryDiffEqCore: @cache,
OrdinaryDiffEqAdaptiveAlgorithm,
using OrdinaryDiffEqCore: OrdinaryDiffEqAdaptiveAlgorithm,
OrdinaryDiffEqConstantCache, OrdinaryDiffEqMutableCache,
False,
_vec
Expand Down
16 changes: 8 additions & 8 deletions src/mpdec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,8 @@ function _build_mpdec_matrix_and_rhs!(M::AbstractSparseMatrix, rhs, P::AbstractS
end

@muladd function perform_step!(integrator, cache::MPDeCConstantCache, repeat_step = false)
@unpack alg, t, dt, uprev, f, p = integrator
@unpack K, M, nodes, theta, small_constant, ValM = cache
(; alg, t, dt, uprev, f, p) = integrator
(; K, M, nodes, theta, small_constant, ValM) = cache

C = cmatrix(uprev, ValM)
C2 = cmatrix(uprev, ValM)
Expand Down Expand Up @@ -702,9 +702,9 @@ function initialize!(integrator, cache::Union{MPDeCCache, MPDeCConservativeCache
end

@muladd function perform_step!(integrator, cache::MPDeCCache, repeat_step = false)
@unpack t, dt, uprev, u, f, p = integrator
@unpack tmp, P, P2, d, σ, C, C2, linsolve_rhs, linsolve = cache
@unpack K, M, nodes, theta, small_constant = cache.tab
(; t, dt, uprev, u, f, p) = integrator
(; tmp, P, P2, d, σ, C, C2, linsolve_rhs, linsolve) = cache
(; K, M, nodes, theta, small_constant) = cache.tab

# Initialize C matrices
for i in 1:(M + 1)
Expand Down Expand Up @@ -743,9 +743,9 @@ end

@muladd function perform_step!(integrator, cache::MPDeCConservativeCache,
repeat_step = false)
@unpack t, dt, uprev, u, f, p = integrator
@unpack tmp, P, P2, σ, C, C2, linsolve_rhs, linsolve = cache
@unpack K, M, nodes, theta, small_constant = cache.tab
(; t, dt, uprev, u, f, p) = integrator
(; tmp, P, P2, σ, C, C2, linsolve_rhs, linsolve) = cache
(; K, M, nodes, theta, small_constant) = cache.tab

# Initialize right hand side of linear system
linsolve_rhs .= uprev
Expand Down
Loading
Loading