Skip to content

Commit 58666f9

Browse files
fix: use new varmap_to_vars
1 parent bf1b9b8 commit 58666f9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/systems/problem_utils.jl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,8 +1211,8 @@ Keyword arguments:
12111211
- `fully_determined`: Override whether the initialization system is fully determined.
12121212
- `check_initialization_units`: Enable or disable unit checks when constructing the
12131213
initialization problem.
1214-
- `tofloat`, `is_initializeprob`: Passed to [`better_varmap_to_vars`](@ref) for building `u0` (and possibly `p`).
1215-
- `u0_constructor`: A function to apply to the `u0` value returned from `better_varmap_to_vars`
1214+
- `tofloat`, `is_initializeprob`: Passed to [`varmap_to_vars`](@ref) for building `u0` (and possibly `p`).
1215+
- `u0_constructor`: A function to apply to the `u0` value returned from `varmap_to_vars`
12161216
to construct the final `u0` value.
12171217
- `p_constructor`: A function to apply to each array buffer created when constructing the parameter object.
12181218
- `du0map`: A map of derivatives to values. See `implicit_dae`.
@@ -1333,11 +1333,10 @@ function process_SciMLProblem(
13331333
@warn "Cycles in unknowns:\n$msg"
13341334
end
13351335
end
1336-
evaluate_varmap!(op, dvs; limit = substitution_limit)
13371336

1338-
u0 = better_varmap_to_vars(
1339-
op, dvs; tofloat, floatT,
1340-
container_type = u0Type, allow_symbolic = symbolic_u0, is_initializeprob)
1337+
u0 = varmap_to_vars(
1338+
op, dvs; tofloat, floatT, container_type = u0Type, allow_symbolic = symbolic_u0,
1339+
is_initializeprob, substitution_limit)
13411340

13421341
if u0 !== nothing
13431342
u0 = u0_constructor(u0)
@@ -1358,15 +1357,15 @@ function process_SciMLProblem(
13581357
@warn "Cycles in parameters:\n$msg"
13591358
end
13601359
end
1361-
evaluate_varmap!(op, ps; limit = substitution_limit)
1360+
13621361
if is_split(sys)
13631362
# `pType` is usually `Dict` when the user passes key-value pairs.
13641363
if !(pType <: AbstractArray)
13651364
pType = Array
13661365
end
13671366
p = MTKParameters(sys, op; floatT = floatT, p_constructor)
13681367
else
1369-
p = p_constructor(better_varmap_to_vars(op, ps; tofloat, container_type = pType))
1368+
p = p_constructor(varmap_to_vars(op, ps; tofloat, container_type = pType))
13701369
end
13711370

13721371
if implicit_dae && du0map !== nothing

test/discrete_system.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ syss = structural_simplify(sys)
3737
df = DiscreteFunction(syss)
3838
# iip
3939
du = zeros(3)
40-
u = ModelingToolkit.better_varmap_to_vars(
40+
u = ModelingToolkit.varmap_to_vars(
4141
Dict([S(k - 1) => 1, I(k - 1) => 2, R(k - 1) => 3]), unknowns(syss))
4242
p = MTKParameters(syss, [c, nsteps, δt, β, γ] .=> collect(1:5))
4343
df.f(du, u, p, 0)

0 commit comments

Comments
 (0)