Skip to content

Commit ff6c8ab

Browse files
Merge pull request #2431 from sathvikbhagavan/sb/pdesystem
fix(pdesystem): parameters are vector of Num instead of vector of pairs when analytic is also passed
2 parents 5674174 + b54d087 commit ff6c8ab

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/systems/pde/pdesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct PDESystem <: ModelingToolkit.AbstractMultivariateSystem
113113
if isnothing(analytic_func)
114114
analytic_func = map(analytic) do eq
115115
args = arguments(eq.lhs)
116-
p = ps isa SciMLBase.NullParameters ? [] : map(a -> a.first, ps)
116+
p = ps isa SciMLBase.NullParameters ? [] : ps
117117
args = vcat(DestructuredArgs(p), args)
118118
ex = Func(args, [], eq.rhs) |> toexpr
119119
eq.lhs => drop_expr(@RuntimeGeneratedFunction(eval_module, ex))

test/pde.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ domains = [t ∈ (0.0, 1.0),
1616
analytic = [u(t, x) ~ -h * x * (x - 1) * sin(x) * exp(-2 * h * t)]
1717
analytic_function = (ps, t, x) -> -ps[1] * x * (x - 1) * sin(x) * exp(-2 * ps[1] * t)
1818

19-
@named pdesys = PDESystem(eq, bcs, domains, [t, x], [u], [h => 1], analytic = analytic)
19+
@named pdesys = PDESystem(eq, bcs, domains, [t, x], [u], [h], analytic = analytic)
2020
@show pdesys
2121

2222
@test all(isequal.(independent_variables(pdesys), [t, x]))

test/symbolic_indexing_interface.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ domains = [t ∈ (0.0, 1.0),
7272
analytic = [u(t, x) ~ -h * x * (x - 1) * sin(x) * exp(-2 * h * t)]
7373
analytic_function = (ps, t, x) -> -ps[1] * x * (x - 1) * sin(x) * exp(-2 * ps[1] * t)
7474

75-
@named pdesys = PDESystem(eq, bcs, domains, [t, x], [u], [h => 1], analytic = analytic)
75+
@named pdesys = PDESystem(eq, bcs, domains, [t, x], [u], [h], analytic = analytic)
7676

77-
@test isequal(pdesys.ps, [h => 1])
77+
@test isequal(pdesys.ps, [h])
7878
@test isequal(parameter_symbols(pdesys), [h])
7979
@test isequal(parameters(pdesys), [h])

0 commit comments

Comments
 (0)