Documentation a537f1bdf2
Loading...
Searching...
No Matches
SU2_TYPE Namespace Reference

Namespace for defining the datatype wrapper routines, this acts as a base class for type interfaces for non-primitive dataypes e.g. used by AD, complex etc. More...

Classes

struct  Passive
 Get the passive value of any variable. For most types return directly, specialize for su2double to call GetValue. More...
 
struct  Passive< su2double >
 

Functions

void SetValue (su2double &data, const passivedouble &val)
 Set the (primitive) value of the datatype (needs to be implemented for each new type).
 
void SetSecondary (su2double &data, const passivedouble &val)
 Set the secondary value of the datatype (needs to be implemented for each new type).
 
passivedouble GetValue (const su2double &data)
 Get the (primitive) value of the datatype (needs to be specialized for active types).
 
passivedouble GetSecondary (const su2double &data)
 Get the secondary value of the datatype (needs to be implemented for each new type).
 
passivedouble GetDerivative (const su2double &data)
 Get the derivative value of the datatype (needs to be implemented for each new type).
 
void SetDerivative (su2double &data, const passivedouble &val)
 Set the derivative value of the datatype (needs to be implemented for each new type).
 
template<class T >
auto PassiveValue (const T &val)
 
int Int (const su2double &data)
 Casts the primitive value to int (uses GetValue, already implemented for each type).
 
short Short (const su2double &data)
 Casts the primitive value to short (uses GetValue, already implemented for each type).
 
template<class T , su2enable_if< std::is_trivial< T >::value > = 0>
const T & _printGetValue (const T &val)
 
template<class T , su2enable_if<!std::is_trivial< T >::value > = 0>
passivedouble _printGetValue (const T &val)
 
template<class... Ts>
void sprintf (char *str, const char *format, Ts &&... args)
 Wrapper to sprintf to be able to print active types and AD expressions.
 
void sprintf (char *str, const char *literal)
 

Detailed Description

Namespace for defining the datatype wrapper routines, this acts as a base class for type interfaces for non-primitive dataypes e.g. used by AD, complex etc.

Author
T. Albring

Function Documentation

◆ _printGetValue() [1/2]

template<class T , su2enable_if< std::is_trivial< T >::value > = 0>
const T & SU2_TYPE::_printGetValue ( const T &  val)
inline

◆ _printGetValue() [2/2]

template<class T , su2enable_if<!std::is_trivial< T >::value > = 0>
passivedouble SU2_TYPE::_printGetValue ( const T &  val)
inline

◆ GetDerivative()

passivedouble SU2_TYPE::GetDerivative ( const su2double &  data)
inline

Get the derivative value of the datatype (needs to be implemented for each new type).

Parameters
[in]data- The non-primitive datatype.
Returns
The derivative value.

◆ GetSecondary()

passivedouble SU2_TYPE::GetSecondary ( const su2double &  data)
inline

Get the secondary value of the datatype (needs to be implemented for each new type).

Parameters
[in]data- The non-primitive datatype.
Returns
The primitive value.

◆ GetValue()

passivedouble SU2_TYPE::GetValue ( const su2double &  data)
inline

Get the (primitive) value of the datatype (needs to be specialized for active types).

Parameters
[in]data- The non-primitive datatype.
Returns
The primitive value.

◆ Int()

int SU2_TYPE::Int ( const su2double &  data)
inline

Casts the primitive value to int (uses GetValue, already implemented for each type).

Parameters
[in]data- The non-primitive datatype.
Returns
- The primary value casted to int.

◆ PassiveValue()

template<class T >
auto SU2_TYPE::PassiveValue ( const T &  val)
inline

◆ SetDerivative()

void SU2_TYPE::SetDerivative ( su2double &  data,
const passivedouble &  val 
)
inline

Set the derivative value of the datatype (needs to be implemented for each new type).

Parameters
[in]data- The non-primitive datatype.
[in]val- The value of the derivative.

◆ SetSecondary()

void SU2_TYPE::SetSecondary ( su2double &  data,
const passivedouble &  val 
)
inline

Set the secondary value of the datatype (needs to be implemented for each new type).

Parameters
[in]data- The non-primitive datatype.
[in]val- The primitive value.

◆ SetValue()

void SU2_TYPE::SetValue ( su2double &  data,
const passivedouble &  val 
)
inline

Set the (primitive) value of the datatype (needs to be implemented for each new type).

Parameters
[in]data- The non-primitive datatype.
[in]val- The primitive value.

◆ Short()

short SU2_TYPE::Short ( const su2double &  data)
inline

Casts the primitive value to short (uses GetValue, already implemented for each type).

Parameters
[in]data- The non-primitive datatype.
Returns
- The primary value casted to short.

◆ sprintf() [1/2]

template<class... Ts>
void SU2_TYPE::sprintf ( char *  str,
const char *  format,
Ts &&...  args 
)
inline

Wrapper to sprintf to be able to print active types and AD expressions.

Note
This is for compatibility with old code, stringstreams should be the preferred way to build strings.
Parameters
[in]str- Target char buffer.
[in]format- Format string.
[in]args- Values to be printed to the string.

◆ sprintf() [2/2]

void SU2_TYPE::sprintf ( char *  str,
const char *  literal 
)
inline