-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add transformation in acceleration methods to treat bounded values #1952
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition!
Needs some work concerning test coverage and usability, but nothing critical.
See also the generated Wreorder
warnings.
Could you (briefly) document your porous-media results here as well? Iteration / convergence data.
tests/quasi-newton/helpers.cpp
Outdated
outValues[0] = sin(inValues[0] * inValues[1]); | ||
outValues[1] = cos(inValues[0] * inValues[1]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test actually converge or does it iterate till 200?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could converge when it's not stopped (while exceeding the bounds).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by stopped you mean reaching the 200, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By stopped I mean when normal IMVJ is used, the values after post-processing will go beyond the range and the test will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but with the transformation it converges?
…e into QN-for-limited-range-data
Main changes of this PR
Add cropping and (possible) transformations in acceleration methods, to limit the post-processed data inside the required range.
Motivation and additional information
Motivation
When we are modelling physical scenarios, we live with bounded values, such as concentration(in [0,1]) of phase etc.
If the user involves these values into acceleration methods, there exists the possibility, that the output from acceleration methods would go beyond the certain range. Then we will send irrational input into the solver, which might result in an error info from solver.
Ideas
Our basic idea is to transform the bounded data into infinity before they are post-processed, and do backward transformation after the acceleration. This is similar to pre-conditioning, but a non-linear one.
To do the transformation from the actual interval is not possible when the interval is closed(e.g. for concentration), so I extend the interval at both sides a little bit further to execute the transformation and after the backward transformation, I crop the part which exceed the actual interval.
Currently, I have only implemented the transformation and cropping for QN-methods for both-sides bounded values, later I want to extend the method for one-side bounded values. For under-relaxation methods, we don't have problem with bounded-values.
I compared only cropping and transformation+cropping for IQN-IMVJ with simple test case
tests/quasi-newton/serial/TestQN11.xml
and also with more complex multi-phase porous-media simulation. These two methods could both work for the test case, even when I adjusted the shape of the function. But for the porous-media case, I observed that the transformation+cropping helped with the convergence, when pure cropping couldn't do this (so it only stopped the solver from breaking down). But these are only data-based conclusions, not analytic ones.Different transformation functions and extended interval widths are also compared. The logistic function with 0.1 extension on both sides works well for most occasions.
Appendix:
For the multi-phase porous media simulation, the saturation of one phase is involved in the QN-methods. And a over large saturation can cause the micro-scale solver to break down. One group of tests give the results like:
without any modification, the iterations per time window are: 6-11-11-30(max. iter. num.)-break,
with cropping, they are 6-11-11-30-30-...(further not measured)
with given transformation and cropping, it's 6-12-19-8-8-7; this could vary according to the transformation function and intervals.
A proper way to predict the influence of the modification on the convergence rate is still in search ;)
Author's checklist
pre-commit
hook to prevent dirty commits and usedpre-commit run --all
to format old commits.make changelog
if there are user-observable changes since the last release.Reviewers' checklist