Reference documentation for deal.II version 9.4.1
Searching...
No Matches

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

[legend]

## Public Member Functions

Drivers for scalar functions
ScalarType value (const std::vector< ADNumberType > &dependent_variables) 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>

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
 ADNumberType A type corresponding to a supported auto-differentiable number. ScalarType A 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. T An arbitrary type resulting from the application of the SFINAE idiom to selectively specialize this class.

Definition at line 518 of file ad_drivers.h.

## ◆ initialize_global_environment()

template<typename ADNumberType , typename ScalarType >
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_variables The 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 >

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

Definition at line 1499 of file ad_drivers.cc.

## ◆ prevent_dependent_variable_marking()

template<typename ADNumberType , typename ScalarType >

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

Definition at line 1507 of file ad_drivers.cc.

## ◆ is_dependent_variable_marking_allowed()

template<typename ADNumberType , typename ScalarType >

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

Definition at line 1515 of file ad_drivers.cc.

## ◆ value()

template<typename ADNumberType , typename ScalarType >

Compute the value of the scalar field.

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

Definition at line 1525 of file ad_drivers.cc.

template<typename ADNumberType , typename ScalarType >

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

Parameters
 [in] independent_variables The independent variables whose sensitivities were tracked. [in] dependent_variables The (single) dependent variable whose gradients are to be extracted. [out] gradient The 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_variables The independent variables whose sensitivities were tracked. [in] dependent_variables The (single) dependent variable whose Hessians are to be extracted. [out] hessian The 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_variables The dependent variables whose Hessians are to be extracted. [out] values The 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_variables The independent variables whose sensitivities were tracked. [in] dependent_variables The dependent variables whose Jacobian are to be extracted. [out] jacobian The 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: