LHEEA / HOS-ocean

High-Order Spectral method for oceanic simulations
GNU General Public License v3.0
70 stars 35 forks source link

phisx value #13

Open ccc-12 opened 6 years ago

ccc-12 commented 6 years ago

Hello,

I am new to working with the HOS-Ocean model and I would like to kindly ask for a clarification. I am trying to obtain the value of the \partial \phi^{s} / \partial x on the x-grid at each time step. I am outputting in the 'output_time_step' routine with the value calculated via the 'phisxy_etaxy' routine. I am outputting phisx(1:n1,1) (for 2D simulation). My clarification is: is this the correct value that I am looking for? I am asking as the size of phisx is larger (md1,1) depending on the order M of the solution.

Thank you for your time and help!

Kind regards, Constantin

rickyspaceguy commented 6 years ago

phisx(1:md1,1) will indeed output the partial x-derivative on a grid of md1 x 1.

To project it onto n1x1, do the following

  1. FFT phisx on to its fourier space of complex amplitudes, size md1 x 1. Use s_2_f_big.
  2. Use function reduce_C to obtain a reduced fourier space of complex amplitudes i.e. size n1 x 1.
  3. Inverse FFT the n1 x 1 complex amplitudes to give phisx onto n1 x 1 grid. Use f_2_s
ccc-12 commented 6 years ago

Thank you very much for the help and for the quick reply!

It is very clear now and works!

All the best, Constantin