www.mooseframework.org
Public Types | Public Member Functions | Private Attributes | List of all members
MooseADWrapper< T > Class Template Reference

#include <MooseADWrapper.h>

Public Types

typedef T DNType
 

Public Member Functions

 MooseADWrapper ()
 
const T & value () const
 
T & value ()
 
const T & dn (bool requested_by_user=true) const
 
T & dn (bool requested_by_user=true)
 
void copyValueToDualNumber ()
 
void copyDualNumberToValue ()
 

Private Attributes

_val
 

Detailed Description

template<typename T>
class MooseADWrapper< T >

Definition at line 14 of file MooseADWrapper.h.

Member Typedef Documentation

◆ DNType

template<typename T>
typedef T MooseADWrapper< T >::DNType

Definition at line 19 of file MooseADWrapper.h.

Constructor & Destructor Documentation

◆ MooseADWrapper()

template<typename T>
MooseADWrapper< T >::MooseADWrapper ( )
inline

Definition at line 17 of file MooseADWrapper.h.

17 : _val() {}

Member Function Documentation

◆ copyDualNumberToValue()

template<typename T>
void MooseADWrapper< T >::copyDualNumberToValue ( )
inline

Definition at line 46 of file MooseADWrapper.h.

46 {}

◆ copyValueToDualNumber()

template<typename T>
void MooseADWrapper< T >::copyValueToDualNumber ( )
inline

Definition at line 45 of file MooseADWrapper.h.

45 {}

◆ dn() [1/2]

template<typename T>
const T& MooseADWrapper< T >::dn ( bool  requested_by_user = true) const
inline

Definition at line 25 of file MooseADWrapper.h.

Referenced by dataLoad(), and dataStore().

26  {
27  if (requested_by_user)
28  mooseError("Type ",
29  typeid(T).name(),
30  " does not currently support automatic differentiation. Consider using a regular "
31  "material property (declareProperty, getMaterialProperty) instead.");
32  return _val;
33  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ dn() [2/2]

template<typename T>
T& MooseADWrapper< T >::dn ( bool  requested_by_user = true)
inline

Definition at line 35 of file MooseADWrapper.h.

36  {
37  if (requested_by_user)
38  mooseError("Type ",
39  typeid(T).name(),
40  " does not currently support automatic differentiation. Consider using a regular "
41  "material property (declareProperty, getMaterialProperty) instead.");
42  return _val;
43  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ value() [1/2]

template<typename T>
const T& MooseADWrapper< T >::value ( ) const
inline

Definition at line 21 of file MooseADWrapper.h.

Referenced by dataLoad(), and dataStore().

21 { return _val; }

◆ value() [2/2]

template<typename T>
T& MooseADWrapper< T >::value ( )
inline

Definition at line 23 of file MooseADWrapper.h.

23 { return _val; }

Member Data Documentation

◆ _val

template<typename T>
T MooseADWrapper< T >::_val
private

The documentation for this class was generated from the following file: