SU2
Functions
AD Namespace Reference

Contains routines for the reverse mode of AD. In case there is no reverse type configured, they have no effect at all. More...

Functions

void StartRecording ()
 Start the recording of the operations and involved variables. If called, the computational graph of all operations occuring after the call will be stored, starting with the variables registered with RegisterInput.
 
void StopRecording ()
 Stops the recording of the operations and variables.
 
void RegisterInput (su2double &data)
 Registers the variable as an input. I.e. as a leaf of the computational graph. More...
 
void RegisterOutput (su2double &data)
 Registers the variable as an output. I.e. as the root of the computational graph. More...
 
void ClearAdjoints ()
 Clears the currently stored adjoints but keeps the computational graph.
 
void ComputeAdjoint ()
 Computes the adjoints, i.e. the derivatives of the output with respect to the input variables.
 
void Reset ()
 Reset the tape structure to be ready for a new recording.
 
void ResetInput (su2double &data)
 Reset the variable (set index to zero). More...
 
void SetPreaccIn (const su2double &data)
 Sets the scalar input of a preaccumulation section. More...
 
void SetPreaccIn (const su2double *data, const int size)
 Sets the input variables of a preaccumulation section using a 1D array. More...
 
void SetPreaccIn (const su2double *const *data, const int size_x, const int size_y)
 Sets the input variables of a preaccumulation section using a 2D array. More...
 
void StartPreacc ()
 Starts a new preaccumulation section and sets the input variables. More...
 
void SetPreaccOut (su2double &data)
 Sets the scalar output of a preaccumulation section. More...
 
void SetPreaccOut (su2double *data, const int size)
 Sets the output variables of a preaccumulation section using a 1D array. More...
 
void SetPreaccOut (su2double **data, const int size_x, const int size_y)
 Sets the input variables of a preaccumulation section using a 2D array. More...
 
void EndPreacc ()
 Ends a preaccumulation section and computes the local Jacobi matrix of a code section using the variables set with SetLocalInput(), SetLocalOutput() and pushes a statement for each output variable to the AD tape.
 

Detailed Description

Contains routines for the reverse mode of AD. In case there is no reverse type configured, they have no effect at all.

Function Documentation

§ RegisterInput()

void AD::RegisterInput ( su2double &  data)
inline

Registers the variable as an input. I.e. as a leaf of the computational graph.

Parameters
[in]data- The variable to be registered as input.

§ RegisterOutput()

void AD::RegisterOutput ( su2double &  data)
inline

Registers the variable as an output. I.e. as the root of the computational graph.

Parameters
[in]data- The variable to be registered as output.

§ ResetInput()

void AD::ResetInput ( su2double &  data)
inline

Reset the variable (set index to zero).

Parameters
[in]data- the variable to be unregistered from the tape.

§ SetPreaccIn() [1/3]

void AD::SetPreaccIn ( const su2double &  data)
inline

Sets the scalar input of a preaccumulation section.

Parameters
[in]data- the scalar input variable.

§ SetPreaccIn() [2/3]

void AD::SetPreaccIn ( const su2double *  data,
const int  size 
)
inline

Sets the input variables of a preaccumulation section using a 1D array.

Parameters
[in]data- the input 1D array.
[in]size- size of the array.

§ SetPreaccIn() [3/3]

void AD::SetPreaccIn ( const su2double *const *  data,
const int  size_x,
const int  size_y 
)
inline

Sets the input variables of a preaccumulation section using a 2D array.

Parameters
[in]data- the input 2D array.
[in]size_x- size of the array in x dimension.
[in]size_y- size of the array in y dimension.

§ SetPreaccOut() [1/3]

void AD::SetPreaccOut ( su2double &  data)
inline

Sets the scalar output of a preaccumulation section.

Parameters
[in]data- the scalar output variable.

§ SetPreaccOut() [2/3]

void AD::SetPreaccOut ( su2double *  data,
const int  size 
)
inline

Sets the output variables of a preaccumulation section using a 1D array.

Parameters
[in]data- the output 1D array.

§ SetPreaccOut() [3/3]

void AD::SetPreaccOut ( su2double **  data,
const int  size_x,
const int  size_y 
)
inline

Sets the input variables of a preaccumulation section using a 2D array.

Parameters
[in]data- the output 1D array.

§ StartPreacc()

void AD::StartPreacc ( )
inline

Starts a new preaccumulation section and sets the input variables.

The idea of preaccumulation is to store only the Jacobi matrix of a code section during the taping process instead of all operations. This decreases the tape size and reduces runtime.

Input/Output of the section are set with several calls to SetPreaccIn()/SetPreaccOut().

Note: the call of this routine must be followed by a call of EndPreacc() and the end of the code section.