...  ...  @@ 129,4 +129,107 @@ Launch the simulation 





```python



tracker.loop(1)



```






# Tidal components






SLIM is also able to compute the tidal components.






Useful import






```python



import slimPost



```






Path to the mesh and results






```python



mesh = "mesh.msh"



path_input = "output/sw2d/"



```






This feature requires some additional information



 The iteration number from which the analysis begins (here ```initial_index = 2800```)



 The iteration number at which the analysis ends (here ```final_index = 3000```)



 The initial time (in seconds), i.e. the time associated to the first iteration (here ```initial_time = 5600``` (for a timestep of 2s))



 The number of period within the time lapse studied (here ```n_period = 1```)



 The number of iterations per period (here ```n_iter = 200```)



 The number of component you want to compute ( here ``` n = 5```). It has to be smaller than the half of the number of iterations



 The duration of a period (here ```period = 400```)






The first step consists in creating a Fourier_series object:






```



FS = slimPost.Fourier_series(mesh_file_name, path_input, initial_index, final_index, initial_time, n_period, n_iter, n, period)



```






Various functionality are available:






1) Compute the Fourier series at one point (```x=10``` and ```y=0``` are the coordinates along the x and y axes, respectively) and plotting the results for a variable (the sea surface elevation ```eta```, the velocity component along the x axis ```u``` or along the y axis ```v```)






```



FS.fourier_at_point(x, y, fig_name = "test", variable="eta")



```






2) Compute the range and phase of one component (```iComp = 1```) for one variable (the sea surface elevation ```eta```, the velocity component along the x axis ```u``` or along the y axis ```v```) over the domain and print them in a .msh file






```



FS.fourier_map(iComp, "eta", "Range", "Phase")



```






# Tidal ellipses






SLIM is also able to compute the tidal ellipses associated to one component of the flow on a structured grid.






Useful import






```python



import slimPost



```






Path to the mesh and to the tidal range and phase of the velocity components (which can be obtained from the ```fourier_map``` function of the ```Fourier_series``` class






```python



mesh = "mesh.msh"



```






This feature requires some additional information



 The path to the file with the phase of the component for the velocity along the x axis (here ```f1 = "Phase_u_COMP_0.msh"```)



 The path to the file with the range of the component for the velocity along the x axis (here ```f2 = "Range_u_COMP_0.msh"```)



 The path to the file with the phase of the component for the velocity along the y axis (here ```f3 = "Phase_v_COMP_0.msh"```)



 The path to the file with the phase of the component for the velocity along the y axis (here ```f4 = "Range_v_COMP_0.msh"```)



 The origin of the structured grid along the x axis (here ```0```)



 The final point of the structured grid along the x axis (here ```100```)



 The number of intervals along the x axis (here ```99```)



 The origin of the structured grid along the y axis (here ```200```)



 The final point of the structured grid along the y axis (here ```400```)



 The number of intervals along the y axis (here ```199```)






The first step consists in creating a Fourier_series object:






```



FS = slimPost.Fourier_series(mesh_file_name, path_input, initial_index, final_index, initial_time, n_period, n_iter, n, period)



```






Then, compute the range and phase of the velocity components over the domain:






```



FS.fourier_map(iComp, "u", "Range_u", "Phase_u")



FS.fourier_map(iComp, "v", "Range_v", "Phase_v")



```






Create A Tidal_ellipses object:






```



TD = slimPost.Tidal_ellipses(mesh_file_name, f1,f2,f3,f4, 0,100,99,200,400,199)



```






Compute the tidal ellipses with the following arguments:






 Name of the file where the clockwise tidal ellipses will be written (it has to be a .pos file)



 Name of the file where the counterclockwise tidal ellipses will be written (it has to be a .pos file)



 The period of the Tidal component (in secoonds)



 The scaling factor for the colormap (optional, default is 1)



```



TD.compute_tidal_ellipses("clockwise.pos", "anticlockwise.pos", period, color_max = 0.42)



``` 


\ No newline at end of file 