File tree 1 file changed +4
-29
lines changed
1 file changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -263,42 +263,17 @@ namespace GridKit
263
263
*/
264
264
int evaluateResidual ()
265
265
{
266
- // Update variables
267
- IdxT varOffset = 0 ;
268
- IdxT optOffset = 0 ;
266
+ // No need to notify children yet, since we're about to
267
+ // evaluate them
268
+ updateChildren<false >();
269
+
269
270
for (const auto & bus : buses_)
270
271
{
271
- for (IdxT j = 0 ; j < bus->size (); ++j)
272
- {
273
- bus->y ()[j] = y_[varOffset + j];
274
- bus->yp ()[j] = yp_[varOffset + j];
275
- }
276
- varOffset += bus->size ();
277
-
278
- for (IdxT j = 0 ; j < bus->sizeParams (); ++j)
279
- {
280
- bus->param ()[j] = param_[optOffset + j];
281
- }
282
- optOffset += bus->sizeParams ();
283
-
284
272
bus->evaluateResidual ();
285
273
}
286
274
287
275
for (const auto & component : components_)
288
276
{
289
- for (IdxT j = 0 ; j < component->size (); ++j)
290
- {
291
- component->y ()[j] = y_[varOffset + j];
292
- component->yp ()[j] = yp_[varOffset + j];
293
- }
294
- varOffset += component->size ();
295
-
296
- for (IdxT j = 0 ; j < component->sizeParams (); ++j)
297
- {
298
- component->param ()[j] = param_[optOffset + j];
299
- }
300
- optOffset += component->sizeParams ();
301
-
302
277
component->evaluateResidual ();
303
278
}
304
279
You can’t perform that action at this time.
0 commit comments