-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve UserObjectInterface errors #17496
Conversation
Job Documentation on 3584652 wanted to post the following: View the site here This comment will be updated on new commits. |
Job Precheck on 6d22d82 wanted to post the following: Your code requires style changes. A patch was auto generated and copied here
Alternatively, with your repository up to date and in the top level of your repository:
|
88ae8bc
to
e9ccdad
Compare
Okay, this has led me down a path of frustration with this interface. It's one of those Sunday-morning-clean-up-MOOSE mornings. Will push a rewrite by this afternoon. |
@aprilnovak Let me know what you think:
|
I like it! That's perfect - thanks for the input :) |
Unfortunately... this has led me down a swath of other error fixing and cleaning. I'll take a break for now and push what I have so we can get this in. The errors with the previous implementation were that the lower level interfaces (FEProblemBase::getUserObject) do the casting ahead of time when getting the object. Therefore, if they don't match, they just return nothing. This means we need to request the base object from that call, and then we can cast it |
cf848e3
to
b94ef36
Compare
Co-authored-by: April Novak <novak@berkeley.edu> refs idaholab#17446 and idaholab#17512
@sallustius and I, we are working on mixture properties and we had to write functions like p_from_blabla_and_x that inherits from fluid properties and not singlephase fluid properties, this "NICE" feature is blocking our development. Any quick fix??? We are up for a delivarable soon any quick suggestion is very much appreciated. |
@pbalest I'll ping you in a message |
Small modification to
UserObjectInterface
to throw an error if the type of the user object being grabbed does not matchT
, as well as a test demonstrating the desired behavior for the fluid properties module.After discussion with @andrsd, it may be more useful for apps and other users to have this patch directly in
UserObjectInterface
(as opposed to a newFluidPropertyInterface
) because users no longer would need to modify their source files to take advantage of this check. Plus, this error check is pretty general and would likely be useful to all MOOSE objects with user objects.I wanted to print the type of
T
to get an even better error message, withbut apparently that's implementation-dependent. So if there's some way to figure that out in MOOSE, I think that'd be great to add to the error message.
Closes #17446 and refs #17512