Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
List of all members
Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType, T > Struct Template Reference

#include <deal.II/differentiation/ad/ad_drivers.h>

Inheritance diagram for Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType, T >:
[legend]

Public Member Functions

Drivers for scalar functions
ScalarType value (const std::vector< ADNumberType > &dependent_variables) const
 
void gradient (const std::vector< ADNumberType > &independent_variables, const std::vector< ADNumberType > &dependent_variables, Vector< ScalarType > &gradient) const
 
void hessian (const std::vector< ADNumberType > &independent_variables, const std::vector< ADNumberType > &dependent_variables, FullMatrix< ScalarType > &hessian) const
 
Drivers for vector functions
void values (const std::vector< ADNumberType > &dependent_variables, Vector< ScalarType > &values) const
 
void jacobian (const std::vector< ADNumberType > &independent_variables, const std::vector< ADNumberType > &dependent_variables, FullMatrix< ScalarType > &jacobian) const
 

Configuration

static void initialize_global_environment (const unsigned int n_independent_variables)
 
void allow_dependent_variable_marking ()
 
void prevent_dependent_variable_marking ()
 
bool is_dependent_variable_marking_allowed () const
 

Detailed Description

template<typename ADNumberType, typename ScalarType, typename T = void>
struct Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType, T >

A prototype driver class for tapeless auto-differentiable numbers.

It is intended that this class be specialized for the valid combinations of auto-differentiable numbers and output scalar number types.

Template Parameters
ADNumberTypeA type corresponding to a supported auto-differentiable number.
ScalarTypeA real or complex floating point number type that is the scalar value type used for input to, and output from, operations performed with auto-differentiable numbers.
TAn arbitrary type resulting from the application of the SFINAE idiom to selectively specialize this class.
Author
Jean-Paul Pelteret, 2017

Definition at line 522 of file ad_drivers.h.

Member Function Documentation

◆ initialize_global_environment()

template<typename ADNumberType , typename ScalarType >
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::initialize_global_environment ( const unsigned int  n_independent_variables)
static

In the event that the tapeless mode requires a priori knowledge of how many directional derivatives might need to be computed, this function informs the auto-differention library of what this number is.

Parameters
[in]n_independent_variablesThe number of independent variables that will be used for the entire duration of the simulation.
Warning
For ADOL-C tapeless numbers, the value given to n_independent_variables should be the maximum number of independent variables that will be used for the entire duration of the simulation. This is important in the context of, for example, hp-FEM and for multiple constitutive models with a different number of fields from which a linearization must be computed.

Definition at line 1491 of file ad_drivers.cc.

◆ allow_dependent_variable_marking()

template<typename ADNumberType , typename ScalarType >
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::allow_dependent_variable_marking

Operation status Set a flag that states that we can safely mark dependent variables within the current phase of operations.

Definition at line 1500 of file ad_drivers.cc.

◆ prevent_dependent_variable_marking()

template<typename ADNumberType , typename ScalarType >
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::prevent_dependent_variable_marking

Set a flag that states that we cannot safely mark dependent variables within the current phase of operations.

Definition at line 1508 of file ad_drivers.cc.

◆ is_dependent_variable_marking_allowed()

template<typename ADNumberType , typename ScalarType >
bool Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::is_dependent_variable_marking_allowed

Query a flag as to whether or not dependent variables can be marked within the current phase of operations.

Definition at line 1516 of file ad_drivers.cc.

◆ value()

template<typename ADNumberType , typename ScalarType >
ScalarType Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::value ( const std::vector< ADNumberType > &  dependent_variables) const

Compute the value of the scalar field.

Parameters
[in]dependent_variablesThe dependent variables whose values are to be extracted.
Returns
The scalar value of the function.

Definition at line 1525 of file ad_drivers.cc.

◆ gradient()

template<typename ADNumberType , typename ScalarType >
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::gradient ( const std::vector< ADNumberType > &  independent_variables,
const std::vector< ADNumberType > &  dependent_variables,
Vector< ScalarType > &  gradient 
) const

Compute the gradient of the scalar field with respect to all independent variables.

Parameters
[in]independent_variablesThe independent variables whose sensitivities were tracked.
[in]dependent_variablesThe (single) dependent variable whose gradients are to be extracted.
[out]gradientThe values of the dependent function's gradients. It is expected that this vector be of the correct size (with length n_independent_variables).

Definition at line 1535 of file ad_drivers.cc.

◆ hessian()

template<typename ADNumberType , typename ScalarType >
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::hessian ( const std::vector< ADNumberType > &  independent_variables,
const std::vector< ADNumberType > &  dependent_variables,
FullMatrix< ScalarType > &  hessian 
) const

Compute the Hessian of the scalar field with respect to all independent variables.

Parameters
[in]independent_variablesThe independent variables whose sensitivities were tracked.
[in]dependent_variablesThe (single) dependent variable whose Hessians are to be extracted.
[out]hessianThe values of the dependent function's Hessian. It is expected that this matrix be of the correct size (with dimensions n_independent_variables \(\times\)n_independent_variables).

Definition at line 1546 of file ad_drivers.cc.

◆ values()

template<typename ADNumberType , typename ScalarType >
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::values ( const std::vector< ADNumberType > &  dependent_variables,
Vector< ScalarType > &  values 
) const

Compute the values of the vector field.

Parameters
[in]dependent_variablesThe dependent variables whose Hessians are to be extracted.
[out]valuesThe component values of the dependent functions. It is expected that this vector be of the correct size (with length n_dependent_variables).

Definition at line 1557 of file ad_drivers.cc.

◆ jacobian()

template<typename ADNumberType , typename ScalarType >
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::jacobian ( const std::vector< ADNumberType > &  independent_variables,
const std::vector< ADNumberType > &  dependent_variables,
FullMatrix< ScalarType > &  jacobian 
) const

Compute the Jacobian of the vector field.

The Jacobian of a vector field is in essence the gradient of each dependent variable with respect to all independent variables. This operation is therefore analogous to the gradient() operation performed on a collection of scalar valued fields.

Parameters
[in]independent_variablesThe independent variables whose sensitivities were tracked.
[in]dependent_variablesThe dependent variables whose Jacobian are to be extracted.
[out]jacobianThe component values of the dependent functions' Jacobian. It is expected that this matrix be of the correct size (with dimensions n_dependent_variables \(\times\)n_independent_variables).

Definition at line 1567 of file ad_drivers.cc.


The documentation for this struct was generated from the following files: