-
-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Is your feature request related to a problem? Please describe.
I'd like to use the PositiveDomain callback, but only for a specific subset of u. Specifically, in our case u is a ComponentVector of which only a single variable must not be negative.
Describe the solution you’d like
As stated in the docstring of PositiveDomain, one can provide their own function for isoutofdomain: isoutofdomain=(u,p,t) -> any(x -> x < 0, u) (we use any(x -> x < 0, u.storage). Likewise, I would suggest to provide a similar method to PositiveDomain to retrieve the user specific u. That could be PositiveDomain(...; u_getter=(u,p,t) -> u), but probably using a better keyword name.
Describe alternatives you’ve considered
Diving into the code it seems we could override isaccepted by dispatching on a specific type of u, but that would be piracy of internal methods. A user defined isaccepted instead of only a u_getter could work, but would come closer to a GeneralDomain.