Skip to content

Commit d3e0c50

Browse files
committed
In generated AST, prefix SVector-references with ModiaBase (ModiaBase.SVector), because StaticArrays need not be available in the environment where the AST is compiled.
1 parent b19318f commit d3e0c50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/StateSelection.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,9 +901,9 @@ function addLinearEquations!(eq::EquationGraph, hasConstantCoefficients::Bool, u
901901
if v_startOrInit isa AbstractVector
902902
# v is a vector
903903
if v_unit == ""
904-
push!(while_body, :( $v_julia_name = SVector{$v_length}(_leq_mode.x[$i1:$i2])) )
904+
push!(while_body, :( $v_julia_name = ModiaBase.SVector{$v_length}(_leq_mode.x[$i1:$i2])) )
905905
else
906-
push!(while_body, :( $v_julia_name = SVector{$v_length}(_leq_mode.x[$i1:$i2])*@u_str($v_unit)) )
906+
push!(while_body, :( $v_julia_name = ModiaBase.SVector{$v_length}(_leq_mode.x[$i1:$i2])*@u_str($v_unit)) )
907907
end
908908
elseif v_startOrInit isa Number || v_startOrInit isa Nothing
909909
# v is a scalar or nothing (= assumed to be a scalar)
@@ -967,7 +967,7 @@ function addLinearEquations!(eq::EquationGraph, hasConstantCoefficients::Bool, u
967967
# Construct for-loop
968968
leq_index = length(eq.equationInfo.linearEquations)
969969
while_loop = quote
970-
global $(vAssigned_names...)
970+
local $(vAssigned_names...)
971971
_leq_mode = initLinearEquationsIteration!(_m, $leq_index)
972972
ModiaBase.TimerOutputs.@timeit _m.timer "LinearEquationsIteration" while ModiaBase.LinearEquationsIteration!(_leq_mode, _m.isInitial, _m.solve_leq, _m.storeResult, _m.time, _m.timer)
973973
$(while_body...)

0 commit comments

Comments
 (0)