Skip to content

Commit 74daed9

Browse files
committed
Fix wrong link ModiaBase.LinearEquationsIteration! at several places in the docu and in comments
1 parent 0de87d4 commit 74daed9

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

docs/src/TransformationToODEs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ CurrentModule = ModiaBase
5252
StateCategory
5353
ResidualCategory
5454
LinearEquations
55-
LinearEquationsIteration
55+
LinearEquationsIteration!
5656
EquationInfo
5757
StateElementInfo
5858
```

docs/src/Tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ function getDerivatives(_der_x, _x, _m, _time)::Nothing
220220
local var"C.i", var"R.v", var"Ri.v", var"R.p.v"
221221
_leq_mode = _m.linearEquations[1]
222222
_leq_mode.mode = -2
223-
while ModiaBase.LinearEquationsIteration(_leq_mode, _m.isInitial, _m.time, _m.timer)
223+
while ModiaBase.LinearEquationsIteration!(_leq_mode, _m.isInitial, _m.time, _m.timer)
224224
var"C.i" = _leq_mode.vTear_value[1]
225225
var"R.v" = (_p[:R])[:R] * var"C.i"
226226
var"Ri.v" = (_p[:Ri])[:R] * -var"C.i"

src/EquationAndStateInfo.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Define linear equation system "A*x=b" with `x::Vector{FloatType}`.
104104
- If length(x) <= useRecursiveFactorizationUptoSize, then linear equation systems will be solved with
105105
`RecursiveFactorization.jl` instead of the default `lu!(..)` and `ldiv!(..)`.
106106
107-
For details how to use this constructor, see [`LinearEquationsIteration`](@ref).
107+
For details how to use this constructor, see [`LinearEquationsIteration!`](@ref).
108108
"""
109109
mutable struct LinearEquations{FloatType <: Real}
110110
odeMode::Bool # Set from the calling function after LinearEquations was instantiated (default: true)
@@ -137,7 +137,7 @@ mutable struct LinearEquations{FloatType <: Real}
137137
residuals::Vector{FloatType} # Values of the residuals FloatType vector; length(residuals) = length(x)
138138

139139
# Iteration status of for-loop
140-
mode::Int # Operational mode (see function LinearEquationsIteration)
140+
mode::Int # Operational mode (see function LinearEquationsIteration!)
141141
niter::Int # Current number of iterations in the fix point iteration scheme
142142
niter_max::Int # Maximum number of iterations
143143
success::Bool # = true, if solution of A*x = b is successfully computed
@@ -216,7 +216,7 @@ function getDerivatives!(_der_x, _x, _m, _time)::Nothing
216216
...
217217
_leq = _m.linearEquations[<nr>] # leq::LinearEquations{FloatType}
218218
_leq.mode = -3 # initializes the iteration
219-
while LinearEquationsIteration(_leq, _m.isInitial, _m.solve_leq, _m.storeResult, _m.time, _m.timer)
219+
while LinearEquationsIteration!(_leq, _m.isInitial, _m.solve_leq, _m.storeResult, _m.time, _m.timer)
220220
x1 = _leq.x[1]
221221
x2 = _leq.x[2]
222222
x3 = _leq.x_vec[1]
@@ -250,7 +250,7 @@ and used in subsequent calls to solve the equation system.
250250
251251
- `leq::LinearEquations{FloatType}`: Instance of `LinearEquations`.
252252
- `isInitial::Bool`: = true: Called during initialization.
253-
- `solve::Bool`: = true: leq.x is computed by LinearEquationsIteration.
253+
- `solve::Bool`: = true: leq.x is computed by LinearEquationsIteration!.
254254
= false: leq.x has been set by calling environment
255255
(typically when called from DAE integrator).
256256
Note, at events and at terminate, solve must be true).
@@ -281,7 +281,7 @@ leq.mode > 0: Compute "residuals .= A*e_i - b" # e_i = unit vector with i = l
281281
# Hidden argument `leq.mode::Int` on input
282282
283283
```julia
284-
leq.mode = -3 # LinearEquationsIteration is called the first time
284+
leq.mode = -3 # LinearEquationsIteration! is called the first time
285285
if leq.odeMode || solve
286286
# ODE mode or DAE mode at an event (solve "x" from equation "residuals = A*x - b")
287287
# Initialize fixed point iteration or continue fixed point iteration (if in DAE mode)
@@ -353,7 +353,7 @@ function LinearEquationsIteration!(leq::LinearEquations{FloatType}, isInitial::B
353353
nx = length(leq.x)
354354

355355
if mode == -3
356-
# LinearEquationsIteration is called the first time in the current model evaluation
356+
# LinearEquationsIteration! is called the first time in the current model evaluation
357357
leq.niter = 0 # Number of event iterations
358358
empty!(leq.inconsistentPositive)
359359
empty!(leq.inconsistentNegative)
@@ -410,7 +410,7 @@ function LinearEquationsIteration!(leq::LinearEquations{FloatType}, isInitial::B
410410
residuals = leq.residuals
411411

412412
if length(residuals) != length(x)
413-
error("Function LinearEquationsIteration wrongly used:\n",
413+
error("Function LinearEquationsIteration! wrongly used:\n",
414414
"length(leq.residuals) = ", length(leq.residuals), ", length(leq.x) = ", length(leq.x))
415415
end
416416

@@ -453,12 +453,12 @@ function LinearEquationsIteration!(leq::LinearEquations{FloatType}, isInitial::B
453453
else
454454
x .= b
455455
if leq.useRecursiveFactorization
456-
ModiaBase.TimerOutputs.@timeit timer "ModiaBase LinearEquationsIteration (solve A*x=b Rec.Fac.)" begin
456+
ModiaBase.TimerOutputs.@timeit timer "ModiaBase LinearEquationsIteration! (solve A*x=b Rec.Fac.)" begin
457457
leq.luA = RecursiveFactorization.lu!(A, leq.pivots)
458458
ldiv!(leq.luA, x)
459459
end
460460
else
461-
ModiaBase.TimerOutputs.@timeit timer "ModiaBase LinearEquationsIteration (solve A*x=b)" begin
461+
ModiaBase.TimerOutputs.@timeit timer "ModiaBase LinearEquationsIteration! (solve A*x=b)" begin
462462
leq.luA = lu!(A)
463463
ldiv!(leq.luA, x)
464464
end

src/StateSelection.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ function addLinearEquations!(eq::EquationGraph, hasConstantCoefficients::Bool, u
969969
while_loop = quote
970970
local $(vAssigned_names...)
971971
_leq_mode = initLinearEquationsIteration!(_m, $leq_index)
972-
ModiaBase.TimerOutputs.@timeit _m.timer "ModiaBase LinearEquationsIteration" while ModiaBase.LinearEquationsIteration!(_leq_mode, _m.isInitial, _m.solve_leq, _m.storeResult, _m.time, _m.timer)
972+
ModiaBase.TimerOutputs.@timeit _m.timer "ModiaBase LinearEquationsIteration!" while ModiaBase.LinearEquationsIteration!(_leq_mode, _m.isInitial, _m.solve_leq, _m.storeResult, _m.time, _m.timer)
973973
$(while_body...)
974974
end
975975
_leq_mode = nothing
@@ -1205,7 +1205,7 @@ For every equation set on every differentiation level perform the following acti
12051205
The equations are first teared to reduce the number of iteration variables and
12061206
afterwards the teared equation system is solved with a special iterator loop that
12071207
solves a linear equation system with an LU decomposition with column pivoting
1208-
(for details see [`ModiaBase.LinearEquationsIteration`](@ref)).\\
1208+
(for details see [`ModiaBase.LinearEquationsIteration!`](@ref)).\\
12091209
12101210
- If the equation set consists of *N linear* equations in *M* unknowns (*M > N*) perform
12111211
the following actions (*error, if no linear system*).\\

0 commit comments

Comments
 (0)