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.
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 caseuis aComponentVectorof 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 forisoutofdomain:isoutofdomain=(u,p,t) -> any(x -> x < 0, u)(we useany(x -> x < 0, u.storage). Likewise, I would suggest to provide a similar method toPositiveDomainto retrieve the user specificu. That could bePositiveDomain(...; 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
isacceptedby dispatching on a specific type ofu, but that would be piracy of internal methods. A user definedisacceptedinstead of only au_gettercould work, but would come closer to aGeneralDomain.