Skip to content

Commit c107932

Browse files
authored
Add @add_kwonly to PDESystem (#768)
1 parent 0ec5676 commit c107932

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/ModelingToolkit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import SymbolicUtils: Term, Add, Mul, Pow, Sym, FnType,
2929
promote_symtype
3030

3131
import SymbolicUtils.Rewriters: Chain, Postwalk, Prewalk, Fixpoint
32-
32+
import DiffEqBase: @add_kwonly
3333
using LinearAlgebra: LU, BlasInt
3434

3535
import LightGraphs: SimpleDiGraph, add_edge!

src/systems/pde/pdesystem.jl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
struct PDESystem <: ModelingToolkit.AbstractSystem
2-
eq
2+
eqs
33
bcs
44
domain
55
indvars
66
depvars
7+
8+
@add_kwonly function PDESystem(eqs, bcs, domain, indvars, depvars)
9+
new(eqs, bcs, domain, indvars, depvars)
10+
end
711
end
12+
13+
Base.getproperty(x::PDESystem, sym::Symbol) = getfield(x, sym)
14+
15+
Base.summary(prob::PDESystem) = string(nameof(typeof(prob)))
16+
function Base.show(io::IO, sys::PDESystem)
17+
println(io,summary(sys))
18+
println(io,"eqs: ", sys.eqs)
19+
println(io,"bcs: ", sys.bcs)
20+
println(io,"domain: ", sys.domain)
21+
println(io,"depvars: ", sys.depvars)
22+
println(io,"indvars: ", sys.indvars)
23+
return nothing
24+
end
25+

0 commit comments

Comments
 (0)