Avoid some diagonalisations
Closed this issue · 1 comments
I think we can actually optimise just a bit further. I realised that the relative position of the support points with respect to the parcel centre only changes when B changes. So we should not have to compute all the points from scratch in the corrections, if we store etaV(:,1) and tauV(:,2) (we would still need to multiply by costheta(j) and sintheta(j) to get all the point, but save just a little bit on storage over storing all the relative coordinates).
I realise it involves more storage, but think it will be worth the trouble. We can cut back at most 4 out of 9 diagonalisation calls, which would cut back about 15% of computing time. We need to retain the computation in the first correction (which will also deal with merging and splitting), and all the RK4 steps except the first (where B will be identical to that used in the correction at the end of the previous step, as far as I can tell). In the very first time step, we need to ensure it is initialised before the first RK4 step. Maybe we can compute this as a part of updates to the B-matrix.