| 23 | |
| 24 | Then at each process event (currently each frame) a curve file will be generated in the out directory ie. {{{out/Spectra00021.curve}}} that will contain all of the spectra for that frame. See CurveFiles for more information on plotting curve files in visit. |
| 25 | |
| 26 | The above example creates a spectrum of density (or rather density^2^) which will be 1 entry in the curve file. |
| 27 | |
| 28 | You can also create spectra of vector fields like velocity^2^ |
| 29 | |
| 30 | {{{ |
| 31 | CALL CreateSpectra(Spectra) |
| 32 | ALLOCATE(Spectra%Fields(3)) |
| 33 | Spectra%Fields(:)%id=(/vx_Field, vy_Field, vz_Field/) |
| 34 | Spectra%type=VECTOR_SPECT |
| 35 | }}} |
| 36 | |
| 37 | This will generate 6 curves: One for each component of the vector field, (vx^2^, vy^2^, vz^2^) as well as the total (v^2^) and the helmholtz decomposed fields (v_sol^2^ and v_div^2^). Note the total and the decomposed fields will be labeled {{{vx_total, vx_sol, & vx_div}}} though they have nothing to do with the 'x' direction. |
| 45 | |
| 46 | There are some additional properties of the Spectra object that can be modified: |
| 47 | * '''Spectra%level''' -- You can adjust the maximum level of data used to generate the spectra. Usually this is done when there are not enough computational resources to store a fixed grid at the maximum level... By default Spectra%level will use the maximum highest level available though you can manually adjust this |
| 48 | {{{ |
| 49 | Spectra%level=MaxLevel |
| 50 | }}} |
| 51 | |
| 52 | * '''Spectra%dk''' -- By default the fourier transforms are binned with a radial bin size equal to the largest minimum wavenumber per dimension... If the domain is 16x64, then the minimum wavenumbers in x and y are 1/16 and 1/64 respectively. This means that the bin size will be 1/16 - or 4 times the minimum wave number. You can adjust this by setting the bin size dk in terms of the smallest resolvable wavenumber. So if dk = 1, the bin size would be 1/64, but there will be aliasing effects every 4 points which correspond to multiples of 1/16. |
| 53 | |
| 54 | * '''Spectra%mB''' -- By default the spectra is taken of the whole computational domain, however you can instead take a spectra of a subsection of the domain by specifying the bounds in the index space of the spectra's level. It is also a good idea to have the domain be multiples of 2 and to coincide with coarse cell boundaries. So typically it is good to first determine the size of the region in coarse cells {{{N}}} that you want to take the spectra of, and then assuming that the Spectra%level = !MaxLevel, calculate the bounds as |
| 55 | {{{ |
| 56 | Spectra%mB(:,1)=levels(MaxLevel)%mX/2 - (N/2)*2**MaxLevel+1 |
| 57 | Spectra%mB(:,2)=levels(MaxLevel)%mX/2 + (N/2)*2**MaxLevel |
| 58 | }}} |
| 59 | |
| 60 | * '''Spectra%method''' -- By default the interpolation method for producing the fixed grid data is constant interp. If the coarser grids have strong unresolved gradients, this can produce large signals in the resulting spectra at wavenumbers correposponding to grid sizes. To help mitigate this, consider setting the prolongation method to be PARABOLIC_INTERP or SPECTRAL_PROLONGATION |
| 61 | {{{ |
| 62 | Spectra%method = SPECTRAL_PROLONGATION |
| 63 | }}} |
| 64 | |
| 65 | * '''Spectra%!WindowFunction''' -- Finally if the data is not periodic, you can specify a window function to damp strong gradients that will appear at the periodic boundaries. Currently the only option available is a cosine window |
| 66 | {{{ |
| 67 | Spectra%window=COSINE_WINDOW |
| 68 | }}} |
| 69 | |
| 70 | |