-
Notifications
You must be signed in to change notification settings - Fork 6
Adjoint Capabilities
Discrete adjoint capabilities are now available in MULTIF, in addition to finite differences (for the mass and thrust QoI only).
Important note : This requires the latest custom version of SU2 (see Installation#su2) configured with Automatic Differentiation (AD) support (see Information about AD build).
The only additional options in the MULTIF configuration file related to gradients computation are the following.
% ---- GRADIENTS COMPUTATIONS ----
% Output a gradient file? (only mass and thrust for now)
OUTPUT_GRADIENTS= YES
OUTPUT_GRADIENTS_FILENAME= grad.dat
% Method used for gradients computation (ADJOINT or FINITE_DIFF)
GRADIENTS_COMPUTATION_METHOD= ADJOINT
-
OUTPUT_GRADIENTS
: If set to YES, MULTIF will output a file (different from the MULTIF output file, and whose name is set byOUTPUT_GRADIENTS_FILENAME
) containing thrust gradients with respect to the design variables. Note that even if this option is set to NO, gradients might be computed if they are required by a dakota input file (params.in
). -
GRADIENTS_COMPUTATION_METHOD
: use the discrete adjoint capabilities of SU2, or finite differences.
An example is available in {MULTIF_ROOT}/example/gradients.
Note: The latest custom version of SU2 is required to run this example.
The input files are the following:
- general_gradients.cfg : configuration file for MULTIF.
- params.in : a Dakota input file containing the values of the design variables and requesting the value and gradients computations for mass and thrust.
This example can be run using this command line:
python /path/to/MULTIF/runModel.py -f general_gradients.cfg -l 0 -n 7
Three fidelity levels are defined in general_gradients.cfg
, for which only the mesh complexities change. The flag -n
specifies the number of cores to use when running parallel calculation in SU2.
The gradients will be outputted in two different files:
- in
grad.dat
: as required by theOUTPUT_GRADIENTS
options, - and in
results.out
, the dakota interface file.