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
Create a GMRES subsection in Solver parameters #2163
Create a GMRES subsection in Solver parameters #2163
Conversation
Keep in mind that even though we may not use any of these parameters in our tests, other people might still use them in their input file, so we should add an entry in the update script anyway. Also, I would vote for moving |
I agree we should move For these (and any other) parameters I don't think there is any need to use an additional subsection under Once we decide on the remaining parameters to move, I'll modify the update script. |
source/simulator/parameters.cc
Outdated
@@ -338,6 +321,26 @@ namespace aspect | |||
|
|||
prm.enter_subsection ("Solver parameters"); | |||
{ | |||
prm.enter_subsection ("GMRES parameters"); |
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.
Could I advocate for this to be renamed "Linear solver parameters"? The fact that we use GMRES is not really material in this regard -- it's just what we happen to use -- whereas the important fact is that it's about solving the linear problem.
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.
I agree.
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.
Sounds good. I think it would be logical to move Number of cheap Stokes solver steps
and Maximum number of expensive Stokes solver steps
into this section as well.
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.
That makes sense.
Thinking about this for a bit, we could also discuss if we want to move |
If we keep 'Linear solver tolerance' outside of the Solver parameters subsection, I think it makes sense to keep |
9e679a0
to
80268d4
Compare
I've updated the subsection name to Unless there are more parameters to move into this subsection or |
On 04/13/2018 02:37 PM, naliboff wrote:
If we keep 'Linear solver tolerance' outside of the Solver parameters
subsection, I think it makes sense to keep |Use direct solver for Stokes
system| in the same place. However, If the group consensus is to move it, no
real objection.
I'd say move both. They are both clearly related to the linear solver.
|
2eafe1a
to
4cea89b
Compare
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.
Two minor improvements. I will send you an update script for the parameter files later this week.
source/simulator/parameters.cc
Outdated
@@ -338,6 +255,92 @@ namespace aspect | |||
|
|||
prm.enter_subsection ("Solver parameters"); | |||
{ | |||
prm.enter_subsection ("Linear solver parameters"); |
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.
Could you rename this "Stokes solver parameters"?
source/simulator/parameters.cc
Outdated
Patterns::Double(0,1), | ||
"The relative tolerance up to which the linear system for " | ||
"the composition system gets solved. See `linear solver " | ||
"tolerance' for more details."); |
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.
And leave these for now in the global section.
@gassmoeller - The last commit addressed your two comments. Should I squash everything down to one commit before changing the update script? |
f59b222
to
9bb8a1e
Compare
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 job. Now we just need to figure out the test failures.
cookbooks/global_no_melt.prm
Outdated
# We fix the temperature at the top and bottom boundaries of | ||
# the box, and prescribe free-slip boundary conditions on all | ||
# sides. | ||
# We choose a high tolerance for the linear Stokes solver. |
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.
strict
tolerance might be less ambiguous
fa6a368
to
62d4045
Compare
939a84f
to
58b87aa
Compare
7a29baa
to
5a73601
Compare
I think I fixed the update script for all special cases we had. @naliboff, sorry for taking over your PR, I rebased everything after #2168 was merged, so you will need to throw away your local branch and check out this one if you want to do any more changes. Hopefully that should not be necessary though. I removed some parameter lines that just set parameters to their default value, and made sure that the benchmarks and cookbooks are still nice to read. |
cookbooks/global_no_melt.prm
Outdated
|
||
# The end time of the simulation. Because we want to see how upwellings | ||
# and downwellings evolve over time, and if differences develop between | ||
# the model with and without melt migration, we set the end time to 140 Ma. | ||
set End time = 1.4e8 | ||
|
||
# We choose a stricter than default linear Stokes solver tolerance, | ||
# to improve the nonlinear convergence behavior. |
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.
This model does not do any nonlinear iterations. And please don't ask, I do not remember why I set the parameter to this number... (except to make sure that the global_melt and global_no_melt models have the same parameter values). So I would either remove the comment, or move it to the global_melt.prm input file.
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.
This would also have the advantage that the files in the doc/manual/cookbooks and the cookbooks folder have the same documentation.
Done. @tjhei: It seems the tester is taking a break, can you have a look? Thanks! |
@gassmoeller - No problem at all and thanks for doing all the work with the update script and parameter file cleanup! I just looked through the cookbook and benchmark parameter file changes and all looks good. As soon as the tester finishes, I agree this is ready to merge. |
I am doing a review at the moment, please don't merge until I'm done. |
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.
Thanks for fixing this! Please address my comments before merging.
cookbooks/global_no_melt.prm
Outdated
|
||
# The end time of the simulation. Because we want to see how upwellings | ||
# and downwellings evolve over time, and if differences develop between | ||
# the model with and without melt migration, we set the end time to 140 Ma. | ||
set End time = 1.4e8 | ||
|
||
# We choose a stricter than default linear Stokes solver tolerance, | ||
# to improve the nonlinear convergence behavior. |
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.
This would also have the advantage that the files in the doc/manual/cookbooks and the cookbooks folder have the same documentation.
subsection Stokes solver parameters | ||
set Number of cheap Stokes solver steps = 0 | ||
end | ||
end |
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.
If this was not in the original file, you don't have to add this here (in particular as there's no documentation on why the parameter is chosen like this).
@@ -1,4 +1,3 @@ | |||
set Linear solver tolerance = 1e-12 |
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.
This is not the default value, so you can not just remove it. Please add it below to the Stokes solver parameters.
@@ -9,7 +9,6 @@ | |||
# equal to the start time to force a single time | |||
# step before the program terminates. | |||
set Additional shared libraries = ./libburstedde.so | |||
set Linear solver tolerance = 1e-12 |
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.
This is not the default value, so you can not just remove it.
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.
Good catch!
"If this value is set too low for the size of the problem, the Stokes solver will " | ||
"not converge and return an error message pointing out that the user didn't allow " | ||
"a sufficiently large number of iterations for the iterative solver to converge."); | ||
|
||
prm.declare_entry ("Temperature solver tolerance", "1e-12", |
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.
I thought we had agreed to also move the temperature and composition solver tolerance if we move the linear solver tolerance?
I am not insisting on this (and the last time we talked about this, I had assumed none of these tolerances would be moved, that is why I argued they should stay where they are), but I just think this can be quite confusing. Why is the Linear solver tolerance in its own subsection, while the temperature and composition solver tolerances aren't?
We can also do that in a follow-up pull request, but we should at least discuss again what the final state for the release should be.
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.
I recall us deciding that the composition and temperature solver tolerance would be moved eventually, but not in this pull request.
I think the decision was based on the fact that there currently are no other values we would move into the composition and temperature solver subsections and it would simply add lines to the input file. If someone creates more parameters related to the composition and linear solver tolerance, then it would make sense to move them.
However, I agree it is a bit confusing to have the temperature and composition solver tolerances as global parameters now. Do you think it is worth moving them into a new subsection before the 2.0 release? If so, I vote to do this in a separate PR.
164585a
to
58daf73
Compare
I fixed the issues, thanks for taking a look! |
Okay, looks good to me! I've created an issue (#2171) for the advection solver tolerances, which can then be handled in a follow-up pull request. |
Partially addresses #2023. Moving these two parameters does not require running the update script, but moving any of the other solver parameters would require doing so.