deal.II version GIT relicensing-2171-g98af52917d 2024-11-23 14:40:00+00:00
|
#include <deal.II/differentiation/ad/ad_drivers.h>
Public Member Functions | |
void | allow_dependent_variable_marking () |
void | prevent_dependent_variable_marking () |
bool | is_dependent_variable_marking_allowed () const |
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 |
Static Public Member Functions | |
Configuration | |
static void | initialize_global_environment (const unsigned int n_independent_variables) |
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.
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 516 of file ad_drivers.h.
|
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.
[in] | n_independent_variables | The number of independent variables that will be used for the entire duration of the simulation. |
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 1430 of file ad_drivers.cc.
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 1438 of file ad_drivers.cc.
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 1446 of file ad_drivers.cc.
bool Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::is_dependent_variable_marking_allowed | ( | ) | const |
Query a flag as to whether or not dependent variables can be marked within the current phase of operations.
Definition at line 1454 of file ad_drivers.cc.
ScalarType Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::value | ( | const std::vector< ADNumberType > & | dependent_variables | ) | const |
Compute the value of the scalar field.
[in] | dependent_variables | The dependent variables whose values are to be extracted. |
Definition at line 1464 of file ad_drivers.cc.
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.
[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 1474 of file ad_drivers.cc.
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.
[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 1485 of file ad_drivers.cc.
void Differentiation::AD::TapelessDrivers< ADNumberType, ScalarType >::values | ( | const std::vector< ADNumberType > & | dependent_variables, |
Vector< ScalarType > & | values | ||
) | const |
Compute the values of the vector field.
[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 1496 of file ad_drivers.cc.
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.
[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 1506 of file ad_drivers.cc.