22
33
44namespace AD {
5- #ifdef CODI_REVERSE_TYPE
5+ #if defined CODI_REVERSE_TYPE
66
77 typedef codi::DataStore CheckpointHandler;
88
99 /* --- Stores the indices of the input variables (they might be overwritten) ---*/
1010
11- extern std::vector<unsigned int > inputValues;
11+ extern std::vector<su2double::GradientData > inputValues;
1212
1313 /* --- Current position inside the adjoint vector ---*/
1414
1515 extern int adjointVectorPosition;
1616
1717 /* --- Reference to the tape ---*/
1818
19- extern codi::ChunkTape< double , int > & globalTape;
19+ extern su2double::TapeType & globalTape;
2020
2121 extern bool Status;
2222
2323 extern bool PreaccActive;
2424
25- extern codi::ChunkTape< double , int > ::Position StartPosition, EndPosition;
25+ extern su2double::TapeType ::Position StartPosition, EndPosition;
2626
27- extern std::vector<unsigned int > localInputValues;
27+ extern std::vector<su2double::GradientData > localInputValues;
2828
2929 extern std::vector<su2double*> localOutputValues;
3030
@@ -33,7 +33,7 @@ namespace AD{
3333
3434 inline void RegisterOutput (su2double& data){AD::globalTape.registerOutput (data);}
3535
36- inline void ResetInput (su2double &data){data.getGradientData () = 0 ;}
36+ inline void ResetInput (su2double &data){data.getGradientData () = su2double::GradientData () ;}
3737
3838 inline void StartRecording (){AD::globalTape.setActive ();}
3939
@@ -54,7 +54,7 @@ namespace AD{
5454
5555 inline void SetPreaccIn (const su2double &data){
5656 if (PreaccActive){
57- if (data.getGradientData () != 0 ){
57+ if (data.isActive () ){
5858 localInputValues.push_back (data.getGradientData ());
5959 }
6060 }
@@ -63,7 +63,7 @@ namespace AD{
6363 inline void SetPreaccIn (su2double* data, const int size){
6464 if (PreaccActive){
6565 for (unsigned short i = 0 ; i < size; i++){
66- if (data[i].getGradientData () != 0 ){
66+ if (data[i].isActive () ){
6767 localInputValues.push_back (data[i].getGradientData ());
6868 }
6969 }
@@ -74,7 +74,7 @@ namespace AD{
7474 if (PreaccActive){
7575 for (unsigned short i = 0 ; i < size_x; i++){
7676 for (unsigned short j = 0 ; j < size_y; j++){
77- if (data[i][j].getGradientData () != 0 ){
77+ if (data[i][j].isActive () ){
7878 localInputValues.push_back (data[i][j].getGradientData ());
7979 }
8080 }
@@ -91,7 +91,7 @@ namespace AD{
9191
9292 inline void SetPreaccOut (su2double& data){
9393 if (PreaccActive){
94- if (data.getGradientData () != 0 ){
94+ if (data.isActive () ){
9595 localOutputValues.push_back (&data);
9696 }
9797 }
@@ -100,7 +100,7 @@ namespace AD{
100100 inline void SetPreaccOut (su2double* data, const int size){
101101 if (PreaccActive){
102102 for (unsigned short i = 0 ; i < size; i++){
103- if (data[i].getGradientData () != 0 ){
103+ if (data[i].isActive () ){
104104 localOutputValues.push_back (&data[i]);
105105 }
106106 }
@@ -111,7 +111,7 @@ namespace AD{
111111 if (PreaccActive){
112112 for (unsigned short i = 0 ; i < size_x; i++){
113113 for (unsigned short j = 0 ; j < size_y; j++){
114- if (data[i][j].getGradientData () != 0 ){
114+ if (data[i][j].isActive () ){
115115 localOutputValues.push_back (&data[i][j]);
116116 }
117117 }
0 commit comments