On 17/03/16 10:29, Floriane Gidel [RPG] wrote:
Dear Lawrence,
Using linear solvers indeed improved a bit the running time. Would you like me to send you the new formulations to update the demo?
Yes please, please create a pull request on github for your changes to the demo.
Concerning the non linear solver, how can I change the tolerance so that it iterates less when possible?
There are two types of tolerance you can control. How tightly you solve the nonlinear system, and how tightly you solve the linearisation at each nonlinear step. These can be controlled by passing solver parameters. See http://firedrakeproject.org/solving-interface.html#setting-solver-tolerances (and the matching section on nonlinear solvers on that page). Note as well that you can use Eisenstat-Walker to adaptively control the tolerance of the linear solve inside the nonlinear solver. This can be accessed using 'snes_ksp_ew': True. See https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESKSPSet... for more information.
I have another question concerning the pvd/vtu files: when saving the data with the command "<<", what is the operation applied? Is it only a linear interpolation?
No, currently it is an L_2 projection into a space of piecewise linears. We intend to switch to interpolation but have not done so yet. You can do so "by hand", I think I explained how in one of my previous emails.
Because when I observe the data on Paraview and scale the colorbar to the data range for a given snapshot, the maximum value is different from the maximum value that I get if I save max(eta.dat.data), and this difference is really high (for instance, the amplitude of my wave is 2.45 with max(eta.dat.data), and 2.7 with paraview, while for this study I look at variations of order 0.01). My mesh resolution is 0.2, which is much smaller than my wave length, so even if max(eta.dat.data) takes the maximum at the grid points, I do not expect such a difference... Do you know where this difference could come from?
It probably comes from the L_2 projection. Thanks, Lawrence