You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of implicitness, it can be introspected from the coefficients, which would let us check that there are no misclassifications or typos in coefficients:
classRungeKutta:
defis_implicit(cls):
"""The method is implicit if any coefficient of A's upper triangle is not 0."""returnnp.any(np.triu(cls.A) !=0)
classMultistep:
defis_implicit(cls):
"""The method is implicit if Bn is not 0."""returncls.Bn!=0
In Multistep, IMPLICIT is implemented as a class property.
RungeKutta doesn't have that method, but each of its specializations has a class property (explicit, implicit, diagonally_implicit) which is checked by __init_subclass__.
+1 on having classification done by inspecting the coefficients.
+1 on adding a is_implicit classproperty
-1 on having a explicit, implicit, diagonally_implicit, etc property as provides a non homogeneous API in different solvers. I lke the Implicitness (in certain cases set automatically at __init_class__)
Alternative 1: subclass
and then
and the same for others.
Pros:
Cons:
Alternative 2: enums
(names and members might differ)
In the solver, add the following attributes and classproperties
and the same for others.
Pros:
Cons:
The text was updated successfully, but these errors were encountered: