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
Issues with truncated polynomial order in LeastSquaresFit and LeastSquaresFitHistory #13498
Comments
I did not write this code. The change you see in git history is from the old SVN days. The date tells me that it was when we rolled out the new MOOSE (what we internally call MOOSE 2.0). We probably moved that file from somewhere else and because git-svn did not handle moves properly it looks like a new file that I wrote. The true author of this line is @permcody. This change occurred in May 2009, |
OK - so 2009... A lot has changed since then 😄
Clearly a hack for the single problem I was running at the time. This is long before I was properly in the framework and utility mindset. It does appear arbitrary so feel free to improve it.
Yep
Now this isn't necessarily a bad choice and we do this for other pure utilities that have zero dependence on MOOSE. It just passes the responsibility to the MOOSE class that calls the utility to handle the error. To call |
…oses idaholab#13498 Add a 'truncate_order' option to LeastSquaresFit and LeastSquaresFitHistory Correct logic for determining required points for a given polynomial order in PolynomialFit.C Add tests for fits of polynomials with order 0, 1, and 2 Add test for insufficient order error
…oses idaholab#13498 Add a 'truncate_order' option to LeastSquaresFit and LeastSquaresFitHistory Correct logic for determining required points for a given polynomial order in PolynomialFit.C Add tests for fits of polynomials with order 0, 1, and 2 Add test for insufficient order error
Bug Description
The
LeastSquaresFit
andLeastSquaresFitHistory
vectorpostprocessors are both using an option inPolynomialFit
(which does the heavy lifting) that automatically truncates the order of the polynomial if an insufficient number of points is provided.There are a few issues with this:
This choice seems totally insane! @andrsd: git blame says you last touched this code. Do you know anything about that?
If you don't use the truncation option, there's an error check, but the logic for it is wrong. The
<
comparison operation should be a<=
.If you hit the error, rather than calling
mooseError()
, it throws astd::domain_error
, which doesn't get handled, so the error message never gets printed out.We need to fix all of these issues. I'm going to provide an option on whether to truncate the polynomial order in those vpps, and add a thorough set of test cases to make sure this is working correctly.
Steps to Reproduce
Use
LeastSquaresFitHistory
with 3 data points and ask for a 2nd order polynomial. You only get a 1st order polynomial.Impact
We use this pretty heavily in Grizzly. I'm afraid that we may be inadvertently having the polynomial order truncated in problems we care about.
The text was updated successfully, but these errors were encountered: