loganoz / horses3d

HORSES3D: A high-order discontinuous Galerkin solver for flow simulations and multi-physics applications
https://loganoz.github.io/horses3d/
MIT License
106 stars 23 forks source link

WIP: Contiguous memory layout for the solution #189

Open Andres-MG opened 9 months ago

Andres-MG commented 9 months ago

Right now the solution vector is scattered across all the elements, in small non-contiguous arrays. On top of this, since implicit solvers need a long contiguous vector, we transfer the solution from local to global and vice-versa several times when using these methods.

This PR defines the local storage in terms of pointers to the correct regions of the global array. This means that there is only one solution vector with two different access patterns. The functions global2Local and local2Global are not necessary anymore, and the memory footprint is somewhat smaller as the arrays are not duplicated. Accelerating implicit methods with GPUs should also be easier now.

Conversely, at least two features still need to be reworked: p-adaptation and the construction of individual elements.

loganoz commented 9 months ago

Seems quite interesting, let's talk about this on Thursday meeting!