@@ -87,6 +87,10 @@ struct NonlinearSystem <: AbstractTimeIndependentSystem
87
87
"""
88
88
gui_metadata:: Union{Nothing, GUIMetadata}
89
89
"""
90
+ Whether this is an initialization system.
91
+ """
92
+ is_initializesystem:: Bool
93
+ """
90
94
Cache for intermediate tearing state.
91
95
"""
92
96
tearing_state:: Any
@@ -116,6 +120,7 @@ struct NonlinearSystem <: AbstractTimeIndependentSystem
116
120
tag, eqs, unknowns, ps, var_to_name, observed, jac, name, description,
117
121
systems, defaults, guesses, initializesystem, initialization_eqs, connector_type,
118
122
parameter_dependencies = Equation[], metadata = nothing , gui_metadata = nothing ,
123
+ is_initializesystem = false ,
119
124
tearing_state = nothing , substitutions = nothing , namespacing = true ,
120
125
complete = false , index_cache = nothing , parent = nothing ,
121
126
isscheduled = false ; checks:: Union{Bool, Int} = true )
@@ -126,7 +131,8 @@ struct NonlinearSystem <: AbstractTimeIndependentSystem
126
131
end
127
132
new (tag, eqs, unknowns, ps, var_to_name, observed, jac, name, description,
128
133
systems, defaults, guesses, initializesystem, initialization_eqs,
129
- connector_type, parameter_dependencies, metadata, gui_metadata, tearing_state,
134
+ connector_type, parameter_dependencies, metadata, gui_metadata,
135
+ is_initializesystem, tearing_state,
130
136
substitutions, namespacing, complete, index_cache, parent, isscheduled)
131
137
end
132
138
end
@@ -148,7 +154,8 @@ function NonlinearSystem(eqs, unknowns, ps;
148
154
checks = true ,
149
155
parameter_dependencies = Equation[],
150
156
metadata = nothing ,
151
- gui_metadata = nothing )
157
+ gui_metadata = nothing ,
158
+ is_initializesystem = false )
152
159
continuous_events === nothing || isempty (continuous_events) ||
153
160
throw (ArgumentError (" NonlinearSystem does not accept `continuous_events`, you provided $continuous_events " ))
154
161
discrete_events === nothing || isempty (discrete_events) ||
@@ -196,7 +203,7 @@ function NonlinearSystem(eqs, unknowns, ps;
196
203
NonlinearSystem (Threads. atomic_add! (SYSTEM_COUNT, UInt (1 )),
197
204
eqs, dvs′, ps′, var_to_name, observed, jac, name, description, systems, defaults,
198
205
guesses, initializesystem, initialization_eqs, connector_type, parameter_dependencies,
199
- metadata, gui_metadata, checks = checks)
206
+ metadata, gui_metadata, is_initializesystem, checks = checks)
200
207
end
201
208
202
209
function NonlinearSystem (eqs; kwargs... )
0 commit comments