Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Gradient example

List of the tests:

  • grad3d: Example to compute the gradient of a field.

This example demonstrates the use 2DECOMP&FFT library to compute the gradient of a field using an explicit second order finite difference scheme. The purpose is to show how to use the transpose operations to allow explicit calculation of the gradient in all 3 directions. The results are written to a file and the function is periodic over the interval [0-1]

What to input: The program takes max 5 inputs as:

  1. p_row [optional]
  2. p_col [optional]
  3. nx [optional]
  4. ny [optional]
  5. nz [optional]

If the decomposition is imposed both (1) and (2) are necessary. If the resolution is imposed (1-5) are necessary.

What to expect: the output is the original function and the gradient in the 3 direction. The program will also give the total error in L2 norm comparing with the anytical solution.