srmainwaring / asv_wave_sim

This package contains plugins that support the simulation of waves and surface vessels in Gazebo.
GNU General Public License v3.0
110 stars 29 forks source link

Waves simulation optimisation - part 2 #84

Closed srmainwaring closed 1 year ago

srmainwaring commented 1 year ago

This PR is the second part in a series of updates to the wave simulation to improve performance.

The main change is to replace the use of ffwt_complex arrays for storage with Eigen types. This removes copies before and after the FFT execution. The base amplitude calculation is vectorised.

Details

  1. Extend tests to non-square grids ie. (nx != ny), both nx and ny must be a power of 2.
  2. Formatting changes to google coding standards.
  3. Replace gravity constant hardcoding with parameter.
  4. Add vectorised version of the base amplitude calculation.
  5. Add partial vectorised version of current amplitude calculation (remainder is for part 3).
  6. Factor out initialisation and cleanup of FFTW storage to separate functions.
  7. Use Eigen::RowMajor matrices for FFTW storage (recommended by FFTW docs).
  8. Map row major to col major storage on output.
  9. Add new unit test file for using Eigen with FFTW.