Domain decomposition¶
Pencil-like domain decomposition is adopted to parallelise the domain.
By default the domain is decomposed in the \(y\) direction (\(x1\) pencil), in which all variables in the spectral domain
are defined.
Note that they are all complex numbers whose data type is fftw_complex
:
11fftw_complex * restrict s_x1_array;
Here the prefix s_
and x1_
denote the variables are in the spectral domain and stored as the x1
pencils.
To evaluate the non-linear terms in the physical domain based on the transform method, multi-dimensional discrete Fourier transforms are to be performed, whose results are stored as the \(y1\) pencil (or \(z1\) pencil for three-dimensional domains).
Since they are real numbers in theory, I define them as double
to save the storage and to roughly halve the number of operations needed:
14double * restrict p_y1_array;
17double * restrict p_z1_array;