On 14/03/16 17:52, Floriane Gidel [RPG] wrote:
Indeed, I have used Linear Variational Solver only for eta^{n+1} and phi^{n+1} (and q^{n+1/2} ). Phi^{n+1/2} is still obtained from the NL variational solver. The new log summary is attached.
OK, this is better, we've saved about 400 seconds (out of 1200) in building jacobians. I think there is probably still some room for improvement. The computation occurs, I think, in a piecewise quadratic space (FunctionSpace(mesh, "CG", 2)). However, for output purposes, we L2-project to piecewise linears (inside file output). This can slow things down, because we repeatedly build the same projection matrix. This can especially hurt if you're outputting data at every timestep. There are two options you can use to help this, both involve writing a little more code. You need to define the piecewise linear output space yourself: V_out = FunctionSpace(mesh, "CG", 1) And the output functions, I'll only do one here: phi0_out = Function(V_out) Now, whenever you want to produce output for phi0, instead of outputting it directly, you need to first either interpolate or project it into phi0_out. With an up to date firedrake you can use either of the following (depending on whether you want interpolation or projection). For interpolation: phi0_out.interpolate(phi0) phi_out << phi0_out For projection: Outside the time loop: phi_proj = Projector(phi0, phi0_out) inside the time loop: phi_proj.project() phi_out << phi0_out If you only output very infrequently, then this is less likely to be a problem, so this may not help a huge amount. However, if the output is frequent, you might find this makes a difference. Once we've got this right, we can think about looking at the performance of the solvers. And also how much performance you might expect to be getting. Thanks, Lawrence