Log PETSc solver output to file
Dear Firedrake Team, I'm PhD student and recently started to use Firedrake for my work. I'm implementing a FEM simulation and wanted to log the convergence of the PETSc KSP solver (e.g. residuals) in a log-file for later analysis. Maybe this is trivial, but unfortunately I did not find any information in the example codes on the firedrake homepage, the mailing list and GitHub Issues/Discussions. Could you please help me with this problem? Thanks in advance. All the best, Aaron P.S. I'm working with the Firedrake Docker Image 2024-07.
python myfile.py -log_view > file.txt On 13 Aug 2024, at 10:30, Aaron <aarawork@gmail.com> wrote:  Dear Firedrake Team, I'm PhD student and recently started to use Firedrake for my work. I'm implementing a FEM simulation and wanted to log the convergence of the PETSc KSP solver (e.g. residuals) in a log-file for later analysis. Maybe this is trivial, but unfortunately I did not find any information in the example codes on the firedrake homepage, the mailing list and GitHub Issues/Discussions. Could you please help me with this problem? Thanks in advance. All the best, Aaron P.S. I'm working with the Firedrake Docker Image 2024-07. _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-log_view gives the performance, but for the residuals you want -ksp_monitor. Thanks, Matt On Tue, Aug 13, 2024 at 6:15 AM Cotter, Colin J <colin.cotter@imperial.ac.uk> wrote:
python myfile.py -log_view > file.txt
On 13 Aug 2024, at 10:30, Aaron <aarawork@gmail.com> wrote:
Dear Firedrake Team,
I'm PhD student and recently started to use Firedrake for my work. I'm implementing a FEM simulation and wanted to log the convergence of the PETSc KSP solver (e.g. residuals) in a log-file for later analysis. Maybe this is trivial, but unfortunately I did not find any information in the example codes on the firedrake homepage, the mailing list and GitHub Issues/Discussions. Could you please help me with this problem?
Thanks in advance.
All the best,
Aaron
P.S. I'm working with the Firedrake Docker Image 2024-07.
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake
-- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
Urgh I misread. Yes, for residuals use the petsc options for the solver, following <https://www.firedrakeproject.org/solving-interface.html#id7> Solving PDEs — Firedrake 0+unknown documentation<https://www.firedrakeproject.org/solving-interface.html#id7> firedrakeproject.org<https://www.firedrakeproject.org/solving-interface.html#id7> [icon.ico]<https://www.firedrakeproject.org/solving-interface.html#id7> add “ksp_monitor”: None to the solver-parameters dictionary for the solve. On 13 Aug 2024, at 16:18, Matthew Knepley <knepley@gmail.com> wrote:  -log_view gives the performance, but for the residuals you want -ksp_monitor. Thanks, Matt On Tue, Aug 13, 2024 at 6:15 AM Cotter, Colin J <colin.cotter@imperial.ac.uk<mailto:colin.cotter@imperial.ac.uk>> wrote: python myfile.py -log_view > file.txt On 13 Aug 2024, at 10:30, Aaron <aarawork@gmail.com<mailto:aarawork@gmail.com>> wrote:  Dear Firedrake Team, I'm PhD student and recently started to use Firedrake for my work. I'm implementing a FEM simulation and wanted to log the convergence of the PETSc KSP solver (e.g. residuals) in a log-file for later analysis. Maybe this is trivial, but unfortunately I did not find any information in the example codes on the firedrake homepage, the mailing list and GitHub Issues/Discussions. Could you please help me with this problem? Thanks in advance. All the best, Aaron P.S. I'm working with the Firedrake Docker Image 2024-07. _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk<mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk<mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/<http://www.cse.buffalo.edu/~knepley/>
participants (3)
- 
                
                Aaron
- 
                
                Cotter, Colin J
- 
                
                Matthew Knepley