Skip to content

Commit 5c45f60

Browse files
committed
Minor corrections in linear equations code generation
1 parent f09c57d commit 5c45f60

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 = ModiaBase.SVector{$v_length}(_leq_mode.x[$i1:$i2])) )
904+
push!(while_body, :( $v_julia_name = ModiaBase.SVector{$v_length,_FloatType}(_leq_mode.x[$i1:$i2])::ModiaBase.SVector{$v_length,_FloatType}) )
905905
else
906-
push!(while_body, :( $v_julia_name = ModiaBase.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])::ModiaBase.SVector{$v_length,_FloatType}*@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)
@@ -955,7 +955,7 @@ function addLinearEquations!(eq::EquationGraph, hasConstantCoefficients::Bool, u
955955
# Add residual equations
956956
# appendResidual!(leq.residuals, < equation in residual form >)
957957
for (i,e) in enumerate(eq.eResiduals)
958-
e_AST = eq.fc.getResidualEquationAST(e, :(_leq_mode.residual_value[$i]) )
958+
e_AST = eq.fc.getResidualEquationAST(e, :(_leq_mode.residuals[$i]) )
959959
if !isnothing(e_AST)
960960
push!(while_body, e_AST)
961961
end

0 commit comments

Comments
 (0)