cronos-mcpp 5.0.0__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cronos.pyi ADDED
@@ -0,0 +1,3810 @@
1
+ """
2
+ Python interface of CRONOS: models of differential-algebraic systems on the DAG of MC++ (``FFModel``), and their
3
+ solvers -- ``ODESLV`` (CVODES, with forward and adjoint sensitivities) and ``OCFESLV`` (orthogonal collocation on
4
+ finite elements) -- plus their embedding as DAG operations (``FFODESLV``, ``FFOCFESLV``, ``FFOCFERES``).
5
+
6
+ The DAG types (``FFGraph``, ``FFVar``, ``FFOp``) and the operators ``FFPartial``, ``FFIntegral``, ``FFEval`` come
7
+ from ``pymcpp``, which this module imports.
8
+ """
9
+ from __future__ import annotations
10
+ import collections.abc
11
+ import enum
12
+ import numpy
13
+ import numpy.typing
14
+ import pymcpp
15
+ import typing
16
+ __all__: list[str] = ['FFDom', 'FFGradOCFERES', 'FFGradOCFESLV', 'FFGradODESLV', 'FFModel', 'FFOCFERES', 'FFOCFESLV', 'FFODESLV', 'OCFESLV', 'ODESLV', 'build_info']
17
+ class FFDom:
18
+ """
19
+ Domain of an independent variable: bounds, finite elements, and the
20
+ collocation node family and count per element. Passed to
21
+ ``FFModel.add_domain`` (and to ``add_input`` for an input's own node family).
22
+
23
+ Its enumerations double as the masks and sides used elsewhere:
24
+
25
+ - ``DOM``: ``ALL`` (the closed domain [a,b]), ``LB`` (a) and ``UB`` (b); masks
26
+ combine by arithmetic, e.g. ``FFDom.ALL - FFDom.LB`` is (a,b];
27
+ - ``SIDE``: ``MINUS`` (tau^-, default) and ``PLUS`` (tau^+), for one-sided
28
+ evaluations;
29
+ - ``TYPE``: ``LG``, ``LGR``, ``LGL``, ``CGL`` node families.
30
+
31
+ Example:
32
+
33
+ >>> from cronos import FFDom
34
+ >>> T = FFDom(0., 1., 10, FFDom.LGR, 4) # 10 elements, 4 Radau nodes each
35
+ >>> Z = FFDom([0., .2, 1.], FFDom.LGL, 6) # 2 elements from boundaries
36
+ """
37
+ class DOM(enum.IntEnum):
38
+ """
39
+ Domain masks for equations and outputs.
40
+ """
41
+ ALL: typing.ClassVar[FFDom.DOM]
42
+ LB: typing.ClassVar[FFDom.DOM]
43
+ UB: typing.ClassVar[FFDom.DOM]
44
+ @classmethod
45
+ def __new__(cls, value):
46
+ ...
47
+ class SIDE:
48
+ """
49
+ Side of a point evaluation.
50
+
51
+ Members:
52
+
53
+ MINUS : tau^-: the end of the element ending at tau (default)
54
+
55
+ PLUS : tau^+: the start of the element starting at tau
56
+ """
57
+ MINUS: typing.ClassVar[FFDom.SIDE]
58
+ PLUS: typing.ClassVar[FFDom.SIDE]
59
+ __members__: typing.ClassVar[dict[str, FFDom.SIDE]]
60
+ def __eq__(self, other: typing.Any) -> bool:
61
+ ...
62
+ def __getstate__(self) -> int:
63
+ ...
64
+ def __hash__(self) -> int:
65
+ ...
66
+ def __index__(self) -> int:
67
+ ...
68
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
69
+ ...
70
+ def __int__(self) -> int:
71
+ ...
72
+ def __ne__(self, other: typing.Any) -> bool:
73
+ ...
74
+ def __repr__(self) -> str:
75
+ ...
76
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
77
+ ...
78
+ def __str__(self) -> str:
79
+ ...
80
+ @property
81
+ def name(self) -> str:
82
+ ...
83
+ @property
84
+ def value(self) -> int:
85
+ ...
86
+ class TYPE:
87
+ """
88
+ Collocation node family.
89
+
90
+ Members:
91
+
92
+ LG : Legendre-Gauss
93
+
94
+ LGR : Legendre-Gauss-Radau, left endpoint included
95
+
96
+ LGL : Legendre-Gauss-Lobatto, both endpoints included
97
+
98
+ CGL : Chebyshev-Gauss-Lobatto, both endpoints included
99
+ """
100
+ CGL: typing.ClassVar[FFDom.TYPE]
101
+ LG: typing.ClassVar[FFDom.TYPE]
102
+ LGL: typing.ClassVar[FFDom.TYPE]
103
+ LGR: typing.ClassVar[FFDom.TYPE]
104
+ __members__: typing.ClassVar[dict[str, FFDom.TYPE]]
105
+ def __eq__(self, other: typing.Any) -> bool:
106
+ ...
107
+ def __getstate__(self) -> int:
108
+ ...
109
+ def __hash__(self) -> int:
110
+ ...
111
+ def __index__(self) -> int:
112
+ ...
113
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
114
+ ...
115
+ def __int__(self) -> int:
116
+ ...
117
+ def __ne__(self, other: typing.Any) -> bool:
118
+ ...
119
+ def __repr__(self) -> str:
120
+ ...
121
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
122
+ ...
123
+ def __str__(self) -> str:
124
+ ...
125
+ @property
126
+ def name(self) -> str:
127
+ ...
128
+ @property
129
+ def value(self) -> int:
130
+ ...
131
+ class Exceptions:
132
+ """
133
+ Exception information for errors raised while defining a domain.
134
+
135
+ Instances carry an error code (ierr) and a human-readable description (what).
136
+ """
137
+ class TYPE:
138
+ """
139
+ Error codes for FFDom exceptions
140
+
141
+ Members:
142
+
143
+ BOUNDS : Invalid domain bounds
144
+
145
+ ELEMENTS : Invalid number of elements
146
+
147
+ NODES : Invalid number of collocation points
148
+
149
+ UNDEF : Undefined
150
+ """
151
+ BOUNDS: typing.ClassVar[FFDom.Exceptions.TYPE]
152
+ ELEMENTS: typing.ClassVar[FFDom.Exceptions.TYPE]
153
+ NODES: typing.ClassVar[FFDom.Exceptions.TYPE]
154
+ UNDEF: typing.ClassVar[FFDom.Exceptions.TYPE]
155
+ __members__: typing.ClassVar[dict[str, FFDom.Exceptions.TYPE]]
156
+ def __eq__(self, other: typing.Any) -> bool:
157
+ ...
158
+ def __getstate__(self) -> int:
159
+ ...
160
+ def __hash__(self) -> int:
161
+ ...
162
+ def __index__(self) -> int:
163
+ ...
164
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
165
+ ...
166
+ def __int__(self) -> int:
167
+ ...
168
+ def __ne__(self, other: typing.Any) -> bool:
169
+ ...
170
+ def __repr__(self) -> str:
171
+ ...
172
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
173
+ ...
174
+ def __str__(self) -> str:
175
+ ...
176
+ @property
177
+ def name(self) -> str:
178
+ ...
179
+ @property
180
+ def value(self) -> int:
181
+ ...
182
+ BOUNDS: typing.ClassVar[FFDom.Exceptions.TYPE]
183
+ ELEMENTS: typing.ClassVar[FFDom.Exceptions.TYPE]
184
+ NODES: typing.ClassVar[FFDom.Exceptions.TYPE]
185
+ UNDEF: typing.ClassVar[FFDom.Exceptions.TYPE]
186
+ def ierr(self) -> int:
187
+ """
188
+ Return the error code as an integer (see FFDom.Exceptions.TYPE).
189
+ """
190
+ def what(self) -> str:
191
+ """
192
+ Return a string describing the error.
193
+ """
194
+ ALL: typing.ClassVar[FFDom.DOM]
195
+ CGL: typing.ClassVar[FFDom.TYPE]
196
+ LB: typing.ClassVar[FFDom.DOM]
197
+ LG: typing.ClassVar[FFDom.TYPE]
198
+ LGL: typing.ClassVar[FFDom.TYPE]
199
+ LGR: typing.ClassVar[FFDom.TYPE]
200
+ MINUS: typing.ClassVar[FFDom.SIDE]
201
+ PLUS: typing.ClassVar[FFDom.SIDE]
202
+ UB: typing.ClassVar[FFDom.DOM]
203
+ @typing.overload
204
+ def __init__(self) -> None:
205
+ """
206
+ Empty domain.
207
+ """
208
+ @typing.overload
209
+ def __init__(self, lo: typing.SupportsFloat | typing.SupportsIndex, up: typing.SupportsFloat | typing.SupportsIndex, n_elem: typing.SupportsInt | typing.SupportsIndex = 1, type: FFDom.TYPE = ..., n_node: typing.SupportsInt | typing.SupportsIndex = 4) -> None:
210
+ """
211
+ Uniform finite elements on [lo, up] (one element by default).
212
+ """
213
+ @typing.overload
214
+ def __init__(self, elem_bnd: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], type: FFDom.TYPE = ..., n_node: typing.SupportsInt | typing.SupportsIndex = 4) -> None:
215
+ """
216
+ Finite elements from their boundaries (size n_elem+1).
217
+ """
218
+ @typing.overload
219
+ def __init__(self, lo: typing.SupportsFloat | typing.SupportsIndex, elem_len: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], type: FFDom.TYPE = ..., n_node: typing.SupportsInt | typing.SupportsIndex = 4) -> None:
220
+ """
221
+ Finite elements from the lower bound and the element lengths.
222
+ """
223
+ @typing.overload
224
+ def __init__(self, other: FFDom) -> None:
225
+ """
226
+ Copy.
227
+ """
228
+ def __repr__(self) -> str:
229
+ ...
230
+ def elem_lo(self, iel: typing.SupportsInt | typing.SupportsIndex) -> float:
231
+ """
232
+ Lower bound of element ``iel``.
233
+ """
234
+ def elem_up(self, iel: typing.SupportsInt | typing.SupportsIndex) -> float:
235
+ """
236
+ Upper bound of element ``iel``.
237
+ """
238
+ def elem_width(self, iel: typing.SupportsInt | typing.SupportsIndex) -> float:
239
+ """
240
+ Length of element ``iel``.
241
+ """
242
+ def uniform(self) -> bool:
243
+ """
244
+ True if all elements have the same length (to tolerance).
245
+ """
246
+ @property
247
+ def elem_bnd(self) -> list[float]:
248
+ """
249
+ Element boundaries, size n_elem+1.
250
+ """
251
+ @property
252
+ def elem_len(self) -> list[float]:
253
+ """
254
+ Element lengths, size n_elem.
255
+ """
256
+ @property
257
+ def lo_dom(self) -> float:
258
+ """
259
+ Lower bound.
260
+ """
261
+ @property
262
+ def n_elem(self) -> int:
263
+ """
264
+ Number of finite elements.
265
+ """
266
+ @property
267
+ def n_node(self) -> int:
268
+ """
269
+ Number of collocation nodes per element.
270
+ """
271
+ @property
272
+ def type(self) -> FFDom.TYPE:
273
+ """
274
+ Collocation node family.
275
+ """
276
+ @property
277
+ def up_dom(self) -> float:
278
+ """
279
+ Upper bound.
280
+ """
281
+ class FFModel:
282
+ """
283
+ Model of a differential-algebraic system on the DAG of MC++, shared by the
284
+ CRONOS solvers.
285
+
286
+ A model is declared on an ``FFGraph``: domains of the independent variables
287
+ (``add_domain``, with an ``FFDom``), states and inputs over subsets of these
288
+ domains, constants, equations with a region (masks per domain) and a role,
289
+ outputs (point values, integrals, or distributed values), and transitions
290
+ (jumps of the states at an interior point of the evolution domain).
291
+ ``setup()`` validates and analyses the model; the solvers (``ODESLV``,
292
+ ``OCFESLV``) derive from ``FFModel`` and call it themselves.
293
+
294
+ Example -- the scalar ODE x' = -k x, x(0) = 1, output x(1):
295
+
296
+ >>> from pymcpp import FFGraph, FFPartial, FFEval
297
+ >>> from cronos import FFDom, FFModel, ODESLV
298
+ >>> G = FFGraph(); t, x = G.add_var("t"), G.add_var("x")
299
+ >>> OpP, OpE = FFPartial(), FFEval()
300
+ >>> M = ODESLV(G)
301
+ >>> M.add_domain(t, FFDom(0., 1., 1)); M.set_evolution_domain(t)
302
+ >>> M.add_state(x, [t])
303
+ >>> M.add_equation(OpP(x, t) + .7*x, [t], [FFDom.ALL - FFDom.LB])
304
+ >>> M.add_equation(x - 1., [t], [FFDom.LB])
305
+ >>> M.add_output(OpE(x, t, 1.))
306
+ """
307
+ class DofIndex:
308
+ """
309
+ Position of one degree of freedom of a distributed input: its element and its
310
+ node within the element, per domain.
311
+ """
312
+ def __init__(self) -> None:
313
+ ...
314
+ @property
315
+ def element(self) -> dict[pymcpp.FFVar, int]:
316
+ """
317
+ Element index per domain, ``{domain: element}``.
318
+ """
319
+ @element.setter
320
+ def element(self, arg0: collections.abc.Mapping[pymcpp.FFVar, typing.SupportsInt | typing.SupportsIndex]) -> None:
321
+ ...
322
+ @property
323
+ def node(self) -> dict[pymcpp.FFVar, int]:
324
+ """
325
+ Node index within the element per domain, ``{domain: node}``.
326
+ """
327
+ @node.setter
328
+ def node(self, arg0: collections.abc.Mapping[pymcpp.FFVar, typing.SupportsInt | typing.SupportsIndex]) -> None:
329
+ ...
330
+ class Exceptions:
331
+ """
332
+ Exception information for errors raised by a model or its solvers (the same
333
+ type as OCFESLV.Exceptions).
334
+
335
+ Instances carry an error code (ierr) and a human-readable description (what).
336
+ """
337
+ class TYPE:
338
+ """
339
+ Error codes for FFModel exceptions
340
+
341
+ Members:
342
+
343
+ SETUP : Incomplete setup before evaluation
344
+
345
+ INDEX : Index mismatch in data access
346
+
347
+ DOMAIN : Variable-domain misspecification in expression
348
+
349
+ ENV : Environment mismatch in collocation operation
350
+
351
+ CSTVAL : Undefined constant values
352
+
353
+ UNDEF : Undefined collocation operation
354
+
355
+ INTERNAL : Internal error
356
+
357
+ NOSTORE : No stored solution available for a buffer-free read
358
+ """
359
+ CSTVAL: typing.ClassVar[FFModel.Exceptions.TYPE]
360
+ DOMAIN: typing.ClassVar[FFModel.Exceptions.TYPE]
361
+ ENV: typing.ClassVar[FFModel.Exceptions.TYPE]
362
+ INDEX: typing.ClassVar[FFModel.Exceptions.TYPE]
363
+ INTERNAL: typing.ClassVar[FFModel.Exceptions.TYPE]
364
+ NOSTORE: typing.ClassVar[FFModel.Exceptions.TYPE]
365
+ SETUP: typing.ClassVar[FFModel.Exceptions.TYPE]
366
+ UNDEF: typing.ClassVar[FFModel.Exceptions.TYPE]
367
+ __members__: typing.ClassVar[dict[str, FFModel.Exceptions.TYPE]]
368
+ def __eq__(self, other: typing.Any) -> bool:
369
+ ...
370
+ def __getstate__(self) -> int:
371
+ ...
372
+ def __hash__(self) -> int:
373
+ ...
374
+ def __index__(self) -> int:
375
+ ...
376
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
377
+ ...
378
+ def __int__(self) -> int:
379
+ ...
380
+ def __ne__(self, other: typing.Any) -> bool:
381
+ ...
382
+ def __repr__(self) -> str:
383
+ ...
384
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
385
+ ...
386
+ def __str__(self) -> str:
387
+ ...
388
+ @property
389
+ def name(self) -> str:
390
+ ...
391
+ @property
392
+ def value(self) -> int:
393
+ ...
394
+ CSTVAL: typing.ClassVar[FFModel.Exceptions.TYPE]
395
+ DOMAIN: typing.ClassVar[FFModel.Exceptions.TYPE]
396
+ ENV: typing.ClassVar[FFModel.Exceptions.TYPE]
397
+ INDEX: typing.ClassVar[FFModel.Exceptions.TYPE]
398
+ INTERNAL: typing.ClassVar[FFModel.Exceptions.TYPE]
399
+ NOSTORE: typing.ClassVar[FFModel.Exceptions.TYPE]
400
+ SETUP: typing.ClassVar[FFModel.Exceptions.TYPE]
401
+ UNDEF: typing.ClassVar[FFModel.Exceptions.TYPE]
402
+ def ierr(self) -> int:
403
+ """
404
+ Return the error code as an integer (see FFModel.Exceptions.TYPE).
405
+ """
406
+ def what(self) -> str:
407
+ """
408
+ Return a string describing the error.
409
+ """
410
+ class EqnRole:
411
+ """
412
+ Role of an equation.
413
+
414
+ Members:
415
+
416
+ AUTO : resolved on add: BOUNDARY if some domain mask is LB or UB alone, else INTERIOR
417
+
418
+ INTERIOR : volume/interior PDE or algebraic residual
419
+
420
+ INITIAL : initial-condition trace residual
421
+
422
+ BOUNDARY : exterior boundary-condition trace residual
423
+
424
+ INTERFACE : user-supplied transmission residual between physical subdomains
425
+
426
+ LINK : auxiliary first-order link equation generated by order reduction
427
+
428
+ SURFACE : residual posed on a lower-dimensional boundary or interface
429
+
430
+ DIAGNOSTIC : evaluated only: not classified, receives no SAT, never donated
431
+ """
432
+ AUTO: typing.ClassVar[FFModel.EqnRole]
433
+ BOUNDARY: typing.ClassVar[FFModel.EqnRole]
434
+ DIAGNOSTIC: typing.ClassVar[FFModel.EqnRole]
435
+ INITIAL: typing.ClassVar[FFModel.EqnRole]
436
+ INTERFACE: typing.ClassVar[FFModel.EqnRole]
437
+ INTERIOR: typing.ClassVar[FFModel.EqnRole]
438
+ LINK: typing.ClassVar[FFModel.EqnRole]
439
+ SURFACE: typing.ClassVar[FFModel.EqnRole]
440
+ __members__: typing.ClassVar[dict[str, FFModel.EqnRole]]
441
+ def __eq__(self, other: typing.Any) -> bool:
442
+ ...
443
+ def __getstate__(self) -> int:
444
+ ...
445
+ def __hash__(self) -> int:
446
+ ...
447
+ def __index__(self) -> int:
448
+ ...
449
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
450
+ ...
451
+ def __int__(self) -> int:
452
+ ...
453
+ def __ne__(self, other: typing.Any) -> bool:
454
+ ...
455
+ def __repr__(self) -> str:
456
+ ...
457
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
458
+ ...
459
+ def __str__(self) -> str:
460
+ ...
461
+ @property
462
+ def name(self) -> str:
463
+ ...
464
+ @property
465
+ def value(self) -> int:
466
+ ...
467
+ class InputContinuity:
468
+ """
469
+ Continuity of a distributed input across element interfaces.
470
+
471
+ Members:
472
+
473
+ DISCONTINUOUS : default: the input may jump across element interfaces
474
+
475
+ CONTINUOUS_C0 : the input value matches across interfaces (C0)
476
+
477
+ SMOOTH_C1 : value and first derivative match across interfaces (C1)
478
+ """
479
+ CONTINUOUS_C0: typing.ClassVar[FFModel.InputContinuity]
480
+ DISCONTINUOUS: typing.ClassVar[FFModel.InputContinuity]
481
+ SMOOTH_C1: typing.ClassVar[FFModel.InputContinuity]
482
+ __members__: typing.ClassVar[dict[str, FFModel.InputContinuity]]
483
+ def __eq__(self, other: typing.Any) -> bool:
484
+ ...
485
+ def __getstate__(self) -> int:
486
+ ...
487
+ def __hash__(self) -> int:
488
+ ...
489
+ def __index__(self) -> int:
490
+ ...
491
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
492
+ ...
493
+ def __int__(self) -> int:
494
+ ...
495
+ def __ne__(self, other: typing.Any) -> bool:
496
+ ...
497
+ def __repr__(self) -> str:
498
+ ...
499
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
500
+ ...
501
+ def __str__(self) -> str:
502
+ ...
503
+ @property
504
+ def name(self) -> str:
505
+ ...
506
+ @property
507
+ def value(self) -> int:
508
+ ...
509
+ class SetupStatus:
510
+ """
511
+ Outcome of setup().
512
+
513
+ Members:
514
+
515
+ OK : setup succeeded
516
+
517
+ INCONSISTENT_MODEL : the declared model is inconsistent
518
+
519
+ NODE_SETUP_FAILED : collocation node setup failed
520
+
521
+ CLASSIFICATION_FAILED : PDE classification failed
522
+
523
+ HYP_INCOMING_BC : hyperbolic block: incoming boundary condition missing
524
+
525
+ HYP_BC_MISDIRECTED : hyperbolic block: boundary condition on an outgoing characteristic
526
+
527
+ BACKEND_UNAVAILABLE : an option requests a linear-algebra backend this build does not include
528
+
529
+ HYP_CLOSURE_MISSING : hyperbolic block: AUTO.HYP_CLOSURE off and outflow rows missing
530
+
531
+ REDUCED_DOF_INCONSISTENT : post-index-reduction DOF audit: IC/BC count inconsistent with the reduced degrees of freedom
532
+
533
+ EVOLUTION_DOMAIN_UNSUITABLE : evolution-domain validation: unsuitable evolution domain, or initial condition not settable
534
+
535
+ DETERMINACY_UNDETERMINED : determinacy audit: the Jacobian has a null space with state content
536
+
537
+ MODEL_COPY_FAILED : could not copy the user model into the working DAG
538
+
539
+ CAPTURE_NESTED_REFUSED : nested evolution-direction reduction refused (captured value feeds an outer in-solve operand)
540
+
541
+ INTERFACE_PLAN_INVALID : the interface plan is invalid
542
+
543
+ AUDIT_NONSQUARE : the discretised system is not square
544
+
545
+ DERIV_CACHE_FAILED : derivative cache construction failed
546
+
547
+ LINEAR_CACHE_FAILED : linear-evaluation cache construction failed
548
+ """
549
+ AUDIT_NONSQUARE: typing.ClassVar[FFModel.SetupStatus]
550
+ BACKEND_UNAVAILABLE: typing.ClassVar[FFModel.SetupStatus]
551
+ CAPTURE_NESTED_REFUSED: typing.ClassVar[FFModel.SetupStatus]
552
+ CLASSIFICATION_FAILED: typing.ClassVar[FFModel.SetupStatus]
553
+ DERIV_CACHE_FAILED: typing.ClassVar[FFModel.SetupStatus]
554
+ DETERMINACY_UNDETERMINED: typing.ClassVar[FFModel.SetupStatus]
555
+ EVOLUTION_DOMAIN_UNSUITABLE: typing.ClassVar[FFModel.SetupStatus]
556
+ HYP_BC_MISDIRECTED: typing.ClassVar[FFModel.SetupStatus]
557
+ HYP_CLOSURE_MISSING: typing.ClassVar[FFModel.SetupStatus]
558
+ HYP_INCOMING_BC: typing.ClassVar[FFModel.SetupStatus]
559
+ INCONSISTENT_MODEL: typing.ClassVar[FFModel.SetupStatus]
560
+ INTERFACE_PLAN_INVALID: typing.ClassVar[FFModel.SetupStatus]
561
+ LINEAR_CACHE_FAILED: typing.ClassVar[FFModel.SetupStatus]
562
+ MODEL_COPY_FAILED: typing.ClassVar[FFModel.SetupStatus]
563
+ NODE_SETUP_FAILED: typing.ClassVar[FFModel.SetupStatus]
564
+ OK: typing.ClassVar[FFModel.SetupStatus]
565
+ REDUCED_DOF_INCONSISTENT: typing.ClassVar[FFModel.SetupStatus]
566
+ __members__: typing.ClassVar[dict[str, FFModel.SetupStatus]]
567
+ def __eq__(self, other: typing.Any) -> bool:
568
+ ...
569
+ def __getstate__(self) -> int:
570
+ ...
571
+ def __hash__(self) -> int:
572
+ ...
573
+ def __index__(self) -> int:
574
+ ...
575
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
576
+ ...
577
+ def __int__(self) -> int:
578
+ ...
579
+ def __ne__(self, other: typing.Any) -> bool:
580
+ ...
581
+ def __repr__(self) -> str:
582
+ ...
583
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
584
+ ...
585
+ def __str__(self) -> str:
586
+ ...
587
+ @property
588
+ def name(self) -> str:
589
+ ...
590
+ @property
591
+ def value(self) -> int:
592
+ ...
593
+ class EqnOptions:
594
+ """
595
+ Options of one equation: its role and classification block.
596
+ """
597
+ def __init__(self, role: FFModel.EqnRole = ..., block_id: typing.SupportsInt | typing.SupportsIndex = 0) -> None:
598
+ """
599
+ Options with role-derived defaults (INITIAL, BOUNDARY, INTERFACE and DIAGNOSTIC rows do not enter classification).
600
+ """
601
+ @property
602
+ def block_id(self) -> int:
603
+ """
604
+ classification block
605
+ """
606
+ @block_id.setter
607
+ def block_id(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
608
+ ...
609
+ @property
610
+ def participate_in_classification(self) -> bool:
611
+ """
612
+ enters block principal-symbol classification
613
+ """
614
+ @participate_in_classification.setter
615
+ def participate_in_classification(self, arg0: bool) -> None:
616
+ ...
617
+ @property
618
+ def role(self) -> FFModel.EqnRole:
619
+ """
620
+ equation role (AUTO resolved on add)
621
+ """
622
+ @role.setter
623
+ def role(self, arg0: FFModel.EqnRole) -> None:
624
+ ...
625
+ @property
626
+ def role_auto(self) -> bool:
627
+ """
628
+ True if the role was resolved from AUTO (re-resolved once the evolution domain is known).
629
+ """
630
+ class Options:
631
+ """
632
+ Model options: display, order reduction, classification, tolerances.
633
+ """
634
+ class ReductionType:
635
+ """
636
+ Order reduction at setup -- the values of REDUCE.ORDER: whether derivatives above first order are replaced by auxiliary states, and whether rows processed before an auxiliary existed are rewritten to use it.
637
+
638
+ Members:
639
+
640
+ RED_NONE : Do not perform order reduction during setup
641
+
642
+ RED_MAIN : Reduce high-order derivatives, leaving earlier rows their explicit derivative
643
+
644
+ RED_FULL : Reduce high-order derivatives and rewrite earlier rows to use the auxiliaries
645
+ """
646
+ RED_FULL: typing.ClassVar[FFModel.Options.ReductionType]
647
+ RED_MAIN: typing.ClassVar[FFModel.Options.ReductionType]
648
+ RED_NONE: typing.ClassVar[FFModel.Options.ReductionType]
649
+ __members__: typing.ClassVar[dict[str, FFModel.Options.ReductionType]]
650
+ def __eq__(self, other: typing.Any) -> bool:
651
+ ...
652
+ def __getstate__(self) -> int:
653
+ ...
654
+ def __hash__(self) -> int:
655
+ ...
656
+ def __index__(self) -> int:
657
+ ...
658
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
659
+ ...
660
+ def __int__(self) -> int:
661
+ ...
662
+ def __ne__(self, other: typing.Any) -> bool:
663
+ ...
664
+ def __repr__(self) -> str:
665
+ ...
666
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
667
+ ...
668
+ def __str__(self) -> str:
669
+ ...
670
+ @property
671
+ def name(self) -> str:
672
+ ...
673
+ @property
674
+ def value(self) -> int:
675
+ ...
676
+ class RobustnessMode:
677
+ """
678
+ How setup() tests the classification's sensitivity to the reference point -- the values of CLASSIFY.ROBUST: by sampling the reference and comparing the verdicts, or not at all.
679
+
680
+ Members:
681
+
682
+ ROBUST_OFF : Do not sample: classify at the reference point only (default)
683
+
684
+ ROBUST_REPORT : Sample and report disagreement; the verdict still comes from the base point
685
+
686
+ ROBUST_STRICT : Sample and treat disagreement as the classification being reference-sensitive
687
+ """
688
+ ROBUST_OFF: typing.ClassVar[FFModel.Options.RobustnessMode]
689
+ ROBUST_REPORT: typing.ClassVar[FFModel.Options.RobustnessMode]
690
+ ROBUST_STRICT: typing.ClassVar[FFModel.Options.RobustnessMode]
691
+ __members__: typing.ClassVar[dict[str, FFModel.Options.RobustnessMode]]
692
+ def __eq__(self, other: typing.Any) -> bool:
693
+ ...
694
+ def __getstate__(self) -> int:
695
+ ...
696
+ def __hash__(self) -> int:
697
+ ...
698
+ def __index__(self) -> int:
699
+ ...
700
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
701
+ ...
702
+ def __int__(self) -> int:
703
+ ...
704
+ def __ne__(self, other: typing.Any) -> bool:
705
+ ...
706
+ def __repr__(self) -> str:
707
+ ...
708
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
709
+ ...
710
+ def __str__(self) -> str:
711
+ ...
712
+ @property
713
+ def name(self) -> str:
714
+ ...
715
+ @property
716
+ def value(self) -> int:
717
+ ...
718
+ class ClassifyType:
719
+ """
720
+ How setup() classifies the PDE blocks -- the values of CLASSIFY.MODE.
721
+
722
+ Members:
723
+
724
+ CLASS_NONE : Do not perform PDE classification during setup
725
+
726
+ CLASS_AUTO : Attempt PDE classification during setup and proceed even if it fails
727
+
728
+ CLASS_STRICT : Attempt PDE classification during setup and interrupt when it fails
729
+ """
730
+ CLASS_AUTO: typing.ClassVar[FFModel.Options.ClassifyType]
731
+ CLASS_NONE: typing.ClassVar[FFModel.Options.ClassifyType]
732
+ CLASS_STRICT: typing.ClassVar[FFModel.Options.ClassifyType]
733
+ __members__: typing.ClassVar[dict[str, FFModel.Options.ClassifyType]]
734
+ def __eq__(self, other: typing.Any) -> bool:
735
+ ...
736
+ def __getstate__(self) -> int:
737
+ ...
738
+ def __hash__(self) -> int:
739
+ ...
740
+ def __index__(self) -> int:
741
+ ...
742
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
743
+ ...
744
+ def __int__(self) -> int:
745
+ ...
746
+ def __ne__(self, other: typing.Any) -> bool:
747
+ ...
748
+ def __repr__(self) -> str:
749
+ ...
750
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
751
+ ...
752
+ def __str__(self) -> str:
753
+ ...
754
+ @property
755
+ def name(self) -> str:
756
+ ...
757
+ @property
758
+ def value(self) -> int:
759
+ ...
760
+ class t_Reduce:
761
+ """
762
+ Order reduction of high-order derivatives.
763
+ """
764
+ def __init__(self) -> None:
765
+ ...
766
+ @property
767
+ def HIDDEN_IC(self) -> bool:
768
+ """
769
+ Materialise the HIDDEN constraints of a high-index reduction as INITIAL rows at the evolution boundary, so the model declares only the FREE initial data (default true since 2026-10-04; false was the former convention of one declared initial condition per differential state, made consistent by hand). A reduction that differentiates a constraint k times implies k lower levels which hold at the initial point but are not rows: with this off, the model must declare one initial condition per evolution-differential state and make the redundant ones consistent by hand (initial_data() says how many they are); with it on, those levels ARE rows, the free data alone makes the system square, and a full declaration is reported as a surplus by the DOF audit. Which data is free is a modelling choice -- for the index-3 pendulum {x,u} works, {x,y} does not.
770
+ """
771
+ @HIDDEN_IC.setter
772
+ def HIDDEN_IC(self, arg0: bool) -> None:
773
+ ...
774
+ @property
775
+ def NONLINEAR_PARTIALS(self) -> bool:
776
+ """
777
+ Materialise first-order state-partials that appear NON-AFFINELY in a residual. reduce_order already peels high-order partials, and already materialises the partials carried INSIDE an OpI/OpEval operand (materialize_operand_partials), because a nonlocal reduction LINK cannot expose an inner OpP. It does NOT touch a first-order OpP(state,dir) sitting in an ordinary residual, which is right when the residual is AFFINE in it -- the principal-symbol proxy and the collocation Jacobian both handle a variable-coefficient derivative. It is NOT right when the derivative is wrapped nonlinearly: a DIVISION by a derivative (the ALE/moving-mesh 1/x_xi, u_xi/x_xi, u_xi/x_xi^2) or a transcendental of one (an arclength monitor sqrt(1+u_xi^2)). Those force a driver to hand-roll the derivative as a state with its own defining equation -- and hand-rolled auxiliaries are invisible to the classifier AS auxiliaries, which is how the multiply-defined flux states and the rectangular symbols in the moving-mesh drivers arose. When true, such a partial is minted as a derivative auxiliary Dp with a defining LINK OpP(state,dir) - Dp = 0 and substituted everywhere -- exactly the mint/LINK/reuse protocol the OpI/OpEval operand path already uses. The residual then contains only the STATE Dp inside the nonlinearity, and the raw OpP survives solely in a LINK, which is an ordinary differential equation the proxy pass resolves. The trigger is per-partial and minimal: a partial is materialised iff the residual is not AFFINE in THAT partial alone (mc::FFDep type != L). So `D*u_z`, `u*u_z`, `exp(-u)*u_z` are untouched, and in `(c-x_t)*u_xi/x_xi` ONLY x_xi is materialised -- x_t and u_xi remain ordinary variable-coefficient partials. Every residual that is affine in each of its first-order partials -- the entire existing corpus -- is therefore bit-identical. Default false: opt in, sweep, then consider promoting. Requires REDUCE.ORDER != RED_NONE.
778
+ """
779
+ @NONLINEAR_PARTIALS.setter
780
+ def NONLINEAR_PARTIALS(self, arg0: bool) -> None:
781
+ ...
782
+ @property
783
+ def ORDER(self) -> FFModel.Options.ReductionType:
784
+ """
785
+ Order-reduction mode applied automatically by setup. RED_NONE leaves user equations unchanged. RED_MAIN performs first-order reduction without substituting matching first-order derivative nodes in pre-existing equations. RED_FULL also reuses the new auxiliary states in matching pre-existing equations; this is the default.
786
+ """
787
+ @ORDER.setter
788
+ def ORDER(self, arg0: FFModel.Options.ReductionType) -> None:
789
+ ...
790
+ class t_Classify:
791
+ """
792
+ Classification of each block's principal symbol.
793
+ """
794
+ def __init__(self) -> None:
795
+ ...
796
+ @property
797
+ def IMAG_TOL(self) -> float:
798
+ """
799
+ Imaginary-part/rank tolerance used by automatic classification.
800
+ """
801
+ @IMAG_TOL.setter
802
+ def IMAG_TOL(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
803
+ ...
804
+ @property
805
+ def MODE(self) -> FFModel.Options.ClassifyType:
806
+ """
807
+ PDE classification during setup(): CLASS_AUTO (default), CLASS_NONE or CLASS_STRICT
808
+ """
809
+ @MODE.setter
810
+ def MODE(self, arg0: FFModel.Options.ClassifyType) -> None:
811
+ ...
812
+ @property
813
+ def NSAMPLE(self) -> int:
814
+ """
815
+ Number of angular samples for no-evolution-domain classification.
816
+ """
817
+ @NSAMPLE.setter
818
+ def NSAMPLE(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
819
+ ...
820
+ @property
821
+ def ROBUST(self) -> FFModel.Options.RobustnessMode:
822
+ """
823
+ Reference-robustness sampling (see RobustnessMode). (0 = off, 1 = report, 2 = strict).
824
+ """
825
+ @ROBUST.setter
826
+ def ROBUST(self, arg0: FFModel.Options.RobustnessMode) -> None:
827
+ ...
828
+ class t_Auto:
829
+ """
830
+ Automatic model transformations applied at setup(): boundary closures and differential elimination.
831
+ """
832
+ def __init__(self) -> None:
833
+ ...
834
+ @property
835
+ def DIFF_ELIM(self) -> bool:
836
+ """
837
+ auto differential-elimination of algebraically-determined derivatives (substitute + relocate consumer onto source face); OFF by default
838
+ """
839
+ @DIFF_ELIM.setter
840
+ def DIFF_ELIM(self, arg0: bool) -> None:
841
+ ...
842
+ @property
843
+ def HYP_CLOSURE(self) -> bool:
844
+ """
845
+ auto closure of the OUTFLOW faces of hyperbolic blocks: appends the missing outgoing-characteristic rows (default on). Off: the model must close every outflow face itself (e.g. its PDE extended to the face) -- setup REFUSES (HYP_CLOSURE_MISSING) when rows are missing, as an under-determined system would be solved silently wrong
846
+ """
847
+ @HYP_CLOSURE.setter
848
+ def HYP_CLOSURE(self, arg0: bool) -> None:
849
+ ...
850
+ CLASS_AUTO: typing.ClassVar[FFModel.Options.ClassifyType]
851
+ CLASS_NONE: typing.ClassVar[FFModel.Options.ClassifyType]
852
+ CLASS_STRICT: typing.ClassVar[FFModel.Options.ClassifyType]
853
+ RED_FULL: typing.ClassVar[FFModel.Options.ReductionType]
854
+ RED_MAIN: typing.ClassVar[FFModel.Options.ReductionType]
855
+ RED_NONE: typing.ClassVar[FFModel.Options.ReductionType]
856
+ ROBUST_OFF: typing.ClassVar[FFModel.Options.RobustnessMode]
857
+ ROBUST_REPORT: typing.ClassVar[FFModel.Options.RobustnessMode]
858
+ ROBUST_STRICT: typing.ClassVar[FFModel.Options.RobustnessMode]
859
+ @typing.overload
860
+ def __init__(self) -> None:
861
+ ...
862
+ @typing.overload
863
+ def __init__(self, arg0: FFModel.Options) -> None:
864
+ ...
865
+ @property
866
+ def AUTO(self) -> FFModel.Options.t_Auto:
867
+ """
868
+ Automatic model transformations applied at setup(): boundary closures and differential elimination.
869
+ """
870
+ @AUTO.setter
871
+ def AUTO(self, arg0: FFModel.Options.t_Auto) -> None:
872
+ ...
873
+ @property
874
+ def CLASSIFY(self) -> FFModel.Options.t_Classify:
875
+ """
876
+ Classification of each block's principal symbol.
877
+ """
878
+ @CLASSIFY.setter
879
+ def CLASSIFY(self, arg0: FFModel.Options.t_Classify) -> None:
880
+ ...
881
+ @property
882
+ def DISPLAY_LEVEL(self) -> int:
883
+ """
884
+ Console verbosity for setup()/eval() (default: 0). Tiered: 0 = silent: only errors, validation failures, and warnings print. 1 = key structural decisions: closures, interface-plan DROP / KEEP- EXPLICIT, continuity redundancy / value-slaved drops, order and tau reduction summaries. 2 = detailed diagnostics (includes everything at level 1): phase and [iplan] timings, trace conditioning (rcond / SVD / sparsity), per-predicate timing accumulators, verbose detection and edge breakdowns. Errors and warnings are NEVER gated by this level.
885
+ """
886
+ @DISPLAY_LEVEL.setter
887
+ def DISPLAY_LEVEL(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
888
+ ...
889
+ @property
890
+ def MAXTHREAD(self) -> int:
891
+ """
892
+ cap on the threads the numerical backends may use inside setup() and solve(). SPQR, SuperLU, UMFPACK, KLU and every dense LAPACK call take their parallelism from the SAME BLAS/OpenMP layer, so ONE cap covers them all -- SPQR has no thread pool of its own (its TBB path was removed upstream, and cc.SPQR_nthreads is now inert). 1 (default since 2026-10-09; was 0): one thread. 0 imposes NO cap: the runtime is left exactly as the environment set it -- usually ALL cores, OpenBLAS's and OpenMP's own default. n>0 caps to n for the duration of the call and RESTORES the previous setting on every exit. NOTE the deliberate difference from FFGraph::Options:: MAXTHREAD, which reads 0 as "hardware_concurrency": here 0 means "do not touch", so an outer OMP_NUM_THREADS or a cluster allocation is respected rather than overridden. MEASURED (PDE5, 9 audit windows): cap=1 is 18% FASTER than the uncapped run -- 152.4 s against 186.0 s of rank time. MEASURED (PDE38, 16 cores): uncapped, the SPQR build ran 29.6 s on 431 s of CPU; capped at 1, 16.4 s on 15 s (and without SPQR 19.7 s -> 18.7 s): CRONOS's frontal and dense blocks are too small for threads to pay. Results identical. Environment: CRONOS_MAXTHREAD.
893
+ """
894
+ @MAXTHREAD.setter
895
+ def MAXTHREAD(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
896
+ ...
897
+ @property
898
+ def REDUCE(self) -> FFModel.Options.t_Reduce:
899
+ """
900
+ Order reduction of high-order derivatives.
901
+ """
902
+ @REDUCE.setter
903
+ def REDUCE(self, arg0: FFModel.Options.t_Reduce) -> None:
904
+ ...
905
+ @property
906
+ def TTOL(self) -> float:
907
+ """
908
+ Two time points closer than this are the SAME point (1e-9). A consumer that stages a model -- an integrator, a marching solve, anything that stops at boundaries -- must decide whether a function's time point coincides with an element boundary, and an exact comparison is the wrong test for a value that was typed or computed. Absolute, in the units of the evolution domain.
909
+ """
910
+ @TTOL.setter
911
+ def TTOL(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
912
+ ...
913
+ class FctKind:
914
+ """
915
+ Kind of an output.
916
+
917
+ Members:
918
+
919
+ POINT : a scalar output, or a value at a point of its domains
920
+
921
+ DISTRIBUTED : an output distributed over a region of its domains
922
+ """
923
+ DISTRIBUTED: typing.ClassVar[FFModel.FctKind]
924
+ POINT: typing.ClassVar[FFModel.FctKind]
925
+ __members__: typing.ClassVar[dict[str, FFModel.FctKind]]
926
+ def __eq__(self, other: typing.Any) -> bool:
927
+ ...
928
+ def __getstate__(self) -> int:
929
+ ...
930
+ def __hash__(self) -> int:
931
+ ...
932
+ def __index__(self) -> int:
933
+ ...
934
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
935
+ ...
936
+ def __int__(self) -> int:
937
+ ...
938
+ def __ne__(self, other: typing.Any) -> bool:
939
+ ...
940
+ def __repr__(self) -> str:
941
+ ...
942
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
943
+ ...
944
+ def __str__(self) -> str:
945
+ ...
946
+ @property
947
+ def name(self) -> str:
948
+ ...
949
+ @property
950
+ def value(self) -> int:
951
+ ...
952
+ class t_Eqn:
953
+ """
954
+ A declared equation: its residual, its region (mask per domain), and its
955
+ options.
956
+ """
957
+ def __repr__(self) -> str:
958
+ ...
959
+ def __str__(self) -> str:
960
+ """
961
+ The equation written out: ``0 = <expression> on <region>``.
962
+ """
963
+ @property
964
+ def dom(self) -> dict[pymcpp.FFVar, int]:
965
+ """
966
+ Domain mask per domain variable, ``{domain: mask}``.
967
+ """
968
+ @property
969
+ def opt(self) -> FFModel.EqnOptions:
970
+ """
971
+ Normalised equation options (a copy).
972
+ """
973
+ @property
974
+ def var(self) -> pymcpp.FFVar:
975
+ """
976
+ Residual expression (equation: var = 0).
977
+ """
978
+ class t_Fct:
979
+ """
980
+ A declared output: its expression, kind, fixed coordinates and sides, and the
981
+ masks of its distributed dimensions.
982
+ """
983
+ def __repr__(self) -> str:
984
+ ...
985
+ def __str__(self) -> str:
986
+ """
987
+ The output written out, with its point or its region.
988
+ """
989
+ @property
990
+ def grid(self) -> dict[pymcpp.FFVar, int]:
991
+ """
992
+ Masks of the distributed dimensions, ``{domain: mask}``.
993
+ """
994
+ @property
995
+ def kind(self) -> FFModel.FctKind:
996
+ """
997
+ Point or distributed output.
998
+ """
999
+ @property
1000
+ def nrow(self) -> int:
1001
+ """
1002
+ Number of output rows (set by the solver).
1003
+ """
1004
+ @property
1005
+ def point(self) -> dict[pymcpp.FFVar, float]:
1006
+ """
1007
+ Fixed coordinates, ``{domain: coordinate}``.
1008
+ """
1009
+ @property
1010
+ def row0(self) -> int:
1011
+ """
1012
+ First row in the output array (set by the solver).
1013
+ """
1014
+ @property
1015
+ def side(self) -> dict[pymcpp.FFVar, int]:
1016
+ """
1017
+ Sides given as PLUS, ``{domain: 1}`` (absent: MINUS).
1018
+ """
1019
+ @property
1020
+ def var(self) -> pymcpp.FFVar:
1021
+ """
1022
+ Output expression.
1023
+ """
1024
+ CONTINUOUS_C0: typing.ClassVar[FFModel.InputContinuity]
1025
+ DISCONTINUOUS: typing.ClassVar[FFModel.InputContinuity]
1026
+ DISTRIBUTED: typing.ClassVar[FFModel.FctKind]
1027
+ POINT: typing.ClassVar[FFModel.FctKind]
1028
+ SMOOTH_C1: typing.ClassVar[FFModel.InputContinuity]
1029
+ @staticmethod
1030
+ def revision() -> str:
1031
+ """
1032
+ The revision of the model layer (ffmodel.hpp), e.g. for a bug report. The model report
1033
+ does not print it.
1034
+ """
1035
+ def __init__(self, dag: pymcpp.FFGraph) -> None:
1036
+ """
1037
+ Empty model declared on the DAG ``dag`` (kept alive by the model).
1038
+ """
1039
+ def __str__(self) -> str:
1040
+ """
1041
+ Report of the model.
1042
+ """
1043
+ @typing.overload
1044
+ def add_domain(self, var: pymcpp.FFVar, dom: FFDom, ref: typing.SupportsFloat | typing.SupportsIndex | None = None) -> None:
1045
+ """
1046
+ Declare the domain of an independent variable.
1047
+
1048
+ Parameters
1049
+ ----------
1050
+ var : FFVar
1051
+ The independent variable.
1052
+ dom : FFDom
1053
+ Its bounds, finite elements and collocation nodes.
1054
+ ref : float, optional
1055
+ Reference coordinate for the model analyses.
1056
+ """
1057
+ @typing.overload
1058
+ def add_domain(self, vars: collections.abc.Sequence[pymcpp.FFVar], dom: FFDom, ref: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> None:
1059
+ """
1060
+ Declare several independent variables on the same domain.
1061
+ """
1062
+ @typing.overload
1063
+ def add_equation(self, eqn: pymcpp.FFVar, doms: collections.abc.Sequence[pymcpp.FFVar] = [], masks: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = [], options: FFModel.EqnOptions = ...) -> None:
1064
+ """
1065
+ Declare the equation ``eqn = 0`` on a region of its domains.
1066
+
1067
+ Parameters
1068
+ ----------
1069
+ eqn : FFVar
1070
+ The residual.
1071
+ doms : list of FFVar
1072
+ Its domains (empty for a scalar equation).
1073
+ masks : list of int
1074
+ The region per domain: ``FFDom.ALL``, ``LB``, ``UB``, or combinations such
1075
+ as ``FFDom.ALL - FFDom.LB``.
1076
+ options : FFModel.EqnOptions, optional
1077
+ Role and classification block (default: role resolved from the masks).
1078
+ """
1079
+ @typing.overload
1080
+ def add_equation(self, eqns: collections.abc.Sequence[pymcpp.FFVar], doms: collections.abc.Sequence[pymcpp.FFVar] = [], masks: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = [], options: FFModel.EqnOptions = ...) -> None:
1081
+ """
1082
+ Declare several equations on the same region.
1083
+ """
1084
+ @typing.overload
1085
+ def add_input(self, var: pymcpp.FFVar, doms: collections.abc.Sequence[pymcpp.FFVar] = [], *, ref: typing.SupportsFloat | typing.SupportsIndex | collections.abc.Callable[[collections.abc.Mapping[pymcpp.FFVar, typing.SupportsFloat | typing.SupportsIndex]], float] | None = None, type: FFDom.TYPE | None = None, n_node: typing.SupportsInt | typing.SupportsIndex = 0, continuity: collections.abc.Sequence[FFModel.InputContinuity] | None = None, is_decision: bool = False) -> None:
1086
+ """
1087
+ Declare an input: a parameter (no domains) or a distributed input over
1088
+ ``doms``.
1089
+
1090
+ Parameters
1091
+ ----------
1092
+ var : FFVar
1093
+ The input.
1094
+ doms : list of FFVar, optional
1095
+ Its independent variables (empty: a scalar parameter).
1096
+ ref : float or callable, optional
1097
+ Reference value, or a function ``ref({dom: coordinate}) -> float``.
1098
+ type : FFDom.TYPE, optional
1099
+ The input's own collocation node family (with ``n_node``); default: that
1100
+ of its domains.
1101
+ n_node : int, optional
1102
+ Number of nodes per element for ``type``.
1103
+ continuity : list of FFModel.InputContinuity, optional
1104
+ Continuity per domain across element interfaces (with a float ``ref``
1105
+ only).
1106
+ is_decision : bool, optional
1107
+ Register the input as a control (decision) at setup.
1108
+ """
1109
+ @typing.overload
1110
+ def add_input(self, vars: collections.abc.Sequence[pymcpp.FFVar], doms: collections.abc.Sequence[pymcpp.FFVar] = [], ref: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> None:
1111
+ """
1112
+ Declare several inputs over the same domains.
1113
+ """
1114
+ def add_output(self, fct: pymcpp.FFVar, doms: collections.abc.Sequence[pymcpp.FFVar] = [], *, point: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | None = None, side: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] | None = None, masks: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] | None = None, at: collections.abc.Mapping[pymcpp.FFVar, typing.SupportsFloat | typing.SupportsIndex] | None = None) -> int:
1115
+ """
1116
+ Declare an output.
1117
+
1118
+ - ``add_output(f)``: a scalar output (values and integrals built with
1119
+ ``FFEval`` / ``FFIntegral``);
1120
+ - ``add_output(f, doms, point=[...], side=[...])``: ``f`` at a point of
1121
+ ``doms``, from the given sides;
1122
+ - ``add_output(f, doms, masks=[...])``: ``f`` distributed over a region of
1123
+ ``doms``;
1124
+ - ``add_output(f, doms, masks=[...], at={z: z0})``: distributed over ``doms``
1125
+ at fixed coordinates of others.
1126
+
1127
+ Parameters
1128
+ ----------
1129
+ fct : FFVar
1130
+ The output expression.
1131
+ doms : list of FFVar, optional
1132
+ Domains of the point or of the distribution.
1133
+ point : list of float, optional
1134
+ Coordinates, one per domain (point output).
1135
+ side : list of int, optional
1136
+ Side per domain for a point output: ``FFDom.MINUS`` (default) or
1137
+ ``FFDom.PLUS``.
1138
+ masks : list of int, optional
1139
+ Region per domain (distributed output).
1140
+ at : dict of FFVar to float, optional
1141
+ Fixed coordinates of further domains (distributed output).
1142
+
1143
+ Returns
1144
+ -------
1145
+ int
1146
+ The INDEX of the new output: outputs are numbered in declaration order,
1147
+ from 0, and the index is the output's position in ``blk_fct()`` of a
1148
+ solver (``OCFESLV``, ``ODESLV``) once the model is set up.
1149
+ """
1150
+ @typing.overload
1151
+ def add_state(self, var: pymcpp.FFVar, doms: collections.abc.Sequence[pymcpp.FFVar], ref: typing.SupportsFloat | typing.SupportsIndex | None = None) -> None:
1152
+ """
1153
+ Declare a state over the domains ``doms`` (empty for a scalar state).
1154
+
1155
+ Parameters
1156
+ ----------
1157
+ var : FFVar
1158
+ The state.
1159
+ doms : list of FFVar
1160
+ Its independent variables.
1161
+ ref : float, optional
1162
+ Reference value (initial guess and analyses).
1163
+ """
1164
+ @typing.overload
1165
+ def add_state(self, var: pymcpp.FFVar, doms: collections.abc.Sequence[pymcpp.FFVar], ref: collections.abc.Callable[[collections.abc.Mapping[pymcpp.FFVar, typing.SupportsFloat | typing.SupportsIndex]], float]) -> None:
1166
+ """
1167
+ Declare a state with a reference function ``ref({dom: coordinate}) -> float``.
1168
+ """
1169
+ @typing.overload
1170
+ def add_state(self, vars: collections.abc.Sequence[pymcpp.FFVar], doms: collections.abc.Sequence[pymcpp.FFVar], ref: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> None:
1171
+ """
1172
+ Declare several states over the same domains.
1173
+ """
1174
+ @typing.overload
1175
+ def add_transition(self, left: collections.abc.Sequence[pymcpp.FFVar], right: collections.abc.Sequence[pymcpp.FFVar], dom: pymcpp.FFVar, tau: typing.SupportsFloat | typing.SupportsIndex) -> None:
1176
+ """
1177
+ Declare a transition at ``dom = tau``: the equations ``left(tau^-) =
1178
+ right(tau^+)``, which determine the post-jump values of the states they
1179
+ involve. States not mentioned are continuous.
1180
+
1181
+ Parameters
1182
+ ----------
1183
+ left, right : list of FFVar
1184
+ Expressions evaluated before and after the jump.
1185
+ dom : FFVar
1186
+ The evolution domain.
1187
+ tau : float
1188
+ Location of the jump (interior to the domain).
1189
+ """
1190
+ @typing.overload
1191
+ def add_transition(self, left: pymcpp.FFVar, right: pymcpp.FFVar, dom: pymcpp.FFVar, tau: typing.SupportsFloat | typing.SupportsIndex) -> None:
1192
+ """
1193
+ Scalar form of ``add_transition``.
1194
+ """
1195
+ @typing.overload
1196
+ def add_transition(self, left: collections.abc.Sequence[pymcpp.FFVar], right: collections.abc.Sequence[pymcpp.FFVar]) -> None:
1197
+ """
1198
+ Transition given through one-sided evaluations: ``left`` evaluated at tau^- (``FFDom.MINUS``), ``right`` at tau^+ (``FFDom.PLUS``).
1199
+ """
1200
+ @typing.overload
1201
+ def add_transition(self, left: pymcpp.FFVar, right: pymcpp.FFVar) -> None:
1202
+ """
1203
+ Scalar form of the one-sided ``add_transition``.
1204
+ """
1205
+ def clear_controls(self) -> None:
1206
+ """
1207
+ Clear the control registry.
1208
+ """
1209
+ def control_dofs(self, var: pymcpp.FFVar) -> list[FFModel.DofIndex]:
1210
+ """
1211
+ The DOF indices of control ``var``, in the order of its values.
1212
+ """
1213
+ def fix_input(self, var: pymcpp.FFVar, values: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None:
1214
+ """
1215
+ Hold a declared input at known values: substituted as constants, never a parameter or a control.
1216
+ """
1217
+ def is_setup(self) -> bool:
1218
+ """
1219
+ True once ``setup()`` has succeeded.
1220
+ """
1221
+ def n_control_dof(self) -> int:
1222
+ """
1223
+ Total number of control DOFs.
1224
+ """
1225
+ def register_control(self, var: pymcpp.FFVar) -> None:
1226
+ """
1227
+ Register a declared input as a control: its DOFs become the sensitivity directions, in registration order.
1228
+ """
1229
+ def report(self) -> None:
1230
+ """
1231
+ Print the model report (the same text as ``str(model)``).
1232
+ """
1233
+ def set_constant(self, vars: collections.abc.Sequence[pymcpp.FFVar], values: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> None:
1234
+ """
1235
+ Declare constants: parameters whose values are given at solve time rather than
1236
+ differentiated.
1237
+
1238
+ Parameters
1239
+ ----------
1240
+ vars : list of FFVar
1241
+ The constants.
1242
+ values : list of float, optional
1243
+ Their values, one per constant.
1244
+ """
1245
+ def set_evolution_domain(self, dom: pymcpp.FFVar) -> None:
1246
+ """
1247
+ Declare which domain variable is the evolution direction (time); it must have been added with ``add_domain``.
1248
+ """
1249
+ def setup(self) -> bool:
1250
+ """
1251
+ Validate and analyse the model; returns False on failure (see
1252
+ ``setup_status``).
1253
+
1254
+ The setup report (``options.DISPLAY_LEVEL`` >= 1) and any diagnostics, written
1255
+ by C++ to std::cout / std::cerr, are redirected to Python's ``sys.stdout`` /
1256
+ ``sys.stderr`` for the duration of the call, so they appear in notebooks.
1257
+ """
1258
+ @typing.overload
1259
+ def update_ref(self, var: pymcpp.FFVar, ref: typing.SupportsFloat | typing.SupportsIndex) -> None:
1260
+ """
1261
+ Set the reference value of a state or input.
1262
+ """
1263
+ @typing.overload
1264
+ def update_ref(self, var: pymcpp.FFVar, ref: collections.abc.Callable[[collections.abc.Mapping[pymcpp.FFVar, typing.SupportsFloat | typing.SupportsIndex]], float]) -> None:
1265
+ """
1266
+ Set the reference function ``ref({dom: coordinate}) -> float`` of a state or input.
1267
+ """
1268
+ @property
1269
+ def options(self) -> FFModel.Options:
1270
+ """
1271
+ Model options (the solvers extend them).
1272
+ """
1273
+ @options.setter
1274
+ def options(self, arg0: FFModel.Options) -> None:
1275
+ ...
1276
+ @property
1277
+ def setup_status(self) -> FFModel.SetupStatus:
1278
+ """
1279
+ Outcome of the last ``setup()``.
1280
+ """
1281
+ @property
1282
+ def var_constant(self) -> list[pymcpp.FFVar]:
1283
+ """
1284
+ Declared constants.
1285
+ """
1286
+ @property
1287
+ def var_declared_input(self) -> dict[pymcpp.FFVar, set[pymcpp.FFVar]]:
1288
+ """
1289
+ Inputs declared by the modeller.
1290
+ """
1291
+ @property
1292
+ def var_domain(self) -> dict[pymcpp.FFVar, FFDom]:
1293
+ """
1294
+ Declared domain variables.
1295
+ """
1296
+ @property
1297
+ def var_equation(self) -> list[FFModel.t_Eqn]:
1298
+ """
1299
+ Declared equations, as ``FFModel.t_Eqn`` records.
1300
+ """
1301
+ @property
1302
+ def var_input(self) -> dict[pymcpp.FFVar, set[pymcpp.FFVar]]:
1303
+ """
1304
+ Inputs of the model (declared ones and those created by setup).
1305
+ """
1306
+ @property
1307
+ def var_output(self) -> list[FFModel.t_Fct]:
1308
+ """
1309
+ Declared outputs, as ``FFModel.t_Fct`` records.
1310
+ """
1311
+ @property
1312
+ def var_state(self) -> dict[pymcpp.FFVar, set[pymcpp.FFVar]]:
1313
+ """
1314
+ Declared states.
1315
+ """
1316
+ class ODESLV(FFModel):
1317
+ """
1318
+ Solver of an FFModel by CVODES (SUNDIALS): integration of the model along its
1319
+ evolution direction, with forward (``solve_fsens``) and adjoint
1320
+ (``solve_asens``) sensitivity analysis of its outputs.
1321
+
1322
+ The model is declared through the FFModel methods (domains, states, inputs,
1323
+ equations, outputs, transitions); ``setup()`` analyses it and builds the
1324
+ integrator. Inputs are either passed positionally (the parameter vector of
1325
+ ``var_parameter``) or by name (a dict).
1326
+
1327
+ Example -- x' = -p x, x(0) = 1, output x(1):
1328
+
1329
+ >>> from pymcpp import FFGraph, FFPartial, FFEval
1330
+ >>> from cronos import FFDom, ODESLV
1331
+ >>> G = FFGraph(); t, x, p = G.add_var("t"), G.add_var("x"), G.add_var("p")
1332
+ >>> OpP, OpE = FFPartial(), FFEval()
1333
+ >>> S = ODESLV(G)
1334
+ >>> S.add_domain(t, FFDom(0., 1., 2)); S.set_evolution_domain(t)
1335
+ >>> S.add_state(x, [t]); S.add_input(p)
1336
+ >>> S.add_equation(OpP(x, t) + p*x, [t], [FFDom.ALL - FFDom.LB])
1337
+ >>> S.add_equation(x - 1., [t], [FFDom.LB])
1338
+ >>> S.add_output(OpE(x, t, 1.))
1339
+ >>> S.setup()
1340
+ >>> S.solve({p: [0.7]}); S.val_function() # [exp(-0.7)]
1341
+ """
1342
+ class STATUS:
1343
+ """
1344
+ Status of an integration.
1345
+
1346
+ Members:
1347
+
1348
+ NORMAL : Normal execution
1349
+
1350
+ FAILURE : Integration breakdown
1351
+
1352
+ FATAL : Interruption due to errors in third-party libraries
1353
+ """
1354
+ FAILURE: typing.ClassVar[ODESLV.STATUS]
1355
+ FATAL: typing.ClassVar[ODESLV.STATUS]
1356
+ NORMAL: typing.ClassVar[ODESLV.STATUS]
1357
+ __members__: typing.ClassVar[dict[str, ODESLV.STATUS]]
1358
+ def __eq__(self, other: typing.Any) -> bool:
1359
+ ...
1360
+ def __getstate__(self) -> int:
1361
+ ...
1362
+ def __hash__(self) -> int:
1363
+ ...
1364
+ def __index__(self) -> int:
1365
+ ...
1366
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
1367
+ ...
1368
+ def __int__(self) -> int:
1369
+ ...
1370
+ def __ne__(self, other: typing.Any) -> bool:
1371
+ ...
1372
+ def __repr__(self) -> str:
1373
+ ...
1374
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
1375
+ ...
1376
+ def __str__(self) -> str:
1377
+ ...
1378
+ @property
1379
+ def name(self) -> str:
1380
+ ...
1381
+ @property
1382
+ def value(self) -> int:
1383
+ ...
1384
+ class Options(FFModel.Options):
1385
+ """
1386
+ Options of ODESLV: the model options (FFModel.Options) and the CVODES options
1387
+ (integration method, nonlinear and linear solvers, tolerances, sensitivity
1388
+ settings).
1389
+ """
1390
+ class FSA_STRATEGY:
1391
+ """
1392
+ Enumeration type for FSA method
1393
+
1394
+ Members:
1395
+
1396
+ SIMULTANEOUS : Simultaneous state/sensitivity correction
1397
+
1398
+ STAGGERED : Simultaneous sensitivity corrections after state corrections
1399
+
1400
+ STAGGERED1 : Sequential sensitivity corrections after state corrections
1401
+ """
1402
+ SIMULTANEOUS: typing.ClassVar[ODESLV.Options.FSA_STRATEGY]
1403
+ STAGGERED: typing.ClassVar[ODESLV.Options.FSA_STRATEGY]
1404
+ STAGGERED1: typing.ClassVar[ODESLV.Options.FSA_STRATEGY]
1405
+ __members__: typing.ClassVar[dict[str, ODESLV.Options.FSA_STRATEGY]]
1406
+ def __eq__(self, other: typing.Any) -> bool:
1407
+ ...
1408
+ def __getstate__(self) -> int:
1409
+ ...
1410
+ def __hash__(self) -> int:
1411
+ ...
1412
+ def __index__(self) -> int:
1413
+ ...
1414
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
1415
+ ...
1416
+ def __int__(self) -> int:
1417
+ ...
1418
+ def __ne__(self, other: typing.Any) -> bool:
1419
+ ...
1420
+ def __repr__(self) -> str:
1421
+ ...
1422
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
1423
+ ...
1424
+ def __str__(self) -> str:
1425
+ ...
1426
+ @property
1427
+ def name(self) -> str:
1428
+ ...
1429
+ @property
1430
+ def value(self) -> int:
1431
+ ...
1432
+ class ASA_STRATEGY:
1433
+ """
1434
+ Enumeration type for ASA method
1435
+
1436
+ Members:
1437
+
1438
+ HERMITE : Cubic Hermite interpolation
1439
+
1440
+ POLYNOMIAL : Variable degree polynomial interpolation
1441
+ """
1442
+ HERMITE: typing.ClassVar[ODESLV.Options.ASA_STRATEGY]
1443
+ POLYNOMIAL: typing.ClassVar[ODESLV.Options.ASA_STRATEGY]
1444
+ __members__: typing.ClassVar[dict[str, ODESLV.Options.ASA_STRATEGY]]
1445
+ def __eq__(self, other: typing.Any) -> bool:
1446
+ ...
1447
+ def __getstate__(self) -> int:
1448
+ ...
1449
+ def __hash__(self) -> int:
1450
+ ...
1451
+ def __index__(self) -> int:
1452
+ ...
1453
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
1454
+ ...
1455
+ def __int__(self) -> int:
1456
+ ...
1457
+ def __ne__(self, other: typing.Any) -> bool:
1458
+ ...
1459
+ def __repr__(self) -> str:
1460
+ ...
1461
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
1462
+ ...
1463
+ def __str__(self) -> str:
1464
+ ...
1465
+ @property
1466
+ def name(self) -> str:
1467
+ ...
1468
+ @property
1469
+ def value(self) -> int:
1470
+ ...
1471
+ class INTEGRATION_METHOD:
1472
+ """
1473
+ Enumeration of numerical integration algorithms
1474
+
1475
+ Members:
1476
+
1477
+ MSADAMS : Variable-coefficient linear multistep Adams method (non-stiff systems)
1478
+
1479
+ MSBDF : Variable-coefficient linear multistep backward differentiation formula (BDF) method (stiff systems)
1480
+ """
1481
+ MSADAMS: typing.ClassVar[ODESLV.Options.INTEGRATION_METHOD]
1482
+ MSBDF: typing.ClassVar[ODESLV.Options.INTEGRATION_METHOD]
1483
+ __members__: typing.ClassVar[dict[str, ODESLV.Options.INTEGRATION_METHOD]]
1484
+ def __eq__(self, other: typing.Any) -> bool:
1485
+ ...
1486
+ def __getstate__(self) -> int:
1487
+ ...
1488
+ def __hash__(self) -> int:
1489
+ ...
1490
+ def __index__(self) -> int:
1491
+ ...
1492
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
1493
+ ...
1494
+ def __int__(self) -> int:
1495
+ ...
1496
+ def __ne__(self, other: typing.Any) -> bool:
1497
+ ...
1498
+ def __repr__(self) -> str:
1499
+ ...
1500
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
1501
+ ...
1502
+ def __str__(self) -> str:
1503
+ ...
1504
+ @property
1505
+ def name(self) -> str:
1506
+ ...
1507
+ @property
1508
+ def value(self) -> int:
1509
+ ...
1510
+ class NONLINEAR_SOLVER:
1511
+ """
1512
+ Enumeration of nonlinear solver strategies
1513
+
1514
+ Members:
1515
+
1516
+ FIXEDPOINT : Fixed point nonlinear solver
1517
+
1518
+ NEWTON : Newton nonlinear solver
1519
+ """
1520
+ FIXEDPOINT: typing.ClassVar[ODESLV.Options.NONLINEAR_SOLVER]
1521
+ NEWTON: typing.ClassVar[ODESLV.Options.NONLINEAR_SOLVER]
1522
+ __members__: typing.ClassVar[dict[str, ODESLV.Options.NONLINEAR_SOLVER]]
1523
+ def __eq__(self, other: typing.Any) -> bool:
1524
+ ...
1525
+ def __getstate__(self) -> int:
1526
+ ...
1527
+ def __hash__(self) -> int:
1528
+ ...
1529
+ def __index__(self) -> int:
1530
+ ...
1531
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
1532
+ ...
1533
+ def __int__(self) -> int:
1534
+ ...
1535
+ def __ne__(self, other: typing.Any) -> bool:
1536
+ ...
1537
+ def __repr__(self) -> str:
1538
+ ...
1539
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
1540
+ ...
1541
+ def __str__(self) -> str:
1542
+ ...
1543
+ @property
1544
+ def name(self) -> str:
1545
+ ...
1546
+ @property
1547
+ def value(self) -> int:
1548
+ ...
1549
+ class LINEAR_SOLVER:
1550
+ """
1551
+ Enumeration of linear solver strategies (within Newton nonlinear solver)
1552
+
1553
+ Members:
1554
+
1555
+ DIAG : Approximate diagonal Jacobian formed by way of a difference quotient
1556
+
1557
+ DENSE : Use analytic dense Jacobian and internal direct dense linear algebra functions
1558
+
1559
+ DENSEDQ : Use approximate dense Jacobian by way of a difference quotient and internal direct dense linear algebra
1560
+
1561
+ SPARSE : Use analytic sparse Jacobian and the KLU sparse direct solver. Requires a build with KLU
1562
+ """
1563
+ DENSE: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1564
+ DENSEDQ: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1565
+ DIAG: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1566
+ SPARSE: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1567
+ __members__: typing.ClassVar[dict[str, ODESLV.Options.LINEAR_SOLVER]]
1568
+ def __eq__(self, other: typing.Any) -> bool:
1569
+ ...
1570
+ def __getstate__(self) -> int:
1571
+ ...
1572
+ def __hash__(self) -> int:
1573
+ ...
1574
+ def __index__(self) -> int:
1575
+ ...
1576
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
1577
+ ...
1578
+ def __int__(self) -> int:
1579
+ ...
1580
+ def __ne__(self, other: typing.Any) -> bool:
1581
+ ...
1582
+ def __repr__(self) -> str:
1583
+ ...
1584
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
1585
+ ...
1586
+ def __str__(self) -> str:
1587
+ ...
1588
+ @property
1589
+ def name(self) -> str:
1590
+ ...
1591
+ @property
1592
+ def value(self) -> int:
1593
+ ...
1594
+ DENSE: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1595
+ DENSEDQ: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1596
+ DIAG: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1597
+ FIXEDPOINT: typing.ClassVar[ODESLV.Options.NONLINEAR_SOLVER]
1598
+ HERMITE: typing.ClassVar[ODESLV.Options.ASA_STRATEGY]
1599
+ MSADAMS: typing.ClassVar[ODESLV.Options.INTEGRATION_METHOD]
1600
+ MSBDF: typing.ClassVar[ODESLV.Options.INTEGRATION_METHOD]
1601
+ NEWTON: typing.ClassVar[ODESLV.Options.NONLINEAR_SOLVER]
1602
+ POLYNOMIAL: typing.ClassVar[ODESLV.Options.ASA_STRATEGY]
1603
+ SIMULTANEOUS: typing.ClassVar[ODESLV.Options.FSA_STRATEGY]
1604
+ SPARSE: typing.ClassVar[ODESLV.Options.LINEAR_SOLVER]
1605
+ STAGGERED: typing.ClassVar[ODESLV.Options.FSA_STRATEGY]
1606
+ STAGGERED1: typing.ClassVar[ODESLV.Options.FSA_STRATEGY]
1607
+ @typing.overload
1608
+ def __init__(self) -> None:
1609
+ ...
1610
+ @typing.overload
1611
+ def __init__(self, arg0: ODESLV.Options) -> None:
1612
+ ...
1613
+ @property
1614
+ def ASACHKPT(self) -> int:
1615
+ """
1616
+ Number of steps between each check point for ASA
1617
+ """
1618
+ @ASACHKPT.setter
1619
+ def ASACHKPT(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
1620
+ ...
1621
+ @property
1622
+ def ASAINTERP(self) -> ODESLV.Options.ASA_STRATEGY:
1623
+ """
1624
+ ASA interpolation strategy
1625
+ """
1626
+ @ASAINTERP.setter
1627
+ def ASAINTERP(self, arg0: ODESLV.Options.ASA_STRATEGY) -> None:
1628
+ ...
1629
+ @property
1630
+ def ATOL(self) -> float:
1631
+ """
1632
+ Absolute (scalar) integration tolerance
1633
+ """
1634
+ @ATOL.setter
1635
+ def ATOL(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1636
+ ...
1637
+ @property
1638
+ def ATOLB(self) -> float:
1639
+ """
1640
+ Absolute (scalar) integration tolerance for ASA
1641
+ """
1642
+ @ATOLB.setter
1643
+ def ATOLB(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1644
+ ...
1645
+ @property
1646
+ def ATOLS(self) -> float:
1647
+ """
1648
+ Absolute (scalar) integration tolerance for FSA
1649
+ """
1650
+ @ATOLS.setter
1651
+ def ATOLS(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1652
+ ...
1653
+ @property
1654
+ def AUTOTOLS(self) -> bool:
1655
+ """
1656
+ Whether integration tolerances for FS are to be set automatically?
1657
+ """
1658
+ @AUTOTOLS.setter
1659
+ def AUTOTOLS(self, arg0: bool) -> None:
1660
+ ...
1661
+ @property
1662
+ def DISPLAY(self) -> int:
1663
+ """
1664
+ Display level (default: 1)
1665
+ """
1666
+ @DISPLAY.setter
1667
+ def DISPLAY(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
1668
+ ...
1669
+ @property
1670
+ def ETOL(self) -> float:
1671
+ """
1672
+ Absolute (scalar) integration tolerance for ellipsoid shape matrix
1673
+ """
1674
+ @ETOL.setter
1675
+ def ETOL(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1676
+ ...
1677
+ @property
1678
+ def ETOLB(self) -> float:
1679
+ """
1680
+ Absolute (scalar) integration tolerance for ellipsoid shape matrix in ASA
1681
+ """
1682
+ @ETOLB.setter
1683
+ def ETOLB(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1684
+ ...
1685
+ @property
1686
+ def ETOLS(self) -> float:
1687
+ """
1688
+ Absolute (scalar) integration tolerance for ellipsoid shape matrix in FSA
1689
+ """
1690
+ @ETOLS.setter
1691
+ def ETOLS(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1692
+ ...
1693
+ @property
1694
+ def FSACORR(self) -> ODESLV.Options.FSA_STRATEGY:
1695
+ """
1696
+ FSA correction strategy
1697
+ """
1698
+ @FSACORR.setter
1699
+ def FSACORR(self, arg0: ODESLV.Options.FSA_STRATEGY) -> None:
1700
+ ...
1701
+ @property
1702
+ def FSAERR(self) -> bool:
1703
+ """
1704
+ Whether or not FSA error control is performed?
1705
+ """
1706
+ @FSAERR.setter
1707
+ def FSAERR(self, arg0: bool) -> None:
1708
+ ...
1709
+ @property
1710
+ def H0(self) -> float:
1711
+ """
1712
+ Initial step-size [Default: 0e0 (auto)]
1713
+ """
1714
+ @H0.setter
1715
+ def H0(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1716
+ ...
1717
+ @property
1718
+ def HMAX(self) -> float:
1719
+ """
1720
+ Maximum step-size [Default: 0e0 (+inf)]
1721
+ """
1722
+ @HMAX.setter
1723
+ def HMAX(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1724
+ ...
1725
+ @property
1726
+ def HMIN(self) -> float:
1727
+ """
1728
+ Minimum step-size [Default: 0e0]
1729
+ """
1730
+ @HMIN.setter
1731
+ def HMIN(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1732
+ ...
1733
+ @property
1734
+ def INTMETH(self) -> ODESLV.Options.INTEGRATION_METHOD:
1735
+ """
1736
+ Numerical integration method [Default: MSBDF]
1737
+ """
1738
+ @INTMETH.setter
1739
+ def INTMETH(self, arg0: ODESLV.Options.INTEGRATION_METHOD) -> None:
1740
+ ...
1741
+ @property
1742
+ def LINSOL(self) -> ODESLV.Options.LINEAR_SOLVER:
1743
+ """
1744
+ Linear solver method and Jacobian approximation [Default: DIAG]
1745
+ """
1746
+ @LINSOL.setter
1747
+ def LINSOL(self, arg0: ODESLV.Options.LINEAR_SOLVER) -> None:
1748
+ ...
1749
+ @property
1750
+ def MAXCORR(self) -> int:
1751
+ """
1752
+ Maximum number of nonlinear solver iterations per step
1753
+ """
1754
+ @MAXCORR.setter
1755
+ def MAXCORR(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
1756
+ ...
1757
+ @property
1758
+ def MAXFAIL(self) -> int:
1759
+ """
1760
+ Maximum number of error test failures per step
1761
+ """
1762
+ @MAXFAIL.setter
1763
+ def MAXFAIL(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
1764
+ ...
1765
+ @property
1766
+ def NLINSOL(self) -> ODESLV.Options.NONLINEAR_SOLVER:
1767
+ """
1768
+ Nonlinear solver method [Default: NEWTON]
1769
+ """
1770
+ @NLINSOL.setter
1771
+ def NLINSOL(self, arg0: ODESLV.Options.NONLINEAR_SOLVER) -> None:
1772
+ ...
1773
+ @property
1774
+ def NMAX(self) -> int:
1775
+ """
1776
+ Maximum number of steps in a time stage [Default: 0 (2000)]
1777
+ """
1778
+ @NMAX.setter
1779
+ def NMAX(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
1780
+ ...
1781
+ @property
1782
+ def QERR(self) -> bool:
1783
+ """
1784
+ Whether or not (state) quadrature error control is performed?
1785
+ """
1786
+ @QERR.setter
1787
+ def QERR(self, arg0: bool) -> None:
1788
+ ...
1789
+ @property
1790
+ def QERRB(self) -> bool:
1791
+ """
1792
+ Whether or not ASA quadrature error control is performed?
1793
+ """
1794
+ @QERRB.setter
1795
+ def QERRB(self, arg0: bool) -> None:
1796
+ ...
1797
+ @property
1798
+ def QERRS(self) -> bool:
1799
+ """
1800
+ Whether or not FSA quadrature error control is performed?
1801
+ """
1802
+ @QERRS.setter
1803
+ def QERRS(self, arg0: bool) -> None:
1804
+ ...
1805
+ @property
1806
+ def RESRECORD(self) -> int:
1807
+ """
1808
+ Whether or not to record results (default: 0)
1809
+ """
1810
+ @RESRECORD.setter
1811
+ def RESRECORD(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
1812
+ ...
1813
+ @property
1814
+ def RTOL(self) -> float:
1815
+ """
1816
+ Relative (scalar) integration tolerance
1817
+ """
1818
+ @RTOL.setter
1819
+ def RTOL(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1820
+ ...
1821
+ @property
1822
+ def RTOLB(self) -> float:
1823
+ """
1824
+ Relative (scalar) integration tolerance for ASA
1825
+ """
1826
+ @RTOLB.setter
1827
+ def RTOLB(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1828
+ ...
1829
+ @property
1830
+ def RTOLS(self) -> float:
1831
+ """
1832
+ Relative (scalar) integration tolerance for FSA
1833
+ """
1834
+ @RTOLS.setter
1835
+ def RTOLS(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
1836
+ ...
1837
+ class ResultsSolve:
1838
+ """
1839
+ Trajectories recorded by the last ``solve`` (``options.RESRECORD`` points), as
1840
+ NumPy arrays.
1841
+ """
1842
+ @property
1843
+ def q(self) -> numpy.typing.NDArray[numpy.float64]:
1844
+ """
1845
+ Quadratures, shape (n, nq).
1846
+ """
1847
+ @property
1848
+ def t(self) -> numpy.typing.NDArray[numpy.float64]:
1849
+ """
1850
+ Time points, shape (n,); a stage boundary appears twice (values on either side).
1851
+ """
1852
+ @property
1853
+ def x(self) -> numpy.typing.NDArray[numpy.float64]:
1854
+ """
1855
+ States, shape (n, nx), in the order of ``var_state``.
1856
+ """
1857
+ class ResultsFsens:
1858
+ """
1859
+ Trajectories recorded by the last ``solve_fsens``, as NumPy arrays: one block
1860
+ per sensitivity direction (``sensitivity_index``).
1861
+ """
1862
+ @property
1863
+ def qp(self) -> numpy.typing.NDArray[numpy.float64]:
1864
+ """
1865
+ Quadrature sensitivities, shape (nsen, n, nq).
1866
+ """
1867
+ @property
1868
+ def t(self) -> numpy.typing.NDArray[numpy.float64]:
1869
+ """
1870
+ Time points, shape (n,); a stage boundary appears twice (values on either side).
1871
+ """
1872
+ @property
1873
+ def xp(self) -> numpy.typing.NDArray[numpy.float64]:
1874
+ """
1875
+ State sensitivities, shape (nsen, n, nx).
1876
+ """
1877
+ class ResultsAsens:
1878
+ """
1879
+ Trajectories recorded by the last ``solve_asens``, as NumPy arrays: one block
1880
+ per output function, in ASCENDING time (the adjoint integration runs
1881
+ backward).
1882
+ """
1883
+ @property
1884
+ def l(self) -> numpy.typing.NDArray[numpy.float64]:
1885
+ """
1886
+ Adjoint states, shape (nf, n, nx).
1887
+ """
1888
+ @property
1889
+ def qp(self) -> numpy.typing.NDArray[numpy.float64]:
1890
+ """
1891
+ Running gradient of each output with respect to the sensitivity directions,
1892
+ shape (nf, n, nsen); its value at t = 0 is the gradient.
1893
+ """
1894
+ @property
1895
+ def t(self) -> numpy.typing.NDArray[numpy.float64]:
1896
+ """
1897
+ Time points, ascending, shape (n,); a stage boundary appears twice.
1898
+ """
1899
+ class Stats:
1900
+ """
1901
+ Statistics of an integration.
1902
+ """
1903
+ @property
1904
+ def cputime(self) -> float:
1905
+ """
1906
+ CPU time (seconds).
1907
+ """
1908
+ @property
1909
+ def numJAC(self) -> int:
1910
+ """
1911
+ Number of Jacobian evaluations.
1912
+ """
1913
+ @property
1914
+ def numRHS(self) -> int:
1915
+ """
1916
+ Number of right-hand-side evaluations.
1917
+ """
1918
+ @property
1919
+ def numSteps(self) -> int:
1920
+ """
1921
+ Number of steps.
1922
+ """
1923
+ FAILURE: typing.ClassVar[ODESLV.STATUS]
1924
+ FATAL: typing.ClassVar[ODESLV.STATUS]
1925
+ NORMAL: typing.ClassVar[ODESLV.STATUS]
1926
+ @staticmethod
1927
+ def revision() -> str:
1928
+ """
1929
+ The revision of the ODESLV headers (odeslv_base.hpp and the three that change with it), e.g.
1930
+ for a bug report; FFModel.revision() gives the model layer's.
1931
+ """
1932
+ def __init__(self, dag: pymcpp.FFGraph) -> None:
1933
+ """
1934
+ Empty solver and model on the DAG ``dag`` (kept alive by it).
1935
+ """
1936
+ def blk_fct(self, ndx: typing.SupportsInt | typing.SupportsIndex) -> tuple[int, int]:
1937
+ """
1938
+ The block of output ``ndx`` (in add_output() order) in ``val_function()``:
1939
+ ``(first, count)``. An ODESLV integrates a lumped system and returns one value
1940
+ per output, so the block is ``(ndx, 1)``. The same call exists on ``OCFESLV``,
1941
+ where a distributed output spans several values.
1942
+ """
1943
+ def extract_error(self) -> str:
1944
+ """
1945
+ Why the model could not be extracted as an ODE system (empty if it could).
1946
+ """
1947
+ def get_parameter_values(self, var: pymcpp.FFVar, p: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> list[float]:
1948
+ """
1949
+ The values of input ``var`` in the parameter vector ``p``.
1950
+ """
1951
+ def nf(self) -> int:
1952
+ """
1953
+ Number of output functions.
1954
+ """
1955
+ def np(self) -> int:
1956
+ """
1957
+ Number of parameters.
1958
+ """
1959
+ def nq(self) -> int:
1960
+ """
1961
+ Number of quadratures.
1962
+ """
1963
+ def ns(self) -> int:
1964
+ """
1965
+ Number of stages.
1966
+ """
1967
+ def nx(self) -> int:
1968
+ """
1969
+ Number of states.
1970
+ """
1971
+ def parameter_index(self, var: pymcpp.FFVar) -> list[int]:
1972
+ """
1973
+ Positions of input ``var``'s values in the parameter vector.
1974
+ """
1975
+ def pos_input(self, var: pymcpp.FFVar, ndx_el: collections.abc.Mapping[pymcpp.FFVar, typing.SupportsInt | typing.SupportsIndex] = {}) -> int:
1976
+ """
1977
+ Position of input ``var`` (in element ``ndx_el``) in the parameter vector.
1978
+ """
1979
+ def set_parameter_values(self, var: pymcpp.FFVar, values: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], p: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> list[float]:
1980
+ """
1981
+ Return a copy of the parameter vector ``p`` with the values of input ``var``
1982
+ replaced by ``values``.
1983
+ """
1984
+ def setup(self) -> bool:
1985
+ """
1986
+ Analyse the model and build the integrator; returns False on failure (see
1987
+ ``extract_error`` and ``setup_status``). Output written by C++ is redirected
1988
+ to Python's ``sys.stdout`` / ``sys.stderr``.
1989
+ """
1990
+ @typing.overload
1991
+ def solve(self, p: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], c: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> ODESLV.STATUS:
1992
+ """
1993
+ Integrate the model.
1994
+
1995
+ Parameters
1996
+ ----------
1997
+ p : list of float
1998
+ Parameter values, in the order of ``var_parameter``.
1999
+ c : list of float, optional
2000
+ Constant values, in the order of ``var_constant``.
2001
+
2002
+ Returns
2003
+ -------
2004
+ ODESLV.STATUS
2005
+ """
2006
+ @typing.overload
2007
+ def solve(self, inputs: collections.abc.Mapping[pymcpp.FFVar, collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | collections.abc.Callable[[FFModel.DofIndex], float]]) -> ODESLV.STATUS:
2008
+ """
2009
+ Integrate the model.
2010
+
2011
+ The values are given BY NAME: a dict mapping every declared input and constant
2012
+ to its values -- a list (one value for a parameter or a constant; one per DOF
2013
+ for a distributed input, in the order of ``control_dofs``) or a generator
2014
+ ``gen(dof: FFModel.DofIndex) -> float``. An incomplete or inconsistent dict
2015
+ raises ``ValueError``, naming the entry.
2016
+ """
2017
+ @typing.overload
2018
+ def solve_asens(self, p: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], c: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> ODESLV.STATUS:
2019
+ """
2020
+ Integrate the model forward and its adjoints backward, for the gradients of
2021
+ the outputs with respect to the sensitivity directions. Arguments as
2022
+ ``solve``.
2023
+ """
2024
+ @typing.overload
2025
+ def solve_asens(self, inputs: collections.abc.Mapping[pymcpp.FFVar, collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | collections.abc.Callable[[FFModel.DofIndex], float]]) -> ODESLV.STATUS:
2026
+ """
2027
+ Integrate the model and its adjoints.
2028
+
2029
+ The values are given BY NAME: a dict mapping every declared input and constant
2030
+ to its values -- a list (one value for a parameter or a constant; one per DOF
2031
+ for a distributed input, in the order of ``control_dofs``) or a generator
2032
+ ``gen(dof: FFModel.DofIndex) -> float``. An incomplete or inconsistent dict
2033
+ raises ``ValueError``, naming the entry.
2034
+ """
2035
+ @typing.overload
2036
+ def solve_fsens(self, p: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], c: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> ODESLV.STATUS:
2037
+ """
2038
+ Integrate the model and its forward sensitivities with respect to the
2039
+ sensitivity directions (``sensitivity_index``: the control DOFs, or every
2040
+ parameter when no control is registered). Arguments as ``solve``.
2041
+ """
2042
+ @typing.overload
2043
+ def solve_fsens(self, inputs: collections.abc.Mapping[pymcpp.FFVar, collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | collections.abc.Callable[[FFModel.DofIndex], float]]) -> ODESLV.STATUS:
2044
+ """
2045
+ Integrate the model and its forward sensitivities.
2046
+
2047
+ The values are given BY NAME: a dict mapping every declared input and constant
2048
+ to its values -- a list (one value for a parameter or a constant; one per DOF
2049
+ for a distributed input, in the order of ``control_dofs``) or a generator
2050
+ ``gen(dof: FFModel.DofIndex) -> float``. An incomplete or inconsistent dict
2051
+ raises ``ValueError``, naming the entry.
2052
+ """
2053
+ def val_function(self) -> list[float]:
2054
+ """
2055
+ Output values after the last solve.
2056
+ """
2057
+ @typing.overload
2058
+ def val_function_gradient(self) -> list[list[float]]:
2059
+ """
2060
+ Output gradients after the last sensitivity solve: one row per sensitivity
2061
+ direction (``sensitivity_index``), one column per output.
2062
+ """
2063
+ @typing.overload
2064
+ def val_function_gradient(self, var: pymcpp.FFVar) -> list[list[float]]:
2065
+ """
2066
+ Output gradients with respect to the DOFs of the control ``var`` only: one row
2067
+ per DOF (in the order of ``control_dofs``), one column per output.
2068
+ """
2069
+ @typing.overload
2070
+ def val_function_gradient(self, var: pymcpp.FFVar, ndx_el: collections.abc.Mapping[pymcpp.FFVar, typing.SupportsInt | typing.SupportsIndex]) -> list[list[float]]:
2071
+ """
2072
+ Output gradients with respect to the DOFs of the control ``var`` in one
2073
+ element, ``{evolution domain: element}`` (ignored for a time-invariant
2074
+ control).
2075
+ """
2076
+ def val_state(self) -> list[list[float]]:
2077
+ """
2078
+ State values at the stage times after the last solve.
2079
+ """
2080
+ @property
2081
+ def options(self) -> ODESLV.Options:
2082
+ """
2083
+ Solver options (model and CVODES).
2084
+ """
2085
+ @options.setter
2086
+ def options(self, arg1: ODESLV.Options) -> None:
2087
+ ...
2088
+ @property
2089
+ def results_asens(self) -> ODESLV.ResultsAsens:
2090
+ """
2091
+ Trajectories of the last ``solve_asens``, as NumPy arrays (ascending time).
2092
+ """
2093
+ @property
2094
+ def results_fsens(self) -> ODESLV.ResultsFsens:
2095
+ """
2096
+ Trajectories of the last ``solve_fsens``, as NumPy arrays.
2097
+ """
2098
+ @property
2099
+ def results_solve(self) -> ODESLV.ResultsSolve:
2100
+ """
2101
+ Trajectories of the last ``solve`` (``options.RESRECORD``), as NumPy arrays.
2102
+ """
2103
+ @property
2104
+ def sensitivity_index(self) -> list[int]:
2105
+ """
2106
+ Parameter positions of the sensitivity directions, in order.
2107
+ """
2108
+ @property
2109
+ def stats_asens(self) -> ODESLV.Stats:
2110
+ """
2111
+ Statistics of the last ``solve_asens``.
2112
+ """
2113
+ @property
2114
+ def stats_fsens(self) -> ODESLV.Stats:
2115
+ """
2116
+ Statistics of the last ``solve_fsens``.
2117
+ """
2118
+ @property
2119
+ def stats_solve(self) -> ODESLV.Stats:
2120
+ """
2121
+ Statistics of the last ``solve``.
2122
+ """
2123
+ @property
2124
+ def var_parameter(self) -> list[pymcpp.FFVar]:
2125
+ """
2126
+ The parameter vector the solver integrates against: the time-invariant inputs
2127
+ and, for each time-varying input, its per-element nodal values.
2128
+ """
2129
+ class FFODESLV(pymcpp.FFOp):
2130
+ """
2131
+ An ODESLV solve embedded as an operation of the DAG: its outputs become DAG
2132
+ variables, functions of the DAG variables given for the solver's inputs and
2133
+ constants. Evaluating them integrates the model; differentiating them (FFGraph
2134
+ ``fdiff`` / ``bdiff``) uses forward or adjoint sensitivities
2135
+ (``options.GRADIENT``), through FFGradODESLV.
2136
+
2137
+ Example -- x(1) for x' = -p x, x(0) = 1, as a DAG variable of P:
2138
+
2139
+ >>> OpODE = FFODESLV()
2140
+ >>> P = G.add_var("P")
2141
+ >>> y = OpODE({p: [P]}, solver) # every input differentiated, no constant
2142
+ >>> G.eval(y, [P], [0.7]) # [exp(-0.7)]
2143
+ """
2144
+ class POLICY_TYPE:
2145
+ """
2146
+ Copy policy of the embedded solver.
2147
+
2148
+ Members:
2149
+
2150
+ SHALLOW : Refer to the solver (kept alive as long as the DAG)
2151
+
2152
+ COPY : Hold a deep copy of the solver (default)
2153
+
2154
+ TRANSFER : Not available from Python (ownership transfer)
2155
+ """
2156
+ COPY: typing.ClassVar[FFODESLV.POLICY_TYPE]
2157
+ SHALLOW: typing.ClassVar[FFODESLV.POLICY_TYPE]
2158
+ TRANSFER: typing.ClassVar[FFODESLV.POLICY_TYPE]
2159
+ __members__: typing.ClassVar[dict[str, FFODESLV.POLICY_TYPE]]
2160
+ def __eq__(self, other: typing.Any) -> bool:
2161
+ ...
2162
+ def __getstate__(self) -> int:
2163
+ ...
2164
+ def __hash__(self) -> int:
2165
+ ...
2166
+ def __index__(self) -> int:
2167
+ ...
2168
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2169
+ ...
2170
+ def __int__(self) -> int:
2171
+ ...
2172
+ def __ne__(self, other: typing.Any) -> bool:
2173
+ ...
2174
+ def __repr__(self) -> str:
2175
+ ...
2176
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2177
+ ...
2178
+ def __str__(self) -> str:
2179
+ ...
2180
+ @property
2181
+ def name(self) -> str:
2182
+ ...
2183
+ @property
2184
+ def value(self) -> int:
2185
+ ...
2186
+ class GRADIENT_TYPE:
2187
+ """
2188
+ Sensitivity mode of derivatives.
2189
+
2190
+ Members:
2191
+
2192
+ FORWARD : Forward sensitivities (one direction per parameter)
2193
+
2194
+ ADJOINT : Adjoint sensitivities (one backward sweep per output)
2195
+
2196
+ AUTO : ADJOINT when np > NP2NF * nf, else FORWARD (default)
2197
+ """
2198
+ ADJOINT: typing.ClassVar[FFODESLV.GRADIENT_TYPE]
2199
+ AUTO: typing.ClassVar[FFODESLV.GRADIENT_TYPE]
2200
+ FORWARD: typing.ClassVar[FFODESLV.GRADIENT_TYPE]
2201
+ __members__: typing.ClassVar[dict[str, FFODESLV.GRADIENT_TYPE]]
2202
+ def __eq__(self, other: typing.Any) -> bool:
2203
+ ...
2204
+ def __getstate__(self) -> int:
2205
+ ...
2206
+ def __hash__(self) -> int:
2207
+ ...
2208
+ def __index__(self) -> int:
2209
+ ...
2210
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2211
+ ...
2212
+ def __int__(self) -> int:
2213
+ ...
2214
+ def __ne__(self, other: typing.Any) -> bool:
2215
+ ...
2216
+ def __repr__(self) -> str:
2217
+ ...
2218
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2219
+ ...
2220
+ def __str__(self) -> str:
2221
+ ...
2222
+ @property
2223
+ def name(self) -> str:
2224
+ ...
2225
+ @property
2226
+ def value(self) -> int:
2227
+ ...
2228
+ class Options:
2229
+ """
2230
+ Options of FFODESLV and FFGradODESLV, shared by all operations (class-level:
2231
+ ``FFODESLV.options``).
2232
+ """
2233
+ @property
2234
+ def GRADIENT(self) -> int:
2235
+ """
2236
+ Sensitivity mode: FFODESLV.FORWARD, ADJOINT or AUTO.
2237
+ """
2238
+ @GRADIENT.setter
2239
+ def GRADIENT(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
2240
+ ...
2241
+ @property
2242
+ def NP2NF(self) -> float:
2243
+ """
2244
+ Parameter-to-output ratio above which AUTO uses adjoint sensitivities.
2245
+ """
2246
+ @NP2NF.setter
2247
+ def NP2NF(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2248
+ ...
2249
+ @property
2250
+ def SYMDIFF(self) -> list[pymcpp.FFVar]:
2251
+ """
2252
+ Inputs or constants of the operation differentiated SYMBOLICALLY; the others
2253
+ numerically (sensitivities).
2254
+ """
2255
+ @SYMDIFF.setter
2256
+ def SYMDIFF(self, arg0: collections.abc.Sequence[pymcpp.FFVar]) -> None:
2257
+ ...
2258
+ ADJOINT: typing.ClassVar[FFODESLV.GRADIENT_TYPE]
2259
+ AUTO: typing.ClassVar[FFODESLV.GRADIENT_TYPE]
2260
+ COPY: typing.ClassVar[FFODESLV.POLICY_TYPE]
2261
+ FORWARD: typing.ClassVar[FFODESLV.GRADIENT_TYPE]
2262
+ SHALLOW: typing.ClassVar[FFODESLV.POLICY_TYPE]
2263
+ TRANSFER: typing.ClassVar[FFODESLV.POLICY_TYPE]
2264
+ options: typing.ClassVar[FFODESLV.Options]
2265
+ @typing.overload
2266
+ def __call__(self, diff: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], rest: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], solver: ODESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> list[pymcpp.FFVar]:
2267
+ """
2268
+ TWO-MAP form: the outputs of the solve.
2269
+
2270
+ Parameters
2271
+ ----------
2272
+ diff : dict
2273
+ Map 1: the inputs the numerical gradient is taken with respect to, in the
2274
+ order of the gradient columns. Each maps to its DOFs as DAG variables: a
2275
+ list in ``control_dofs`` order, or a generator ``gen(dof) -> FFVar``. It
2276
+ resets the solver's control registry to exactly these inputs.
2277
+ rest : dict
2278
+ Map 2: every other declared input and every constant (one variable each),
2279
+ whose values pass through the DAG with zero numerical derivative.
2280
+ solver : ODESLV
2281
+ The solver (set up). Under COPY (default) the operation holds its own
2282
+ copy; under SHALLOW it refers to ``solver``, which is then kept alive as
2283
+ long as the DAG.
2284
+ policy : FFODESLV.POLICY_TYPE, optional
2285
+ COPY (default) or SHALLOW.
2286
+ name : str, optional
2287
+ Name of the operation in the DAG.
2288
+ """
2289
+ @typing.overload
2290
+ def __call__(self, diff: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], solver: ODESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> list[pymcpp.FFVar]:
2291
+ """
2292
+ ONE-MAP form: every declared input is differentiated and the model has no
2293
+ constant (refused, naming what is missing, otherwise). Arguments as the
2294
+ two-map form.
2295
+ """
2296
+ @typing.overload
2297
+ def __call__(self, idep: typing.SupportsInt | typing.SupportsIndex, diff: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], rest: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], solver: ODESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> pymcpp.FFVar:
2298
+ """
2299
+ TWO-MAP form, output ``idep`` only.
2300
+ """
2301
+ @typing.overload
2302
+ def __call__(self, idep: typing.SupportsInt | typing.SupportsIndex, diff: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], solver: ODESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> pymcpp.FFVar:
2303
+ """
2304
+ ONE-MAP form, output ``idep`` only.
2305
+ """
2306
+ def __init__(self) -> None:
2307
+ """
2308
+ Default constructor.
2309
+ """
2310
+ class FFGradODESLV(pymcpp.FFOp):
2311
+ """
2312
+ The derivative operation of FFODESLV, created when an FFODESLV output is
2313
+ differentiated (FFGraph ``fdiff`` / ``bdiff``); not constructed directly.
2314
+ """
2315
+ class OCFESLV(FFModel):
2316
+ """
2317
+ Solver of an FFModel by orthogonal collocation on finite elements (OCFE), in
2318
+ one monolithic solve or marching along the evolution direction
2319
+ (``options.SOLVE.MARCHING``), with forward (``solve_fsens``) and adjoint
2320
+ (``solve_asens``) sensitivity analysis of the outputs with respect to the
2321
+ registered controls.
2322
+
2323
+ The model is declared through the FFModel methods; ``setup()`` analyses it and
2324
+ builds the collocation system. The unknowns live in NumPy arrays: ``init()``
2325
+ returns the collocation state vector ``var`` (initial guess from the
2326
+ references) and the input vector ``inp``; ``set_input_values`` fills inputs;
2327
+ ``solve`` overwrites ``var`` with the solution.
2328
+
2329
+ Example -- the heat equation u_t = u_zz with an output:
2330
+
2331
+ >>> S = OCFESLV(G)
2332
+ >>> ... declare domains, states, equations, outputs ...
2333
+ >>> S.setup()
2334
+ >>> var, inp = S.init()
2335
+ >>> rep = S.solve(var, inp)
2336
+ >>> rep.converged, S.val_functions()
2337
+ """
2338
+ class SolveReport:
2339
+ """
2340
+ Outcome of a solve.
2341
+ """
2342
+ def __bool__(self) -> bool:
2343
+ """
2344
+ True if converged.
2345
+ """
2346
+ def __repr__(self) -> str:
2347
+ ...
2348
+ @property
2349
+ def converged(self) -> bool:
2350
+ """
2351
+ max|r| <= options.SOLVE.RES_TOL at return
2352
+ """
2353
+ @property
2354
+ def final_merit(self) -> float:
2355
+ """
2356
+ 0.5 * ||row-scaled r||^2 at return
2357
+ """
2358
+ @property
2359
+ def final_residual(self) -> float:
2360
+ """
2361
+ max|r| at return
2362
+ """
2363
+ @property
2364
+ def initial_residual(self) -> float:
2365
+ """
2366
+ max|r| at the supplied guess
2367
+ """
2368
+ @property
2369
+ def iterations(self) -> int:
2370
+ """
2371
+ accepted outer iterations
2372
+ """
2373
+ @property
2374
+ def lm_steps(self) -> int:
2375
+ """
2376
+ accepted damped-LM steps
2377
+ """
2378
+ @property
2379
+ def newton_steps(self) -> int:
2380
+ """
2381
+ accepted undamped-Newton steps
2382
+ """
2383
+ @property
2384
+ def reused(self) -> bool:
2385
+ """
2386
+ returned from the SOLVE.REUSE primal cache (no Newton run)
2387
+ """
2388
+ class Options(FFModel.Options):
2389
+ """
2390
+ Options of OCFESLV: the model options (FFModel.Options) and the collocation
2391
+ solver options, grouped as INTERFACE, SOLVE, OUTPUT, AUDIT, DETERMINACY,
2392
+ SENSITIVITY, HOMOTOPY and FATAL.
2393
+ """
2394
+ class InterfaceType:
2395
+ """
2396
+ the interface-condition type. ONE definition, OCPlan's: ocplan.hpp sits below this header in the include order, and it had carried an identical copy whose comment said it "must stay in sync" with FFModel's. Aliased here, with its enumerators re-exported, so Options::IC_VALUE and OCFESLV::Options::IC_AUTO resolve exactly as before.
2397
+
2398
+ Members:
2399
+
2400
+ IC_VALUE : OCPlan::IC_VALUE
2401
+
2402
+ IC_FLUX : OCPlan::IC_FLUX
2403
+
2404
+ IC_UPWIND : OCPlan::IC_UPWIND
2405
+
2406
+ IC_AUTO : OCPlan::IC_AUTO
2407
+ """
2408
+ IC_AUTO: typing.ClassVar[OCFESLV.Options.InterfaceType]
2409
+ IC_FLUX: typing.ClassVar[OCFESLV.Options.InterfaceType]
2410
+ IC_UPWIND: typing.ClassVar[OCFESLV.Options.InterfaceType]
2411
+ IC_VALUE: typing.ClassVar[OCFESLV.Options.InterfaceType]
2412
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.InterfaceType]]
2413
+ def __eq__(self, other: typing.Any) -> bool:
2414
+ ...
2415
+ def __getstate__(self) -> int:
2416
+ ...
2417
+ def __hash__(self) -> int:
2418
+ ...
2419
+ def __index__(self) -> int:
2420
+ ...
2421
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2422
+ ...
2423
+ def __int__(self) -> int:
2424
+ ...
2425
+ def __ne__(self, other: typing.Any) -> bool:
2426
+ ...
2427
+ def __repr__(self) -> str:
2428
+ ...
2429
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2430
+ ...
2431
+ def __str__(self) -> str:
2432
+ ...
2433
+ @property
2434
+ def name(self) -> str:
2435
+ ...
2436
+ @property
2437
+ def value(self) -> int:
2438
+ ...
2439
+ class ImpositionType:
2440
+ """
2441
+ the imposition type. ONE definition, OCPlan's (ocplan.hpp sits below this header), aliased here with its values re-exported -- as InterfaceType is -- so no static_assert has to keep two copies in step.
2442
+
2443
+ Members:
2444
+
2445
+ IC_WEAK : OCPlan::IMPOSITION_IC_WEAK
2446
+
2447
+ IC_STRONG : OCPlan::IMPOSITION_IC_STRONG
2448
+
2449
+ IC_TRACE : OCPlan::IMPOSITION_IC_TRACE
2450
+ """
2451
+ IC_STRONG: typing.ClassVar[OCFESLV.Options.ImpositionType]
2452
+ IC_TRACE: typing.ClassVar[OCFESLV.Options.ImpositionType]
2453
+ IC_WEAK: typing.ClassVar[OCFESLV.Options.ImpositionType]
2454
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.ImpositionType]]
2455
+ def __eq__(self, other: typing.Any) -> bool:
2456
+ ...
2457
+ def __getstate__(self) -> int:
2458
+ ...
2459
+ def __hash__(self) -> int:
2460
+ ...
2461
+ def __index__(self) -> int:
2462
+ ...
2463
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2464
+ ...
2465
+ def __int__(self) -> int:
2466
+ ...
2467
+ def __ne__(self, other: typing.Any) -> bool:
2468
+ ...
2469
+ def __repr__(self) -> str:
2470
+ ...
2471
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2472
+ ...
2473
+ def __str__(self) -> str:
2474
+ ...
2475
+ @property
2476
+ def name(self) -> str:
2477
+ ...
2478
+ @property
2479
+ def value(self) -> int:
2480
+ ...
2481
+ class InterfaceDropPolicy:
2482
+ """
2483
+ What setup() does with interface continuity claims the structural analysis finds redundant -- the values of INTERFACE.DROP_POLICY: drop and verify after the solve, re-derive what verification flags, or keep all.
2484
+
2485
+ Members:
2486
+
2487
+ DROP_VERIFY : structural drop + post-solve verify gate (default)
2488
+
2489
+ DROP_REDERIVE : verify-driven re-derive: protect over-dropped claims, re-solve
2490
+
2491
+ DROP_OFF : disable the drop; keep all continuity claims explicit
2492
+ """
2493
+ DROP_OFF: typing.ClassVar[OCFESLV.Options.InterfaceDropPolicy]
2494
+ DROP_REDERIVE: typing.ClassVar[OCFESLV.Options.InterfaceDropPolicy]
2495
+ DROP_VERIFY: typing.ClassVar[OCFESLV.Options.InterfaceDropPolicy]
2496
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.InterfaceDropPolicy]]
2497
+ def __eq__(self, other: typing.Any) -> bool:
2498
+ ...
2499
+ def __getstate__(self) -> int:
2500
+ ...
2501
+ def __hash__(self) -> int:
2502
+ ...
2503
+ def __index__(self) -> int:
2504
+ ...
2505
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2506
+ ...
2507
+ def __int__(self) -> int:
2508
+ ...
2509
+ def __ne__(self, other: typing.Any) -> bool:
2510
+ ...
2511
+ def __repr__(self) -> str:
2512
+ ...
2513
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2514
+ ...
2515
+ def __str__(self) -> str:
2516
+ ...
2517
+ @property
2518
+ def name(self) -> str:
2519
+ ...
2520
+ @property
2521
+ def value(self) -> int:
2522
+ ...
2523
+ class DerivCacheType:
2524
+ """
2525
+ undocumented
2526
+
2527
+ Members:
2528
+
2529
+ DERIV_LAZY : DERIV_LAZY
2530
+
2531
+ DERIV_EAGER : DERIV_EAGER
2532
+ """
2533
+ DERIV_EAGER: typing.ClassVar[OCFESLV.Options.DerivCacheType]
2534
+ DERIV_LAZY: typing.ClassVar[OCFESLV.Options.DerivCacheType]
2535
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.DerivCacheType]]
2536
+ def __eq__(self, other: typing.Any) -> bool:
2537
+ ...
2538
+ def __getstate__(self) -> int:
2539
+ ...
2540
+ def __hash__(self) -> int:
2541
+ ...
2542
+ def __index__(self) -> int:
2543
+ ...
2544
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2545
+ ...
2546
+ def __int__(self) -> int:
2547
+ ...
2548
+ def __ne__(self, other: typing.Any) -> bool:
2549
+ ...
2550
+ def __repr__(self) -> str:
2551
+ ...
2552
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2553
+ ...
2554
+ def __str__(self) -> str:
2555
+ ...
2556
+ @property
2557
+ def name(self) -> str:
2558
+ ...
2559
+ @property
2560
+ def value(self) -> int:
2561
+ ...
2562
+ class LinearEvalCacheType:
2563
+ """
2564
+ undocumented
2565
+
2566
+ Members:
2567
+
2568
+ LINEAR_NONE : LINEAR_NONE
2569
+
2570
+ LINEAR_LAZY : LINEAR_LAZY
2571
+
2572
+ LINEAR_EAGER : LINEAR_EAGER
2573
+ """
2574
+ LINEAR_EAGER: typing.ClassVar[OCFESLV.Options.LinearEvalCacheType]
2575
+ LINEAR_LAZY: typing.ClassVar[OCFESLV.Options.LinearEvalCacheType]
2576
+ LINEAR_NONE: typing.ClassVar[OCFESLV.Options.LinearEvalCacheType]
2577
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.LinearEvalCacheType]]
2578
+ def __eq__(self, other: typing.Any) -> bool:
2579
+ ...
2580
+ def __getstate__(self) -> int:
2581
+ ...
2582
+ def __hash__(self) -> int:
2583
+ ...
2584
+ def __index__(self) -> int:
2585
+ ...
2586
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2587
+ ...
2588
+ def __int__(self) -> int:
2589
+ ...
2590
+ def __ne__(self, other: typing.Any) -> bool:
2591
+ ...
2592
+ def __repr__(self) -> str:
2593
+ ...
2594
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2595
+ ...
2596
+ def __str__(self) -> str:
2597
+ ...
2598
+ @property
2599
+ def name(self) -> str:
2600
+ ...
2601
+ @property
2602
+ def value(self) -> int:
2603
+ ...
2604
+ class OutputGridPolicy:
2605
+ """
2606
+ undocumented
2607
+
2608
+ Members:
2609
+
2610
+ OUT_ELEMENT_LOCAL : OUT_ELEMENT_LOCAL
2611
+
2612
+ OUT_UNIQUE_PHYSICAL : OUT_UNIQUE_PHYSICAL
2613
+ """
2614
+ OUT_ELEMENT_LOCAL: typing.ClassVar[OCFESLV.Options.OutputGridPolicy]
2615
+ OUT_UNIQUE_PHYSICAL: typing.ClassVar[OCFESLV.Options.OutputGridPolicy]
2616
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.OutputGridPolicy]]
2617
+ def __eq__(self, other: typing.Any) -> bool:
2618
+ ...
2619
+ def __getstate__(self) -> int:
2620
+ ...
2621
+ def __hash__(self) -> int:
2622
+ ...
2623
+ def __index__(self) -> int:
2624
+ ...
2625
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2626
+ ...
2627
+ def __int__(self) -> int:
2628
+ ...
2629
+ def __ne__(self, other: typing.Any) -> bool:
2630
+ ...
2631
+ def __repr__(self) -> str:
2632
+ ...
2633
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2634
+ ...
2635
+ def __str__(self) -> str:
2636
+ ...
2637
+ @property
2638
+ def name(self) -> str:
2639
+ ...
2640
+ @property
2641
+ def value(self) -> int:
2642
+ ...
2643
+ class SolveFactorization:
2644
+ """
2645
+ Sparse linear factorization backend for the internal LM/Newton solve. SOLVE_SUPERLU uses arma::spsolve with SuperLU (requires the Armadillo build to define ARMA_USE_SUPERLU); when it is not linked the solver transparently falls back to a densifying LAPACK solve (one-time notice). SOLVE_LAPACK forces the densifying dense-LU path (small/debug systems). The enum is left extensible for a future UMFPACK/other direct backend without touching call sites.
2646
+
2647
+ Members:
2648
+
2649
+ SOLVE_SUPERLU : sparse SuperLU (arma::spsolve), default. The solver only ever
2650
+
2651
+ SOLVE_LAPACK : densify the damped operator and use dense LU (debug / small systems)
2652
+
2653
+ SOLVE_SPQR : sparse rank-revealing QR (SuiteSparseQR) min-2-norm least squares on
2654
+ """
2655
+ SOLVE_LAPACK: typing.ClassVar[OCFESLV.Options.SolveFactorization]
2656
+ SOLVE_SPQR: typing.ClassVar[OCFESLV.Options.SolveFactorization]
2657
+ SOLVE_SUPERLU: typing.ClassVar[OCFESLV.Options.SolveFactorization]
2658
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.SolveFactorization]]
2659
+ def __eq__(self, other: typing.Any) -> bool:
2660
+ ...
2661
+ def __getstate__(self) -> int:
2662
+ ...
2663
+ def __hash__(self) -> int:
2664
+ ...
2665
+ def __index__(self) -> int:
2666
+ ...
2667
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2668
+ ...
2669
+ def __int__(self) -> int:
2670
+ ...
2671
+ def __ne__(self, other: typing.Any) -> bool:
2672
+ ...
2673
+ def __repr__(self) -> str:
2674
+ ...
2675
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2676
+ ...
2677
+ def __str__(self) -> str:
2678
+ ...
2679
+ @property
2680
+ def name(self) -> str:
2681
+ ...
2682
+ @property
2683
+ def value(self) -> int:
2684
+ ...
2685
+ class SolveWarmstart:
2686
+ """
2687
+ Warm-start strategy for the per-element step of a SOLVE.MARCHING solve.
2688
+
2689
+ Members:
2690
+
2691
+ REUSE : reuse the previous element's converged state as the next guess (free; default)
2692
+
2693
+ BROADCAST_IC : seed every evolution node of the next element with the transferred IC profile
2694
+
2695
+ EXTRAPOLATE : linear/quadratic extrapolation from the last one/two elements' terminals
2696
+ """
2697
+ BROADCAST_IC: typing.ClassVar[OCFESLV.Options.SolveWarmstart]
2698
+ EXTRAPOLATE: typing.ClassVar[OCFESLV.Options.SolveWarmstart]
2699
+ REUSE: typing.ClassVar[OCFESLV.Options.SolveWarmstart]
2700
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.SolveWarmstart]]
2701
+ def __eq__(self, other: typing.Any) -> bool:
2702
+ ...
2703
+ def __getstate__(self) -> int:
2704
+ ...
2705
+ def __hash__(self) -> int:
2706
+ ...
2707
+ def __index__(self) -> int:
2708
+ ...
2709
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2710
+ ...
2711
+ def __int__(self) -> int:
2712
+ ...
2713
+ def __ne__(self, other: typing.Any) -> bool:
2714
+ ...
2715
+ def __repr__(self) -> str:
2716
+ ...
2717
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2718
+ ...
2719
+ def __str__(self) -> str:
2720
+ ...
2721
+ @property
2722
+ def name(self) -> str:
2723
+ ...
2724
+ @property
2725
+ def value(self) -> int:
2726
+ ...
2727
+ class NT_SKIP_MODE:
2728
+ """
2729
+ undocumented
2730
+
2731
+ Members:
2732
+ """
2733
+ __members__: typing.ClassVar[dict] = {}
2734
+ def __eq__(self, other: typing.Any) -> bool:
2735
+ ...
2736
+ def __getstate__(self) -> int:
2737
+ ...
2738
+ def __hash__(self) -> int:
2739
+ ...
2740
+ def __index__(self) -> int:
2741
+ ...
2742
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2743
+ ...
2744
+ def __int__(self) -> int:
2745
+ ...
2746
+ def __ne__(self, other: typing.Any) -> bool:
2747
+ ...
2748
+ def __repr__(self) -> str:
2749
+ ...
2750
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2751
+ ...
2752
+ def __str__(self) -> str:
2753
+ ...
2754
+ @property
2755
+ def name(self) -> str:
2756
+ ...
2757
+ @property
2758
+ def value(self) -> int:
2759
+ ...
2760
+ class DETERMINACY_BACKEND_T:
2761
+ """
2762
+ Rank backend of the determinacy audit (2026-10-09: one value per line, so that the Python binder registers them -- the one-line form left the enum empty in Python).
2763
+
2764
+ Members:
2765
+
2766
+ DET_AUTO : SuiteSparseQR if built, else Eigen if built, else dense under the cap (default)
2767
+
2768
+ DET_SPQR : SuiteSparseQR only; refused by setup() in a build without it (BACKEND_UNAVAILABLE)
2769
+
2770
+ DET_EIGEN : Eigen's sparse QR only; refused by setup() in a build without Eigen (BACKEND_UNAVAILABLE)
2771
+
2772
+ DET_DENSE : dense SVD only, under the size cap
2773
+ """
2774
+ DET_AUTO: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
2775
+ DET_DENSE: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
2776
+ DET_EIGEN: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
2777
+ DET_SPQR: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
2778
+ __members__: typing.ClassVar[dict[str, OCFESLV.Options.DETERMINACY_BACKEND_T]]
2779
+ def __eq__(self, other: typing.Any) -> bool:
2780
+ ...
2781
+ def __getstate__(self) -> int:
2782
+ ...
2783
+ def __hash__(self) -> int:
2784
+ ...
2785
+ def __index__(self) -> int:
2786
+ ...
2787
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
2788
+ ...
2789
+ def __int__(self) -> int:
2790
+ ...
2791
+ def __ne__(self, other: typing.Any) -> bool:
2792
+ ...
2793
+ def __repr__(self) -> str:
2794
+ ...
2795
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
2796
+ ...
2797
+ def __str__(self) -> str:
2798
+ ...
2799
+ @property
2800
+ def name(self) -> str:
2801
+ ...
2802
+ @property
2803
+ def value(self) -> int:
2804
+ ...
2805
+ class t_Interface:
2806
+ """
2807
+ How continuity between elements is expressed and imposed: the condition type, the imposition (penalty, trace multiplier, strong), SAT penalties and trace-multiplier scaling.
2808
+ """
2809
+ def __init__(self) -> None:
2810
+ ...
2811
+ @property
2812
+ def DROP_POLICY(self) -> OCFESLV.Options.InterfaceDropPolicy:
2813
+ """
2814
+ Policy for the IC_TRACE/IC_STRONG redundant-continuity drop (item 10). DROP_VERIFY keeps the structural receiver-B drop and treats a post-solve over-drop (verify_interface_drop) as a hard failure. DROP_REDERIVE additionally lets the driver protect the over-dropped claims and re-derive/re-solve until the verify gate is clean (correct on the linear suite, and the safe path for the nonlinear case). DROP_OFF disables the drop entirely (every continuity claim kept explicit) -- the most conservative, always-correct baseline.
2815
+ """
2816
+ @DROP_POLICY.setter
2817
+ def DROP_POLICY(self, arg0: OCFESLV.Options.InterfaceDropPolicy) -> None:
2818
+ ...
2819
+ @property
2820
+ def IMPOSITION(self) -> OCFESLV.Options.ImpositionType:
2821
+ """
2822
+ Imposition strategy for interface conditions: IC_STRONG (default since 2026-10-06; exact continuity rows), IC_WEAK (penalty terms of strength SAT_SIGMA0) or IC_TRACE (trace multipliers)
2823
+ """
2824
+ @IMPOSITION.setter
2825
+ def IMPOSITION(self, arg0: OCFESLV.Options.ImpositionType) -> None:
2826
+ ...
2827
+ @property
2828
+ def SAT_SIGMA0(self) -> float:
2829
+ """
2830
+ SAT penalty coefficient for C0 (value) continuity. Effective penalty = INTERFACE.SAT_SIGMA0 * tau_d per direction d. Default 10.0 (since 2026-10-03; 1.0 was below threshold at moderate refinement -- a ~10x worse answer, silently -- and 100 can stall the monolithic Newton solve). Default penalty parameter for direction d: tau_d = (n_node - 1)^2 / w_elem (spectral scaling) scaled by INTERFACE.SAT_SIGMA0 (C0 continuity) or CRONOS_SAT_SIGMA1 (C1). When classify_pde() has been called, the penalty is coupled through the principal symbol: sum_j A_d[k,j] * sigma * tau_d * Delta u_j.
2831
+ """
2832
+ @SAT_SIGMA0.setter
2833
+ def SAT_SIGMA0(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2834
+ ...
2835
+ @property
2836
+ def TRACE_PROJ_EPS(self) -> float:
2837
+ """
2838
+ Multiplier-block regularisation for the trace projection. The k continuity conditions the receiver graph cannot support are enforced through a spring of stiffness 1/eps rather than dropped. Default 1.0.
2839
+ """
2840
+ @TRACE_PROJ_EPS.setter
2841
+ def TRACE_PROJ_EPS(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2842
+ ...
2843
+ @property
2844
+ def TRACE_PROJ_MAX(self) -> int:
2845
+ """
2846
+ Largest n_trace_var for which the trace projector is computed; 0 disables the guard. Default 6000.
2847
+ """
2848
+ @TRACE_PROJ_MAX.setter
2849
+ def TRACE_PROJ_MAX(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
2850
+ ...
2851
+ @property
2852
+ def TRACE_TAU_SCALE(self) -> float:
2853
+ """
2854
+ Column scaling for generated IC_TRACE tau variables. Claim-centred multipliers enter receiver rows as INTERFACE.TRACE_TAU_SCALE*lambda. The projected u-solution is unchanged, but a non-unit value can improve conditioning when tau variables are much larger/smaller than state rows.
2855
+ """
2856
+ @TRACE_TAU_SCALE.setter
2857
+ def TRACE_TAU_SCALE(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2858
+ ...
2859
+ @property
2860
+ def TYPE(self) -> OCFESLV.Options.InterfaceType:
2861
+ """
2862
+ Interface condition type for multi-element continuity
2863
+ """
2864
+ @TYPE.setter
2865
+ def TYPE(self, arg0: OCFESLV.Options.InterfaceType) -> None:
2866
+ ...
2867
+ class t_Solve:
2868
+ """
2869
+ The nonlinear solve: Newton/Levenberg-Marquardt control, linear backend, marching, reuse, evaluation caches, and the solver's own verbosity.
2870
+ """
2871
+ def __init__(self) -> None:
2872
+ ...
2873
+ @property
2874
+ def ARMIJO_C(self) -> float:
2875
+ """
2876
+ Armijo sufficient-decrease constant (1e-4)
2877
+ """
2878
+ @ARMIJO_C.setter
2879
+ def ARMIJO_C(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2880
+ ...
2881
+ @property
2882
+ def DERIV_CACHE(self) -> OCFESLV.Options.DerivCacheType:
2883
+ """
2884
+ Derivative sparsity/coloring cache policy. DERIV_LAZY postpones FFDep sparsity propagation and coloring until a derivative/sparsity query needs them; DERIV_EAGER preserves the older setup-time behaviour.
2885
+ """
2886
+ @DERIV_CACHE.setter
2887
+ def DERIV_CACHE(self, arg0: OCFESLV.Options.DerivCacheType) -> None:
2888
+ ...
2889
+ @property
2890
+ def DISPLAY_LEVEL(self) -> int:
2891
+ """
2892
+ Solver-side verbosity, independent of the inherited DISPLAY_LEVEL: the model reports its plan, claims and classification, the solver its iterations, factorisation and marching. The default, -1, follows the model's DISPLAY_LEVEL, resolved each time it is read (so a driver may set DISPLAY_LEVEL after construction); set it in code to make the two differ. Not an environment knob. MAXTHREAD is deliberately not duplicated -- it is a process-global RAII cap.
2893
+ """
2894
+ @DISPLAY_LEVEL.setter
2895
+ def DISPLAY_LEVEL(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
2896
+ ...
2897
+ @property
2898
+ def EQUILIBRATE(self) -> bool:
2899
+ """
2900
+ row/col inf-norm equilibration (true)
2901
+ """
2902
+ @EQUILIBRATE.setter
2903
+ def EQUILIBRATE(self, arg0: bool) -> None:
2904
+ ...
2905
+ @property
2906
+ def FACTORIZATION(self) -> OCFESLV.Options.SolveFactorization:
2907
+ """
2908
+ linear backend (default SOLVE_SUPERLU; see note)
2909
+ """
2910
+ @FACTORIZATION.setter
2911
+ def FACTORIZATION(self, arg0: OCFESLV.Options.SolveFactorization) -> None:
2912
+ ...
2913
+ @property
2914
+ def LAMBDA0(self) -> float:
2915
+ """
2916
+ initial LM damping (1e-8)
2917
+ """
2918
+ @LAMBDA0.setter
2919
+ def LAMBDA0(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2920
+ ...
2921
+ @property
2922
+ def LAMBDA_DROP(self) -> float:
2923
+ """
2924
+ lambda *= this on an accepted LM step (0.25)
2925
+ """
2926
+ @LAMBDA_DROP.setter
2927
+ def LAMBDA_DROP(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2928
+ ...
2929
+ @property
2930
+ def LAMBDA_MIN(self) -> float:
2931
+ """
2932
+ lambda floor (1e-14)
2933
+ """
2934
+ @LAMBDA_MIN.setter
2935
+ def LAMBDA_MIN(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2936
+ ...
2937
+ @property
2938
+ def LAMBDA_RAISE(self) -> float:
2939
+ """
2940
+ lambda *= this on a failed factorization/step (10.0)
2941
+ """
2942
+ @LAMBDA_RAISE.setter
2943
+ def LAMBDA_RAISE(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2944
+ ...
2945
+ @property
2946
+ def LINEAR_EVAL_CACHE(self) -> OCFESLV.Options.LinearEvalCacheType:
2947
+ """
2948
+ Linear residual cache policy. When enabled, purely linear rows are evaluated by a cached sparse affine map r = A z + b whenever the supplied constants match the setup constants. Nonlinear rows and changing constants fall back to normal OCVar evaluation.
2949
+ """
2950
+ @LINEAR_EVAL_CACHE.setter
2951
+ def LINEAR_EVAL_CACHE(self, arg0: OCFESLV.Options.LinearEvalCacheType) -> None:
2952
+ ...
2953
+ @property
2954
+ def LS_MAX(self) -> int:
2955
+ """
2956
+ backtracking line-search steps (24)
2957
+ """
2958
+ @LS_MAX.setter
2959
+ def LS_MAX(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
2960
+ ...
2961
+ @property
2962
+ def MARCHING(self) -> bool:
2963
+ """
2964
+ auto-march when AVAILABLE (evolution domain + >=1 differential state); else monolithic (default true)
2965
+ """
2966
+ @MARCHING.setter
2967
+ def MARCHING(self, arg0: bool) -> None:
2968
+ ...
2969
+ @property
2970
+ def MAX_ITER(self) -> int:
2971
+ """
2972
+ @name Internal nonlinear-solve (LM/Newton) controls — see OCFESLV::solve(). Defaults reproduce the legacy driver harness numerics. @{ max LM/Newton iterations (30)
2973
+ """
2974
+ @MAX_ITER.setter
2975
+ def MAX_ITER(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
2976
+ ...
2977
+ @property
2978
+ def RES_TOL(self) -> float:
2979
+ """
2980
+ accept on max|r| (1e-9)
2981
+ """
2982
+ @RES_TOL.setter
2983
+ def RES_TOL(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
2984
+ ...
2985
+ @property
2986
+ def REUSE(self) -> bool:
2987
+ """
2988
+ reuse last converged monolithic solution at the same input (default true)
2989
+ """
2990
+ @REUSE.setter
2991
+ def REUSE(self, arg0: bool) -> None:
2992
+ ...
2993
+ @property
2994
+ def VERBOSE(self) -> bool:
2995
+ """
2996
+ per-iteration LM/Newton trace to stdout (true)
2997
+ """
2998
+ @VERBOSE.setter
2999
+ def VERBOSE(self, arg0: bool) -> None:
3000
+ ...
3001
+ @property
3002
+ def WARMSTART(self) -> OCFESLV.Options.SolveWarmstart:
3003
+ """
3004
+ per-element warm-start strategy for a SOLVE.MARCHING solve (default REUSE)
3005
+ """
3006
+ @WARMSTART.setter
3007
+ def WARMSTART(self, arg0: OCFESLV.Options.SolveWarmstart) -> None:
3008
+ ...
3009
+ class t_Output:
3010
+ """
3011
+ What the solver retains and emits after a solve.
3012
+ """
3013
+ def __init__(self) -> None:
3014
+ ...
3015
+ @property
3016
+ def GRID_POLICY(self) -> OCFESLV.Options.OutputGridPolicy:
3017
+ """
3018
+ Grid policy for distributed post-evaluation outputs only. OUT_ELEMENT_LOCAL keeps one output row per element-local collocation coefficient, including duplicate physical interface points for LGL/CGL. OUT_UNIQUE_PHYSICAL skips the duplicate left trace of every non-first LGL/CGL element in distributed output dimensions. Equations, states, node_colloc(), interface/SAT handling and scalar point outputs remain element-local.
3019
+ """
3020
+ @GRID_POLICY.setter
3021
+ def GRID_POLICY(self, arg0: OCFESLV.Options.OutputGridPolicy) -> None:
3022
+ ...
3023
+ @property
3024
+ def MARCH_STORE(self) -> bool:
3025
+ """
3026
+ SOLVE.MARCHING: keep each element's block solution (O(N)) for plotting/inspection via march_trajectory()/eval_solution() (default true)
3027
+ """
3028
+ @MARCH_STORE.setter
3029
+ def MARCH_STORE(self, arg0: bool) -> None:
3030
+ ...
3031
+ class t_Audit:
3032
+ """
3033
+ Reports that diagnose the user's MODEL. They change what is printed, never the result.
3034
+ """
3035
+ def __init__(self) -> None:
3036
+ ...
3037
+ @property
3038
+ def COVERAGE(self) -> bool:
3039
+ """
3040
+ print the structural column-coverage report and the claim census at the end of setup() (false). Setup-time only: no solve, no SVD. A state column covered by NO row is a free degree of freedom; singly-covered columns are the fragility margin. Necessary, not sufficient -- see the method doc. Environment default: CRONOS_AUDIT_COVERAGE, else CRONOS_AUDIT.
3041
+ """
3042
+ @COVERAGE.setter
3043
+ def COVERAGE(self, arg0: bool) -> None:
3044
+ ...
3045
+ @property
3046
+ def EQN_LEGEND(self) -> bool:
3047
+ """
3048
+ print the eN -> equation legend (roles, bare states, partial orders per direction) at the end of setup() (false). Printed unconditionally at the head of a spectrum audit regardless of this flag. The legend is what makes an audit's "by eqn eN" resolvable against the model, and its `partials` column identifies the assembled formulation independently of any banner. Environment default: CRONOS_AUDIT_LEGEND, else CRONOS_AUDIT.
3049
+ """
3050
+ @EQN_LEGEND.setter
3051
+ def EQN_LEGEND(self, arg0: bool) -> None:
3052
+ ...
3053
+ @property
3054
+ def RANK_SYMMETRY(self) -> bool:
3055
+ """
3056
+ print the saddle-point rank-symmetry report at the end of setup(): rank of the multiplier column block B against rank of the continuity row block C. rank(B) < n_trace_var makes the augmented system singular for ANY C and cannot be repaired by dropping or pinning rows. Environment default: CRONOS_AUDIT_RANK, else CRONOS_AUDIT.
3057
+ """
3058
+ @RANK_SYMMETRY.setter
3059
+ def RANK_SYMMETRY(self, arg0: bool) -> None:
3060
+ ...
3061
+ @property
3062
+ def SPECTRUM(self) -> bool:
3063
+ """
3064
+ run the singular-value / left+right null-space audit at iteration 0 of every solve(), not only when tier-0 Newton is found singular (false). Needed to compare a CONVERGING run against a failing one: the historical trigger fired only on failure, so a wrong-but-converged solve was never audited. Environment default: CRONOS_AUDIT_SPECTRUM (NOT implied by CRONOS_AUDIT).
3065
+ """
3066
+ @SPECTRUM.setter
3067
+ def SPECTRUM(self, arg0: bool) -> None:
3068
+ ...
3069
+ @property
3070
+ def SPECTRUM_MAX(self) -> int:
3071
+ """
3072
+ largest dense-SVD the spectrum audit will attempt, in either dimension. Was a hard literal 3000, which put `rel` out of reach on exactly the configurations where the question lives (MMPDE13 at production order reaches the limit by NEL_T=4). Cost is O(n^3): 3000 is seconds, 6000 a few minutes. Environment: CRONOS_SPECTRUM_MAX.
3073
+ """
3074
+ @SPECTRUM_MAX.setter
3075
+ def SPECTRUM_MAX(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
3076
+ ...
3077
+ class t_Determinacy:
3078
+ """
3079
+ The numerical-rank determinacy audit run at the end of setup().
3080
+ """
3081
+ def __init__(self) -> None:
3082
+ ...
3083
+ @property
3084
+ def AUDIT(self) -> bool:
3085
+ """
3086
+ run the numerical-rank determinacy audit at the end of setup() (false). One report line per audited window, unconditional on DISPLAY_LEVEL. Environment: CRONOS_AUDIT_DETERMINACY.
3087
+ """
3088
+ @AUDIT.setter
3089
+ def AUDIT(self, arg0: bool) -> None:
3090
+ ...
3091
+ @property
3092
+ def BACKEND(self) -> OCFESLV.Options.DETERMINACY_BACKEND_T:
3093
+ """
3094
+ rank backend: DET_AUTO = SPQR if built, else Eigen if built, else dense under the cap. Values: AUTO|SPQR|EIGEN|DENSE. An explicit DET_SPQR / DET_EIGEN in a build without that backend is REFUSED by setup() (BACKEND_UNAVAILABLE) -- it used to skip the check silently.
3095
+ """
3096
+ @BACKEND.setter
3097
+ def BACKEND(self, arg0: OCFESLV.Options.DETERMINACY_BACKEND_T) -> None:
3098
+ ...
3099
+ @property
3100
+ def TOL(self) -> float:
3101
+ """
3102
+ the SINGLE relative rank tolerance, applied identically to rank(M) and rank([B;D]) (1e-12; the value the spectrum audit's rank_deficiency[] uses).
3103
+ """
3104
+ @TOL.setter
3105
+ def TOL(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
3106
+ ...
3107
+ class t_Sensitivity:
3108
+ """
3109
+ The linear solve inside the forward/adjoint sensitivity computation.
3110
+ """
3111
+ def __init__(self) -> None:
3112
+ ...
3113
+ @property
3114
+ def SPARSE(self) -> bool:
3115
+ """
3116
+ assemble the sensitivity Jacobian SPARSELY and solve with arma::spsolve (SuperLU) instead of a dense arma::mat + arma::lu. WHY. The dense Jacobian is ~2.6 GB at 18202^2 and O(n^3) to factorise -- a scalability wall INDEPENDENT of the singularity question, and one that affects IC_WEAK fixed-mesh models too. It has simply not bitten yet because every fsens/asens driver in the corpus is small. The primal path has been sparse throughout. WHAT IT DOES NOT DO. Sparse LU is still LU. It does NOT make the interface-augmented systems that fail today succeed -- it reports the same singularity, though it fails cleanly (SuperLU throws) instead of falling into a dense approximate solve that does not terminate usefully. That is better DIAGNOSABILITY, not better capability. Reliability is tier 1 (SPQR). This is TIER 0 of the eventual design, mirroring the primal: SuperLU normally, rank-revealing QR when nTrace > 0. Default ON; set false for the dense path.
3117
+ """
3118
+ @SPARSE.setter
3119
+ def SPARSE(self, arg0: bool) -> None:
3120
+ ...
3121
+ class t_Homotopy:
3122
+ """
3123
+ Continuation in the parameters registered with add_homotopy().
3124
+ """
3125
+ def __init__(self) -> None:
3126
+ ...
3127
+ @property
3128
+ def AUTO_DESTAGE(self) -> bool:
3129
+ """
3130
+ when a multi-parameter stage fails, split it into sequential single-parameter sub-stages from the point it reached, rather than giving up (true). Announced LOUDLY on stderr and recorded in StageReport::destaged: needing it usually says something about the MODEL -- those parameters interact too strongly to move together -- so it should be noticed, not silently absorbed.
3131
+ """
3132
+ @AUTO_DESTAGE.setter
3133
+ def AUTO_DESTAGE(self, arg0: bool) -> None:
3134
+ ...
3135
+ @property
3136
+ def ENABLE(self) -> bool:
3137
+ """
3138
+ honour homotopy parameters registered with add_homotopy() (true). When false the schedule is IGNORED and solve() runs directly at the current input values -- useful for with/without contrast runs without unregistering the model's parameters.
3139
+ """
3140
+ @ENABLE.setter
3141
+ def ENABLE(self, arg0: bool) -> None:
3142
+ ...
3143
+ @property
3144
+ def PREDICT(self) -> bool:
3145
+ """
3146
+ guarded extrapolation predictor (true)
3147
+ """
3148
+ @PREDICT.setter
3149
+ def PREDICT(self, arg0: bool) -> None:
3150
+ ...
3151
+ @property
3152
+ def PREDICT_ORDER(self) -> int:
3153
+ """
3154
+ max order of the extrapolation from accepted points (2). 0 = plain reuse, 1 = secant (2 points), 2 = quadratic (3 points). Every candidate up to this order is TRIED and the smallest-residual one is kept, so raising it can only help: a worse extrapolation is discarded for the price of one residual evaluation. NOTE a TANGENT predictor is deliberately ABSENT. It is redundant with the corrector's first Newton step: at a converged x(s) with the parameters moved to s+ds, r(x,p(s+ds)) ~ ds*dr/ds, so the first Newton step is -J^-1 r ~ ds*dx/ds -- the tangent itself. Computing it explicitly would cost a Jacobian and a factorization to save the very iteration that produces it. Extrapolation from already-accepted points needs neither.
3155
+ """
3156
+ @PREDICT_ORDER.setter
3157
+ def PREDICT_ORDER(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
3158
+ ...
3159
+ @property
3160
+ def STEP_CAP(self) -> float:
3161
+ """
3162
+ max homotopy step in s, and the step the ramp STARTS at (0.1). PATH FIDELITY KNOB, and the one that matters: a converged step is NOT evidence of correctness -- too large a cap can move the corrector onto a different solution branch with no warning.
3163
+ """
3164
+ @STEP_CAP.setter
3165
+ def STEP_CAP(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
3166
+ ...
3167
+ @property
3168
+ def STEP_GROW(self) -> float:
3169
+ """
3170
+ step growth after an accepted step (1.4). Only acts as the RECOVERY rate after a backtrack, since the ramp starts at the cap.
3171
+ """
3172
+ @STEP_GROW.setter
3173
+ def STEP_GROW(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
3174
+ ...
3175
+ @property
3176
+ def STEP_MIN(self) -> float:
3177
+ """
3178
+ abandon stage below this step (1e-5)
3179
+ """
3180
+ @STEP_MIN.setter
3181
+ def STEP_MIN(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
3182
+ ...
3183
+ @property
3184
+ def STEP_SHRINK(self) -> float:
3185
+ """
3186
+ step shrink after a failed step (0.5). *** REQUIRED: HOMOTOPY.STEP_GROW * HOMOTOPY.STEP_SHRINK < 1. *** Otherwise a step near the critical size alternates fail/succeed forever (shrink then grow returns it above the failing value), wasting one solve per accepted step. The asymmetry -- shrink fast, grow slowly -- is what makes the step ratchet down and settle.
3187
+ """
3188
+ @STEP_SHRINK.setter
3189
+ def STEP_SHRINK(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
3190
+ ...
3191
+ class t_Fatal:
3192
+ """
3193
+ Which conditions make setup() FAIL rather than warn.
3194
+ """
3195
+ def __init__(self) -> None:
3196
+ ...
3197
+ @property
3198
+ def DETERMINACY(self) -> bool:
3199
+ """
3200
+ setup() returns false (SetupStatus::DETERMINACY_UNDETERMINED) on a STATE CONTENT verdict (false).
3201
+ """
3202
+ @DETERMINACY.setter
3203
+ def DETERMINACY(self, arg0: bool) -> None:
3204
+ ...
3205
+ @property
3206
+ def EVOLUTION_DOMAIN(self) -> bool:
3207
+ """
3208
+ setup() returns false on an unsuitable evolution domain or an IC that cannot be set consistently (true); false (default) downgrades to a DISPLAY_LEVEL warning and proceeds
3209
+ """
3210
+ @EVOLUTION_DOMAIN.setter
3211
+ def EVOLUTION_DOMAIN(self, arg0: bool) -> None:
3212
+ ...
3213
+ @property
3214
+ def INTERFACE_RANK(self) -> bool:
3215
+ """
3216
+ setup() returns false (INTERFACE_PLAN_INVALID) when the multiplier block B is column rank-deficient. Default FALSE: the resulting kernel is singular but not always fatal (a model whose residual satisfies the compatibility conditions still converges), so this stays opt-in until the corpus has been re-baselined.
3217
+ """
3218
+ @INTERFACE_RANK.setter
3219
+ def INTERFACE_RANK(self, arg0: bool) -> None:
3220
+ ...
3221
+ @property
3222
+ def REDUCED_DOF(self) -> bool:
3223
+ """
3224
+ setup() returns false on a structurally IC/BC-inconsistent reduced system (true); false downgrades to a warning and proceeds (rank-revealing solve)
3225
+ """
3226
+ @REDUCED_DOF.setter
3227
+ def REDUCED_DOF(self, arg0: bool) -> None:
3228
+ ...
3229
+ BROADCAST_IC: typing.ClassVar[OCFESLV.Options.SolveWarmstart]
3230
+ DERIV_EAGER: typing.ClassVar[OCFESLV.Options.DerivCacheType]
3231
+ DERIV_LAZY: typing.ClassVar[OCFESLV.Options.DerivCacheType]
3232
+ DET_AUTO: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
3233
+ DET_DENSE: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
3234
+ DET_EIGEN: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
3235
+ DET_SPQR: typing.ClassVar[OCFESLV.Options.DETERMINACY_BACKEND_T]
3236
+ DROP_OFF: typing.ClassVar[OCFESLV.Options.InterfaceDropPolicy]
3237
+ DROP_REDERIVE: typing.ClassVar[OCFESLV.Options.InterfaceDropPolicy]
3238
+ DROP_VERIFY: typing.ClassVar[OCFESLV.Options.InterfaceDropPolicy]
3239
+ EXTRAPOLATE: typing.ClassVar[OCFESLV.Options.SolveWarmstart]
3240
+ IC_AUTO: typing.ClassVar[OCFESLV.Options.InterfaceType]
3241
+ IC_FLUX: typing.ClassVar[OCFESLV.Options.InterfaceType]
3242
+ IC_STRONG: typing.ClassVar[OCFESLV.Options.ImpositionType]
3243
+ IC_TRACE: typing.ClassVar[OCFESLV.Options.ImpositionType]
3244
+ IC_UPWIND: typing.ClassVar[OCFESLV.Options.InterfaceType]
3245
+ IC_VALUE: typing.ClassVar[OCFESLV.Options.InterfaceType]
3246
+ IC_WEAK: typing.ClassVar[OCFESLV.Options.ImpositionType]
3247
+ LINEAR_EAGER: typing.ClassVar[OCFESLV.Options.LinearEvalCacheType]
3248
+ LINEAR_LAZY: typing.ClassVar[OCFESLV.Options.LinearEvalCacheType]
3249
+ LINEAR_NONE: typing.ClassVar[OCFESLV.Options.LinearEvalCacheType]
3250
+ OUT_ELEMENT_LOCAL: typing.ClassVar[OCFESLV.Options.OutputGridPolicy]
3251
+ OUT_UNIQUE_PHYSICAL: typing.ClassVar[OCFESLV.Options.OutputGridPolicy]
3252
+ REUSE: typing.ClassVar[OCFESLV.Options.SolveWarmstart]
3253
+ SOLVE_LAPACK: typing.ClassVar[OCFESLV.Options.SolveFactorization]
3254
+ SOLVE_SPQR: typing.ClassVar[OCFESLV.Options.SolveFactorization]
3255
+ SOLVE_SUPERLU: typing.ClassVar[OCFESLV.Options.SolveFactorization]
3256
+ @typing.overload
3257
+ def __init__(self) -> None:
3258
+ ...
3259
+ @typing.overload
3260
+ def __init__(self, arg0: OCFESLV.Options) -> None:
3261
+ ...
3262
+ @property
3263
+ def AUDIT(self) -> OCFESLV.Options.t_Audit:
3264
+ """
3265
+ Reports that diagnose the user's MODEL. They change what is printed, never the result.
3266
+ """
3267
+ @AUDIT.setter
3268
+ def AUDIT(self, arg0: OCFESLV.Options.t_Audit) -> None:
3269
+ ...
3270
+ @property
3271
+ def DETERMINACY(self) -> OCFESLV.Options.t_Determinacy:
3272
+ """
3273
+ The numerical-rank determinacy audit run at the end of setup().
3274
+ """
3275
+ @DETERMINACY.setter
3276
+ def DETERMINACY(self, arg0: OCFESLV.Options.t_Determinacy) -> None:
3277
+ ...
3278
+ @property
3279
+ def FATAL(self) -> OCFESLV.Options.t_Fatal:
3280
+ """
3281
+ Which conditions make setup() FAIL rather than warn.
3282
+ """
3283
+ @FATAL.setter
3284
+ def FATAL(self, arg0: OCFESLV.Options.t_Fatal) -> None:
3285
+ ...
3286
+ @property
3287
+ def HOMOTOPY(self) -> OCFESLV.Options.t_Homotopy:
3288
+ """
3289
+ Continuation in the parameters registered with add_homotopy().
3290
+ """
3291
+ @HOMOTOPY.setter
3292
+ def HOMOTOPY(self, arg0: OCFESLV.Options.t_Homotopy) -> None:
3293
+ ...
3294
+ @property
3295
+ def INTERFACE(self) -> OCFESLV.Options.t_Interface:
3296
+ """
3297
+ How continuity between elements is expressed and imposed: the condition type, the imposition (penalty, trace multiplier, strong), SAT penalties and trace-multiplier scaling.
3298
+ """
3299
+ @INTERFACE.setter
3300
+ def INTERFACE(self, arg0: OCFESLV.Options.t_Interface) -> None:
3301
+ ...
3302
+ @property
3303
+ def OUTPUT(self) -> OCFESLV.Options.t_Output:
3304
+ """
3305
+ What the solver retains and emits after a solve.
3306
+ """
3307
+ @OUTPUT.setter
3308
+ def OUTPUT(self, arg0: OCFESLV.Options.t_Output) -> None:
3309
+ ...
3310
+ @property
3311
+ def SENSITIVITY(self) -> OCFESLV.Options.t_Sensitivity:
3312
+ """
3313
+ The linear solve inside the forward/adjoint sensitivity computation.
3314
+ """
3315
+ @SENSITIVITY.setter
3316
+ def SENSITIVITY(self, arg0: OCFESLV.Options.t_Sensitivity) -> None:
3317
+ ...
3318
+ @property
3319
+ def SOLVE(self) -> OCFESLV.Options.t_Solve:
3320
+ """
3321
+ The nonlinear solve: Newton/Levenberg-Marquardt control, linear backend, marching, reuse, evaluation caches, and the solver's own verbosity.
3322
+ """
3323
+ @SOLVE.setter
3324
+ def SOLVE(self, arg0: OCFESLV.Options.t_Solve) -> None:
3325
+ ...
3326
+ class EqnOptions(FFModel.EqnOptions):
3327
+ """
3328
+ Options of one equation for OCFESLV: the model options (role, block) and the
3329
+ local interface-condition settings.
3330
+ """
3331
+ @typing.overload
3332
+ def __init__(self, role: FFModel.EqnRole = ..., block_id: typing.SupportsInt | typing.SupportsIndex = 0, interface_type: OCFESLV.Options.InterfaceType = ...) -> None:
3333
+ """
3334
+ Options with role-derived defaults.
3335
+ """
3336
+ @typing.overload
3337
+ def __init__(self, role: FFModel.EqnRole, block_id: typing.SupportsInt | typing.SupportsIndex, interface_type: OCFESLV.Options.InterfaceType, classify: bool, sat: bool, donate: bool = False) -> None:
3338
+ """
3339
+ Options with explicit flags (the role invariants still apply: an INTERFACE row
3340
+ never enters classification).
3341
+ """
3342
+ @property
3343
+ def donate_for_state_continuity(self) -> bool:
3344
+ """
3345
+ may be donated as a duplicate trace row
3346
+ """
3347
+ @donate_for_state_continuity.setter
3348
+ def donate_for_state_continuity(self, arg0: bool) -> None:
3349
+ ...
3350
+ @property
3351
+ def interface_type(self) -> OCFESLV.Options.InterfaceType:
3352
+ """
3353
+ local interface-condition type (IC_AUTO: resolved)
3354
+ """
3355
+ @interface_type.setter
3356
+ def interface_type(self, arg0: OCFESLV.Options.InterfaceType) -> None:
3357
+ ...
3358
+ @property
3359
+ def receive_sat(self) -> bool:
3360
+ """
3361
+ may receive weak (SAT) interface penalties
3362
+ """
3363
+ @receive_sat.setter
3364
+ def receive_sat(self, arg0: bool) -> None:
3365
+ ...
3366
+ @staticmethod
3367
+ def revision() -> str:
3368
+ """
3369
+ The revision of the solver (ocfeslv.hpp). FFModel.revision() gives the model
3370
+ layer's, which a build may combine with another solver revision.
3371
+ """
3372
+ def __init__(self, dag: pymcpp.FFGraph) -> None:
3373
+ """
3374
+ Empty solver and model on the DAG ``dag`` (kept alive by it).
3375
+ """
3376
+ def blk_fct(self, ndx: typing.SupportsInt | typing.SupportsIndex) -> tuple[int, int]:
3377
+ """
3378
+ The block of output ``ndx`` (in add_output() order) in ``val_functions()``:
3379
+ ``(first, count)`` -- one value for a point output, one per selected node for
3380
+ a distributed output.
3381
+ """
3382
+ def decode_controls(self, p: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], inp: typing.Any) -> None:
3383
+ """
3384
+ Write the control DOF values ``p`` into ``inp`` (in place).
3385
+ """
3386
+ def encode_controls(self, inp: typing.Any) -> list[float]:
3387
+ """
3388
+ The control DOF values held in ``inp``, in the order of the gradient columns.
3389
+ """
3390
+ def eval_solution(self, state: pymcpp.FFVar, point: collections.abc.Mapping[pymcpp.FFVar, typing.SupportsFloat | typing.SupportsIndex]) -> float:
3391
+ """
3392
+ Value of ``state`` at ``point`` (a dict ``{domain: coordinate}``) in the last
3393
+ converged solution, in EITHER solve mode: the cached primal of a monolithic
3394
+ solve (``options.SOLVE.REUSE``) or the stored windows of a marching solve
3395
+ (``options.OUTPUT.MARCH_STORE``) -- both on by default.
3396
+ """
3397
+ def get_input_values(self, input: pymcpp.FFVar, inp: typing.Any) -> list[float]:
3398
+ """
3399
+ The collocated values of input ``input`` in ``inp``.
3400
+ """
3401
+ def init(self, cst: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | None = None) -> tuple[numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64]]:
3402
+ """
3403
+ The collocation vectors after ``setup()``: ``(var, inp)`` as NumPy arrays --
3404
+ ``var`` the state coefficients initialised from the references, ``inp`` the
3405
+ input coefficients initialised from the input references.
3406
+
3407
+ Parameters
3408
+ ----------
3409
+ cst : list of float, optional
3410
+ Constant values, in the order of ``var_constant``.
3411
+ """
3412
+ def is_marching(self) -> bool:
3413
+ """
3414
+ True if the model is solved by marching.
3415
+ """
3416
+ def march_grid(self) -> list[float]:
3417
+ """
3418
+ The window boundaries of the march (empty for a monolithic setup).
3419
+ """
3420
+ def march_trajectory(self) -> list:
3421
+ """
3422
+ The stored windows of the last marching solve
3423
+ (``options.OUTPUT.MARCH_STORE``): one dict per window with ``t0``, ``t1`` and
3424
+ the window's collocated ``var`` and ``inp`` (NumPy arrays).
3425
+ """
3426
+ def n_colloc_eqn(self) -> int:
3427
+ """
3428
+ Number of collocation equation residuals.
3429
+ """
3430
+ def n_colloc_fct(self) -> int:
3431
+ """
3432
+ Number of scalar output functions.
3433
+ """
3434
+ def n_colloc_inp(self) -> int:
3435
+ """
3436
+ Size of ``inp``: collocation input coefficients.
3437
+ """
3438
+ def n_colloc_sta(self) -> int:
3439
+ """
3440
+ Size of ``var``: collocation state coefficients.
3441
+ """
3442
+ def n_colloc_trace(self) -> int:
3443
+ """
3444
+ Number of trace variables (0 under IC_STRONG).
3445
+ """
3446
+ def n_march_steps(self) -> int:
3447
+ """
3448
+ Number of march steps.
3449
+ """
3450
+ def node_colloc(self, var: pymcpp.FFVar) -> list[list[float]]:
3451
+ """
3452
+ The collocation node coordinates of state or input ``var``.
3453
+ """
3454
+ def sample_input(self, input: pymcpp.FFVar, fun: collections.abc.Callable[[collections.abc.Mapping[pymcpp.FFVar, typing.SupportsFloat | typing.SupportsIndex]], float], inp: typing.Any) -> None:
3455
+ """
3456
+ Write input ``input`` into ``inp`` (in place) from a function ``fun({domain:
3457
+ coordinate}) -> float`` evaluated at its collocation nodes.
3458
+ """
3459
+ def sens_functions(self) -> list[float]:
3460
+ """
3461
+ Output values captured by the last solve_fsens / solve_asens.
3462
+ """
3463
+ def sens_jacobian(self) -> numpy.typing.NDArray[numpy.float64]:
3464
+ """
3465
+ Jacobian of the outputs with respect to the control DOFs, captured by the last
3466
+ solve_fsens / solve_asens: NumPy array of shape (nf, n_control_dof), columns
3467
+ in the order of the registered controls and their ``control_dofs``.
3468
+ """
3469
+ def set_input_values(self, input: pymcpp.FFVar, values: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], inp: typing.Any) -> None:
3470
+ """
3471
+ Write the collocated values of input ``input`` into ``inp`` (in place):
3472
+ element-major, node-inner, as ``get_input_values`` reads them.
3473
+ """
3474
+ def solve(self, var: typing.Any, inp: typing.Any = None, cst: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | None = None) -> OCFESLV.SolveReport:
3475
+ """
3476
+ Solve the collocation system; returns a SolveReport.
3477
+
3478
+ Parameters
3479
+ ----------
3480
+ var : numpy.ndarray
3481
+ Collocation state coefficients (float64, size ``n_colloc_sta()``): the
3482
+ initial guess, overwritten IN PLACE with the solution.
3483
+ inp : numpy.ndarray, optional
3484
+ Collocation input coefficients (float64, size ``n_colloc_inp()``), e.g.
3485
+ from ``init`` and ``set_input_values``.
3486
+ cst : list of float, optional
3487
+ Constant values, in the order of ``var_constant``.
3488
+ """
3489
+ def solve_asens(self, var: typing.Any, inp: typing.Any = None, cst: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | None = None) -> bool:
3490
+ """
3491
+ Solve, then the adjoint sensitivities of the outputs with respect to the registered controls (``sens_jacobian``); returns True on success.
3492
+
3493
+ Parameters
3494
+ ----------
3495
+ var : numpy.ndarray
3496
+ Collocation state coefficients (float64, size ``n_colloc_sta()``): the
3497
+ initial guess, overwritten IN PLACE with the solution.
3498
+ inp : numpy.ndarray, optional
3499
+ Collocation input coefficients (float64, size ``n_colloc_inp()``), e.g.
3500
+ from ``init`` and ``set_input_values``.
3501
+ cst : list of float, optional
3502
+ Constant values, in the order of ``var_constant``.
3503
+ """
3504
+ def solve_fsens(self, var: typing.Any, inp: typing.Any = None, cst: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] | None = None) -> bool:
3505
+ """
3506
+ Solve, then the forward sensitivities of the outputs with respect to the registered controls (``sens_jacobian``); returns True on success.
3507
+
3508
+ Parameters
3509
+ ----------
3510
+ var : numpy.ndarray
3511
+ Collocation state coefficients (float64, size ``n_colloc_sta()``): the
3512
+ initial guess, overwritten IN PLACE with the solution.
3513
+ inp : numpy.ndarray, optional
3514
+ Collocation input coefficients (float64, size ``n_colloc_inp()``), e.g.
3515
+ from ``init`` and ``set_input_values``.
3516
+ cst : list of float, optional
3517
+ Constant values, in the order of ``var_constant``.
3518
+ """
3519
+ def val_functions(self) -> list[float]:
3520
+ """
3521
+ Output values after the last solve.
3522
+ """
3523
+ @property
3524
+ def options(self) -> OCFESLV.Options:
3525
+ """
3526
+ Solver options (model and collocation); transferred at ``setup()``.
3527
+ """
3528
+ @options.setter
3529
+ def options(self, arg1: OCFESLV.Options) -> None:
3530
+ ...
3531
+ @property
3532
+ def states_colloc(self) -> list[pymcpp.FFVar]:
3533
+ """
3534
+ The states of the collocation system (after order reduction).
3535
+ """
3536
+ class FFOCFESLV(pymcpp.FFOp):
3537
+ """
3538
+ An OCFESLV solve embedded as an operation of the DAG: its outputs become DAG
3539
+ variables, functions of the DAG variables given for the solver's inputs and
3540
+ constants. Evaluating them solves the collocation system (monolithic or
3541
+ marching); differentiating them (FFGraph ``fdiff`` / ``bdiff``) uses the
3542
+ solver's forward or adjoint sensitivities (``options.GRADIENT``), through
3543
+ FFGradOCFESLV.
3544
+
3545
+ Example -- the outputs of a solver whose inputs are its control ``q`` (one DOF
3546
+ per time element) and a constant ``k``:
3547
+
3548
+ >>> OpOCFE = FFOCFESLV()
3549
+ >>> Q = [G.add_var("Q%d" % i) for i in range(len(S.control_dofs(q)))]
3550
+ >>> K = G.add_var("K")
3551
+ >>> y = OpOCFE({q: Q}, {k: [K]}, S)
3552
+ """
3553
+ class POLICY_TYPE:
3554
+ """
3555
+ Copy policy of the embedded solver.
3556
+
3557
+ Members:
3558
+
3559
+ SHALLOW : Refer to the solver (kept alive as long as the DAG; default)
3560
+
3561
+ COPY : Hold a deep copy of the solver
3562
+
3563
+ TRANSFER : Not available from Python (ownership transfer)
3564
+ """
3565
+ COPY: typing.ClassVar[FFOCFESLV.POLICY_TYPE]
3566
+ SHALLOW: typing.ClassVar[FFOCFESLV.POLICY_TYPE]
3567
+ TRANSFER: typing.ClassVar[FFOCFESLV.POLICY_TYPE]
3568
+ __members__: typing.ClassVar[dict[str, FFOCFESLV.POLICY_TYPE]]
3569
+ def __eq__(self, other: typing.Any) -> bool:
3570
+ ...
3571
+ def __getstate__(self) -> int:
3572
+ ...
3573
+ def __hash__(self) -> int:
3574
+ ...
3575
+ def __index__(self) -> int:
3576
+ ...
3577
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
3578
+ ...
3579
+ def __int__(self) -> int:
3580
+ ...
3581
+ def __ne__(self, other: typing.Any) -> bool:
3582
+ ...
3583
+ def __repr__(self) -> str:
3584
+ ...
3585
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
3586
+ ...
3587
+ def __str__(self) -> str:
3588
+ ...
3589
+ @property
3590
+ def name(self) -> str:
3591
+ ...
3592
+ @property
3593
+ def value(self) -> int:
3594
+ ...
3595
+ class GRADIENT_TYPE:
3596
+ """
3597
+ Reduced-space gradient mode.
3598
+
3599
+ Members:
3600
+
3601
+ FORWARD : One forward-sensitivity solve per control DOF
3602
+
3603
+ ADJOINT : One adjoint solve per output function
3604
+
3605
+ AUTO : ADJOINT when n_control_dof > NP2NF * n_colloc_fct, else FORWARD (default)
3606
+ """
3607
+ ADJOINT: typing.ClassVar[FFOCFESLV.GRADIENT_TYPE]
3608
+ AUTO: typing.ClassVar[FFOCFESLV.GRADIENT_TYPE]
3609
+ FORWARD: typing.ClassVar[FFOCFESLV.GRADIENT_TYPE]
3610
+ __members__: typing.ClassVar[dict[str, FFOCFESLV.GRADIENT_TYPE]]
3611
+ def __eq__(self, other: typing.Any) -> bool:
3612
+ ...
3613
+ def __getstate__(self) -> int:
3614
+ ...
3615
+ def __hash__(self) -> int:
3616
+ ...
3617
+ def __index__(self) -> int:
3618
+ ...
3619
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
3620
+ ...
3621
+ def __int__(self) -> int:
3622
+ ...
3623
+ def __ne__(self, other: typing.Any) -> bool:
3624
+ ...
3625
+ def __repr__(self) -> str:
3626
+ ...
3627
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
3628
+ ...
3629
+ def __str__(self) -> str:
3630
+ ...
3631
+ @property
3632
+ def name(self) -> str:
3633
+ ...
3634
+ @property
3635
+ def value(self) -> int:
3636
+ ...
3637
+ class Options:
3638
+ """
3639
+ Options of FFOCFESLV, FFGradOCFESLV and FFOCFERES, shared by all operations
3640
+ (class-level: ``FFOCFESLV.options``).
3641
+ """
3642
+ @property
3643
+ def GRADIENT(self) -> int:
3644
+ """
3645
+ Reduced-space gradient mode: FFOCFESLV.FORWARD, ADJOINT or AUTO.
3646
+ """
3647
+ @GRADIENT.setter
3648
+ def GRADIENT(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None:
3649
+ ...
3650
+ @property
3651
+ def NP2NF(self) -> float:
3652
+ """
3653
+ Control-to-output ratio above which AUTO uses adjoint sensitivities.
3654
+ """
3655
+ @NP2NF.setter
3656
+ def NP2NF(self, arg0: typing.SupportsFloat | typing.SupportsIndex) -> None:
3657
+ ...
3658
+ @property
3659
+ def SYMDIFF(self) -> list[pymcpp.FFVar]:
3660
+ """
3661
+ Inputs or constants of the operation differentiated SYMBOLICALLY; the others
3662
+ numerically (sensitivities).
3663
+ """
3664
+ @SYMDIFF.setter
3665
+ def SYMDIFF(self, arg0: collections.abc.Sequence[pymcpp.FFVar]) -> None:
3666
+ ...
3667
+ ADJOINT: typing.ClassVar[FFOCFESLV.GRADIENT_TYPE]
3668
+ AUTO: typing.ClassVar[FFOCFESLV.GRADIENT_TYPE]
3669
+ COPY: typing.ClassVar[FFOCFESLV.POLICY_TYPE]
3670
+ FORWARD: typing.ClassVar[FFOCFESLV.GRADIENT_TYPE]
3671
+ SHALLOW: typing.ClassVar[FFOCFESLV.POLICY_TYPE]
3672
+ TRANSFER: typing.ClassVar[FFOCFESLV.POLICY_TYPE]
3673
+ options: typing.ClassVar[FFOCFESLV.Options]
3674
+ @typing.overload
3675
+ def __call__(self, diff: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], rest: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], solver: OCFESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> list[pymcpp.FFVar]:
3676
+ """
3677
+ TWO-MAP form: the outputs of the solve.
3678
+
3679
+ Parameters
3680
+ ----------
3681
+ diff : dict
3682
+ Map 1: the inputs the numerical gradient is taken with respect to (the
3683
+ controls), in the order of the gradient columns. Each maps to its DOFs as
3684
+ DAG variables: a list in ``control_dofs`` order, or a generator ``gen(dof)
3685
+ -> FFVar``. It resets the solver's control registry to exactly these
3686
+ inputs.
3687
+ rest : dict
3688
+ Map 2: every other declared input and every constant (one variable each),
3689
+ whose values pass through the DAG with zero numerical derivative.
3690
+ solver : OCFESLV
3691
+ The solver (set up). Under SHALLOW (default) the operation refers to
3692
+ ``solver``, which is then kept alive as long as the DAG; under COPY it
3693
+ holds its own copy.
3694
+ policy : FFOCFESLV.POLICY_TYPE, optional
3695
+ SHALLOW (default) or COPY.
3696
+ name : str, optional
3697
+ Name of the operation in the DAG.
3698
+ """
3699
+ @typing.overload
3700
+ def __call__(self, diff: dict[pymcpp.FFVar, collections.abc.Sequence[pymcpp.FFVar] | collections.abc.Callable[[FFModel.DofIndex], pymcpp.FFVar]], solver: OCFESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> list[pymcpp.FFVar]:
3701
+ """
3702
+ ONE-MAP form: every declared input is differentiated and the model has no
3703
+ constant (refused, naming what is missing, otherwise). Arguments as the
3704
+ two-map form.
3705
+ """
3706
+ def __init__(self) -> None:
3707
+ """
3708
+ Default constructor.
3709
+ """
3710
+ class FFGradOCFESLV(pymcpp.FFOp):
3711
+ """
3712
+ The derivative operation of FFOCFESLV, created when an FFOCFESLV output is
3713
+ differentiated (FFGraph ``fdiff`` / ``bdiff``); not constructed directly.
3714
+ """
3715
+ class FFOCFERES(pymcpp.FFOp):
3716
+ """
3717
+ The collocation system of an OCFESLV as an operation of the DAG: given DAG
3718
+ variables for the collocation state coefficients (``n_colloc_sta()``), the
3719
+ collocation input coefficients (``n_colloc_inp()``) and the constants, its
3720
+ values are the collocation residuals (``n_colloc_eqn()``) followed by the
3721
+ outputs (``n_colloc_fct()``) -- the constraints and objective terms of a
3722
+ full-discretisation formulation. Its derivatives are the sparse collocation
3723
+ Jacobian, through FFGradOCFERES.
3724
+ """
3725
+ class POLICY_TYPE:
3726
+ """
3727
+ Copy policy of the embedded solver.
3728
+
3729
+ Members:
3730
+
3731
+ SHALLOW : Refer to the solver (kept alive as long as the DAG)
3732
+
3733
+ COPY : Hold a deep copy of the solver (default)
3734
+
3735
+ TRANSFER : Not available from Python (ownership transfer)
3736
+ """
3737
+ COPY: typing.ClassVar[FFOCFERES.POLICY_TYPE]
3738
+ SHALLOW: typing.ClassVar[FFOCFERES.POLICY_TYPE]
3739
+ TRANSFER: typing.ClassVar[FFOCFERES.POLICY_TYPE]
3740
+ __members__: typing.ClassVar[dict[str, FFOCFERES.POLICY_TYPE]]
3741
+ def __eq__(self, other: typing.Any) -> bool:
3742
+ ...
3743
+ def __getstate__(self) -> int:
3744
+ ...
3745
+ def __hash__(self) -> int:
3746
+ ...
3747
+ def __index__(self) -> int:
3748
+ ...
3749
+ def __init__(self, value: typing.SupportsInt | typing.SupportsIndex) -> None:
3750
+ ...
3751
+ def __int__(self) -> int:
3752
+ ...
3753
+ def __ne__(self, other: typing.Any) -> bool:
3754
+ ...
3755
+ def __repr__(self) -> str:
3756
+ ...
3757
+ def __setstate__(self, state: typing.SupportsInt | typing.SupportsIndex) -> None:
3758
+ ...
3759
+ def __str__(self) -> str:
3760
+ ...
3761
+ @property
3762
+ def name(self) -> str:
3763
+ ...
3764
+ @property
3765
+ def value(self) -> int:
3766
+ ...
3767
+ COPY: typing.ClassVar[FFOCFERES.POLICY_TYPE]
3768
+ SHALLOW: typing.ClassVar[FFOCFERES.POLICY_TYPE]
3769
+ TRANSFER: typing.ClassVar[FFOCFERES.POLICY_TYPE]
3770
+ @typing.overload
3771
+ def __call__(self, sta: collections.abc.Sequence[pymcpp.FFVar], inp: collections.abc.Sequence[pymcpp.FFVar], cst: collections.abc.Sequence[pymcpp.FFVar], solver: OCFESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> list[pymcpp.FFVar]:
3772
+ """
3773
+ The collocation residuals then the outputs, as DAG variables.
3774
+
3775
+ Parameters
3776
+ ----------
3777
+ sta : list of FFVar
3778
+ DAG variables for the collocation state coefficients (``n_colloc_sta()``).
3779
+ inp : list of FFVar
3780
+ DAG variables for the collocation input coefficients (``n_colloc_inp()``).
3781
+ cst : list of FFVar
3782
+ DAG variables for the constants, in the order of ``var_constant``.
3783
+ solver : OCFESLV
3784
+ The solver (set up, monolithic).
3785
+ policy : FFOCFERES.POLICY_TYPE, optional
3786
+ COPY (default) or SHALLOW.
3787
+ name : str, optional
3788
+ Name of the operation in the DAG.
3789
+ """
3790
+ @typing.overload
3791
+ def __call__(self, sta: collections.abc.Sequence[pymcpp.FFVar], inp: collections.abc.Sequence[pymcpp.FFVar], solver: OCFESLV, policy: typing.SupportsInt | typing.SupportsIndex = ..., name: str = '') -> list[pymcpp.FFVar]:
3792
+ """
3793
+ As above, for a model without constants.
3794
+ """
3795
+ def __init__(self) -> None:
3796
+ """
3797
+ Default constructor.
3798
+ """
3799
+ class FFGradOCFERES(pymcpp.FFOp):
3800
+ """
3801
+ The derivative operation of FFOCFERES, created when an FFOCFERES output is
3802
+ differentiated; not constructed directly.
3803
+ """
3804
+ def build_info() -> dict:
3805
+ """
3806
+ Describe this build of CRONOS: ``version``, ``license`` (``"EPL-2.0"``, or ``"GPL-2.0-or-later"`` when the GPL
3807
+ SuiteSparse backends UMFPACK or SPQR are compiled in), ``license_note``, ``backends`` (which linear-algebra backends
3808
+ are compiled in) and ``pymcpp`` (the version of the pymcpp module loaded alongside).
3809
+ """
3810
+ __version__: str = '5.0.0'