Replies: 2 comments 2 replies
-
|
Interesting ideas! I agree on prioritising val over jac, although I'm not entirely sure what that implies in your first suggestion? |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
This is been resolved with the introduction of EquationSystem |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hei,
I have some ideas for the
Ad_arrayclass, which would simplify some algorithms (at least for me 😄 )By overloading
Ad_array.__getitem__and
Ad_array.__getslice__we could allow for a more unified treatment of PorePy's custom AD arays and numpy arrays, i.e.
A = Ad_array(some_vector, some_matrix)B = A[1:10]where the slicing would return a row-wise slicing for both value and Jacobian. It would be equivalent to
B = Ad_array(some_vector[1:10], some_matrix[1:10])This is motivated by the fact that PorePy's AD framework vectorizes the DOFs, so row-wise slicing would be DOF-wise slicing.
I am sure this was already discussed at some point, but again motivated by simpler, unified treatment, it would be nice to have logical comparison.
It seems natural to me to provide a comparison for the values of an Ad_array.
A < Bwould be thenA.val < B.val.Why
This would remove many type checks and if clauses in the code, making code compatible for both numpy arrays and Ad_array instances as arguments.
I think its justified to give the
valpriority overjacin both suggestions, considering thatvalsis the numerical representation of whatever quantitiy theAd_arrayrepresents, andjacis kind of "secondary" (if I may say so).Beta Was this translation helpful? Give feedback.
All reactions