SU2
datatype_structure.hpp
Go to the documentation of this file.
1 
35 #pragma once
36 
37 #include <iostream>
38 #include <complex>
39 #include <cstdio>
40 
41 /*--- Depending on the datatype defined during the configuration, include the correct datatype
42  * definition. Each file uses a typedef from the specific datatype to su2double and implements
43  * the routines defined in the namespace SU2_TYPE below. ---*/
44 
45 #if defined COMPLEX_TYPE
47 #define SPRINTF sprintfOver
48 #elif defined CODI_REVERSE_TYPE
49 #define SPRINTF sprintfOver
51 #elif defined CODI_FORWARD_TYPE
52 #define SPRINTF sprintfOver
54 #else
55 #define SPRINTF sprintf
57 #endif
58 
59 #include "ad_structure.hpp"
60 
61 /*--- This type can be used for (rare) compatiblity cases or for computations that are intended to be (always) passive. ---*/
62 
63 typedef double passivedouble;
64 
72 namespace SU2_TYPE{
78  void SetValue(su2double& data, const double &val);
79 
85  void SetSecondary(su2double& data, const double &val);
86 
92  double GetValue(const su2double &data);
93 
99  double GetSecondary(const su2double &data);
100 
106  double GetDerivative(const su2double &data);
107 
113  void SetDerivative(su2double &data, const double &val);
114 
120  int Int(const su2double& data);
121 
127  short Short(const su2double& data);
128 }
129 
130 #include "datatype_structure.inl"
131 
132 
void SetValue(su2double &data, const double &val)
Set the (primitive) value of the datatype (needs to be implemented for each new type).
Definition: codi_forward_structure.inl:36
double GetDerivative(const su2double &data)
Get the derivative value of the datatype (needs to be implemented for each new type).
Definition: codi_forward_structure.inl:44
In-Line subroutines of the datatype_structure.hpp file.
Header for codi forward type definition.
double GetValue(const su2double &data)
Get the (primitive) value of the datatype (needs to be implemented for each new type).
Definition: codi_forward_structure.inl:38
Headers for complex datatype definition.
Main routines for the algorithmic differentiation (AD) structure.
Header for codi reverse type definition.
double GetSecondary(const su2double &data)
Get the secondary value of the datatype (needs to be implemented for each new type).
Definition: codi_forward_structure.inl:42
Header for the primitive datatype.
short Short(const su2double &data)
Casts the primitive value to short (uses GetValue, already implemented for each type).
Definition: datatype_structure.inl:43
void SetDerivative(su2double &data, const double &val)
Set the derivative value of the datatype (needs to be implemented for each new type).
Definition: codi_forward_structure.inl:46
void SetSecondary(su2double &data, const double &val)
Set the secondary value of the datatype (needs to be implemented for each new type).
Definition: codi_forward_structure.inl:40
Namespace for defining the datatype wrapper routines; this class features as a base class for type in...
int Int(const su2double &data)
Casts the primitive value to int (uses GetValue, already implemented for each type).
Definition: datatype_structure.inl:39