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
Tutorials for SNES and TS #15067
Tutorials for SNES and TS #15067
Conversation
@luca-heltai Please assign reviewers |
Since these depend on #15065 and #15066, I've marked it as WIP, as it won't compile without those two PRs, however I think it is worth it to start reviewing these now, since tutorials usually take longer to review. I especially like the documentation on how to monitor SNES from the command line! Thanks for this contribution @stefanozampini! I really appreciate it! |
fbe0970
to
e419553
Compare
@bangerth This is now ready to be reviewed |
@stefanozampini, as we discussed, I think there should be a bit of rework in the tutorials structure in deal.II before going in the direction you suggest in this PR. In particular, we don't have a general consensus on how to tackle all these cases in which a tutorial is a minor change w.r.t. to an existing one, and your case (similarly to the NOX solver, that was closed some time ago for the same reason) is an example. For the Would this be ok from your point of view? We can work out the details of step-26 together if you want. |
Your wish is my command. The step-67 addition was to just show how easy one can switch from one implementation to another but I can drop it, no problem. Regarding step-86: it really contains all the important information a user must know about using the SNES solver and how to deal with non-homogenous boundary conditions. I put some effort into the documentation to describe what can be done with the class in terms of solver experimentations, and I think this should be instead considered to be accepted. I believe most of the code can be reused for NOX and I don't see why the tutorial cannot be extended to NOX too. |
A note aside: are the PETSc tests run in the |
@stefanozampini We had a conversation this morning on the developer call on how we wanted to proceed with these variations of tutorial programs. I think we were generally not excited about having multiple minor variations of the same program add to the total number of tutorial programs -- these might serve as good starting points, but they do not actually teach orthogonal concepts as we would like them to, and they will also be difficult to keep in sync. What I think we settled on was the following idea:
Would that sound like a reasonable approach you could live with? |
Doing that, I believe there's a lot of value in NOX and SNES that will go unnoticed for the deal.II users that want to solve complicated nonlinear problems. Look at the discussion on the results, for example, for SNES. I would like to see another one for NOX, too, all in a single tutorial, so that users can go through them, understand how to code a solver-agnostic interface, and experiment. Yes, the main business of deal.II is into the discretization of complicated systems, but at some point you need to solve them |
My plan was to basically take all of the results section you wrote and include it into the results section of step-77. I think you did a fantastic job documenting the many options SNES provides, and I want to preserve that. I just don't want a separate program that is for all practical purposes a copy of step-77, with an essentially identical introduction. How about I take what you wrote and propose a patch we can look at? (For the ODE example: As others have mentioned above, I think that we do want a separate example program, but one that uses a simpler case to start with. Everyone's preference seems to be step-26.) |
@stefanozampini Ping? |
Ping for what if I may ask? |
The discussion in my last comment. |
Oh sorry, I missed it. Yes, go ahead and do what you think is best |
The discussion of the modification of step-77 to use SNES is now in #15410. The modification of step-67 to use PETSc TS is a separate matter, and will have to be dealt with at a later time. We do want tutorial programs to show how to use external time steppers, but perhaps not a small modification of the already rather complicated step-67. I think it might be nice to turn the modification of step-67 @stefanozampini has come up with into a test suite program. |
I turned the PETSc TS version of step-67 into a test in #15420. Once that is merged, I will close this PR since we have used all parts in some way or other. There remains the issue of wanting to write a tutorial program that uses PETSc TS. This is on my list, hopefully, for the hackathon. |
The PETSc TS tutorial is tracked in #15540 . |
Depends on #15066 #15065