16 #ifndef dealii_differentiation_ad_ad_helpers_h 17 #define dealii_differentiation_ad_ad_helpers_h 19 #include <deal.II/base/config.h> 21 #if defined(DEAL_II_WITH_ADOLC) || defined(DEAL_II_TRILINOS_WITH_SACADO) 23 # include <deal.II/base/numbers.h> 25 # include <deal.II/base/tensor.h> 27 # include <deal.II/differentiation/ad/ad_drivers.h> 28 # include <deal.II/differentiation/ad/ad_number_traits.h> 29 # include <deal.II/differentiation/ad/adolc_number_types.h> 30 # include <deal.II/differentiation/ad/adolc_product_types.h> 31 # include <deal.II/differentiation/ad/sacado_number_types.h> 32 # include <deal.II/differentiation/ad/sacado_product_types.h> 34 # include <deal.II/fe/fe_values_extractors.h> 36 # include <deal.II/lac/full_matrix.h> 37 # include <deal.II/lac/vector.h> 45 DEAL_II_NAMESPACE_OPEN
171 typename ScalarType =
double>
246 print(std::ostream &stream)
const;
269 std::ostream & stream)
const;
298 const bool ensure_persistent_setting =
true);
347 const bool clear_registered_tapes =
true);
455 const bool overwrite_tape =
false,
456 const bool keep_independent_values =
true);
622 const bool read_mode);
839 typename ScalarType =
double>
929 template <
typename VectorType>
932 const VectorType & values,
933 const std::vector<::types::global_dof_index> &local_dof_indices);
955 const std::vector<ad_type> &
1004 template <
typename VectorType>
1007 const VectorType & values,
1008 const std::vector<::types::global_dof_index> &local_dof_indices);
1223 typename ScalarType =
double>
1538 typename ScalarType =
double>
1659 template <
int dim,
typename ExtractorType>
1674 static const unsigned int n_components = 1;
1679 static const unsigned int rank = 0;
1684 template <
typename NumberType>
1689 "The number of components doesn't match that of the corresponding tensor type.");
1692 "The rank doesn't match that of the corresponding tensor type.");
1701 template <
typename NumberType>
1707 template <
typename NumberType>
1713 static inline unsigned int 1729 (void)unrolled_index;
1740 template <
typename IndexType =
unsigned int,
int rank_in>
1743 const unsigned int column_offset)
1746 (void)table_indices;
1747 (void)column_offset;
1764 static const unsigned int n_components = dim;
1769 static const unsigned int rank = 1;
1774 template <
typename NumberType>
1779 "The number of components doesn't match that of the corresponding tensor type.");
1782 "The rank doesn't match that of the corresponding tensor type.");
1787 template <
typename NumberType>
1793 template <
typename NumberType>
1799 static inline unsigned int 1816 (void)unrolled_index;
1824 template <
int rank_in>
1827 const unsigned int column_offset)
1848 template <
typename IndexType =
unsigned int,
int rank_in>
1851 const unsigned int column_offset)
1855 "Cannot extract more table indices than the input table has!");
1857 return TensorType::component_to_unrolled_index(
1858 table_index_view(table_indices, column_offset));
1874 static const unsigned int n_components =
1880 static const unsigned int rank = 1;
1885 template <
typename NumberType>
1891 template <
typename NumberType>
1897 template <
typename NumberType>
1903 static inline unsigned int 1919 (void)unrolled_index;
1927 template <
int rank_in>
1930 const unsigned int column_offset)
1951 template <
typename IndexType =
unsigned int,
int rank_in>
1954 const unsigned int column_offset)
1958 "Cannot extract more table indices than the input table has!");
1960 return TensorType::component_to_unrolled_index(
1961 table_index_view(table_indices, column_offset));
1977 static const unsigned int n_components =
1988 template <
typename NumberType>
1994 template <
typename NumberType>
2000 template <
typename NumberType>
2006 static inline unsigned int 2022 (void)unrolled_index;
2030 template <
int rank_in>
2033 const unsigned int column_offset)
2038 table_indices[column_offset + 1]);
2056 template <
typename IndexType =
unsigned int,
int rank_in>
2059 const unsigned int column_offset)
2063 "Cannot extract more table indices than the input table has!");
2065 return TensorType::component_to_unrolled_index(
2066 table_index_view(table_indices, column_offset));
2082 static const unsigned int n_components =
2093 template <
typename NumberType>
2099 template <
typename NumberType>
2105 template <
typename NumberType>
2111 static inline unsigned int 2130 return table_indices[0] != table_indices[1];
2137 template <
int rank_in>
2140 const unsigned int column_offset)
2145 table_indices[column_offset + 1]);
2163 template <
typename IndexType =
unsigned int,
int rank_in>
2166 const unsigned int column_offset)
2170 "Cannot extract more table indices than the input table has!");
2172 return TensorType::component_to_unrolled_index(
2173 table_index_view(table_indices, column_offset));
2183 template <
int dim,
typename NumberType,
typename ExtractorType>
2192 ExtractorType>::template tensor_type<NumberType>;
2205 template <
typename ExtractorType_Row,
typename ExtractorType_Col>
2219 template <
int rank,
int dim,
typename NumberType>
2243 template <
int ,
int dim,
typename NumberType>
2268 template <
int ,
int dim,
typename NumberType>
2292 template <
int ,
int dim,
typename NumberType>
2308 typename ExtractorType_Row,
2309 typename ExtractorType_Col>
2334 template <
int dim,
typename NumberType,
typename ExtractorType_Field>
2350 typename ExtractorType_Field,
2351 typename ExtractorType_Derivative>
2354 ExtractorType_Field,
2355 ExtractorType_Derivative>;
2364 typename IndexType =
unsigned int,
2365 typename ExtractorType>
2366 std::vector<IndexType>
2368 const bool ignore_symmetries =
true)
2370 (void)ignore_symmetries;
2371 const IndexType n_components =
2373 const IndexType comp_first =
2375 std::vector<IndexType> indices(n_components);
2376 std::iota(indices.begin(), indices.end(), comp_first);
2389 template <
int dim,
typename IndexType =
unsigned int>
2390 std::vector<IndexType>
2393 const bool ignore_symmetries =
true)
2396 const IndexType n_components =
2398 if (ignore_symmetries ==
true)
2400 const IndexType comp_first =
2402 extractor_symm_tensor);
2403 std::vector<IndexType> indices(n_components);
2404 std::iota(indices.begin(), indices.end(), comp_first);
2412 std::vector<IndexType> indices =
2413 extract_field_component_indices<dim>(extractor_tensor,
true);
2417 for (
unsigned int i = 0; i < indices.size(); ++i)
2419 if (indices[i] >= n_components)
2423 const IndexType sti_new_index =
2426 indices[i] = sti_new_index;
2439 template <
typename TensorType,
typename NumberType>
2442 const unsigned int &unrolled_index,
2446 Assert(unrolled_index < t.n_independent_components,
2447 ExcIndexRange(unrolled_index, 0, t.n_independent_components));
2448 t[TensorType::unrolled_to_component_indices(unrolled_index)] = value;
2456 template <
int dim,
typename NumberType>
2458 const unsigned int & unrolled_index,
2462 (void)unrolled_index;
2472 template <
typename NumberType>
2475 const unsigned int &unrolled_index,
2479 (void)unrolled_index;
2489 template <
int dim,
typename NumberType>
2491 const unsigned int &unrolled_index_row,
2492 const unsigned int &unrolled_index_col,
2498 Assert(unrolled_index_row < SubTensorType::n_independent_components,
2501 SubTensorType::n_independent_components));
2502 Assert(unrolled_index_col < SubTensorType::n_independent_components,
2505 SubTensorType::n_independent_components));
2507 SubTensorType::unrolled_to_component_indices(unrolled_index_row);
2509 SubTensorType::unrolled_to_component_indices(unrolled_index_col);
2510 t[indices_row[0]][indices_row[1]][indices_col[0]][indices_col[1]] =
2521 typename NumberType,
2522 template <
int,
int,
typename>
class TensorType>
2525 const unsigned int & unrolled_index)
2528 Assert(unrolled_index < t.n_independent_components,
2529 ExcIndexRange(unrolled_index, 0, t.n_independent_components));
2530 return t[TensorType<rank, dim, NumberType>::
2531 unrolled_to_component_indices(unrolled_index)];
2540 typename NumberType,
2541 template <
int,
int,
typename>
class TensorType>
2544 const unsigned int & unrolled_index)
2547 (void)unrolled_index;
2557 template <
typename NumberType>
2558 inline const NumberType &
2562 (void)unrolled_index;
2573 typename NumberType,
2574 template <
int,
int,
typename>
class TensorType>
2577 const unsigned int & unrolled_index)
2580 Assert(unrolled_index < t.n_independent_components,
2581 ExcIndexRange(unrolled_index, 0, t.n_independent_components));
2582 return t[TensorType<rank, dim, NumberType>::
2583 unrolled_to_component_indices(unrolled_index)];
2592 typename NumberType,
2593 template <
int,
int,
typename>
class TensorType>
2595 const unsigned int & index)
2608 template <
typename NumberType>
2646 typename ScalarType =
double>
2648 :
public HelperBase<ADNumberTypeCode, ScalarType>
2713 const bool clear_registered_tapes =
true)
override;
2761 template <
typename ValueType,
typename ExtractorType>
2764 const ExtractorType &extractor);
2786 const std::vector<ad_type> &
2814 template <
typename ExtractorType>
2816 ExtractorType>::template tensor_type<ad_type>
2872 template <
typename ValueType,
typename ExtractorType>
2875 const ExtractorType &extractor);
2897 const bool symmetric_component,
3093 typename ScalarType =
double>
3230 template <
typename ExtractorType_Row>
3234 const ExtractorType_Row & extractor_row);
3274 template <
typename ExtractorType_Row,
typename ExtractorType_Col>
3278 ExtractorType_Col>::type
3280 const ExtractorType_Row & extractor_row,
3281 const ExtractorType_Col & extractor_col);
3486 typename ScalarType =
double>
3572 template <
typename ValueType,
typename ExtractorType>
3575 const ExtractorType &extractor);
3618 template <
typename ExtractorType_Row>
3622 const ExtractorType_Row & extractor_row);
3671 template <
typename ExtractorType_Row,
typename ExtractorType_Col>
3675 ExtractorType_Col>::type
3677 const ExtractorType_Row & extractor_row,
3678 const ExtractorType_Col & extractor_col);
3742 template <enum AD::NumberTypes ADNumberTypeCode,
typename ScalarType>
3743 template <
typename VectorType>
3746 const VectorType & values,
3747 const std::vector<::types::global_dof_index> &local_dof_indices)
3754 local_dof_indices.size() == this->n_independent_variables(),
3756 "Degree of freedom index vector size does not match number of independent variables"));
3757 for (
unsigned int i = 0; i < this->n_independent_variables(); ++i)
3759 Assert(this->registered_independent_variable_values[i] ==
false,
3760 ExcMessage(
"Independent variables already registered."));
3762 set_dof_values(values, local_dof_indices);
3767 template <enum AD::NumberTypes ADNumberTypeCode,
typename ScalarType>
3768 template <
typename VectorType>
3771 const VectorType & values,
3772 const std::vector<::types::global_dof_index> &local_dof_indices)
3774 Assert(local_dof_indices.size() == this->n_independent_variables(),
3776 "Vector size does not match number of independent variables"));
3777 for (
unsigned int i = 0; i < this->n_independent_variables(); ++i)
3779 i, values[local_dof_indices[i]]);
3790 typename ScalarType>
3791 template <
typename ValueType,
typename ExtractorType>
3795 const ExtractorType &extractor)
3802 const std::vector<unsigned int> index_set(
3803 internal::extract_field_component_indices<dim>(extractor));
3804 for (
unsigned int i = 0; i < index_set.size(); ++i)
3807 this->registered_independent_variable_values[index_set[i]] ==
false,
3809 "Overlapping indices for independent variables. " 3810 "One or more indices associated with the field that " 3811 "is being registered as an independent variable have " 3812 "already been associated with another field. This suggests " 3813 "that the component offsets used to construct their counterpart " 3814 "extractors are incompatible with one another. Make sure that " 3815 "the first component for each extractor properly takes into " 3816 "account the dimensionality of the preceding fields."));
3819 set_independent_variable(value, extractor);
3826 typename ScalarType>
3827 template <
typename ValueType,
typename ExtractorType>
3831 const ExtractorType &extractor)
3833 const std::vector<unsigned int> index_set(
3834 internal::extract_field_component_indices<dim>(extractor));
3835 for (
unsigned int i = 0; i < index_set.size(); ++i)
3837 set_sensitivity_value(
3839 internal::Extractor<dim, ExtractorType>::symmetric_component(i),
3848 typename ScalarType>
3849 template <
typename ExtractorType>
3850 typename internal::Extractor<dim, ExtractorType>::template tensor_type<
3855 if (ADNumberTraits<ad_type>::is_taped ==
true)
3857 Assert(this->active_tape_index() !=
3864 this->finalize_sensitive_independent_variables();
3865 Assert(this->independent_variables.size() ==
3866 this->n_independent_variables(),
3868 this->n_independent_variables()));
3870 const std::vector<unsigned int> index_set(
3871 internal::extract_field_component_indices<dim>(extractor));
3872 typename internal::Extractor<dim,
3873 ExtractorType>::template tensor_type<ad_type>
3876 for (
unsigned int i = 0; i < index_set.size(); ++i)
3878 const unsigned int index = index_set[i];
3880 Assert(this->registered_independent_variable_values[index] ==
true,
3883 this->independent_variables[index];
3897 typename ScalarType>
3898 template <
typename ExtractorType_Row>
3899 typename internal::ScalarFieldGradient<
3902 ExtractorType_Row>::type
3905 const ExtractorType_Row & extractor_row)
3914 const std::vector<unsigned int> row_index_set(
3915 internal::extract_field_component_indices<dim>(extractor_row));
3916 Assert(out.n_independent_components == row_index_set.size(),
3917 ExcMessage(
"Not all tensor components have been extracted!"));
3918 for (
unsigned int r = 0; r < row_index_set.size(); ++r)
3928 typename ScalarType>
3929 template <
typename ExtractorType_Row,
typename ExtractorType_Col>
3930 typename internal::ScalarFieldHessian<
3934 ExtractorType_Col>::type
3937 const ExtractorType_Row & extractor_row,
3938 const ExtractorType_Col & extractor_col)
3940 using InternalHessian = internal::ScalarFieldHessian<dim,
3944 using InternalExtractorRow = internal::Extractor<dim, ExtractorType_Row>;
3945 using InternalExtractorCol = internal::Extractor<dim, ExtractorType_Col>;
3946 using HessianType =
typename InternalHessian::type;
3962 const std::vector<unsigned int> row_index_set(
3963 internal::extract_field_component_indices<dim>(
3964 extractor_row,
false ));
3965 const std::vector<unsigned int> col_index_set(
3966 internal::extract_field_component_indices<dim>(
3967 extractor_col,
false ));
3969 for (
unsigned int index = 0;
3970 index < HessianType::n_independent_components;
3974 HessianType::unrolled_to_component_indices(index);
3975 const unsigned int r =
3976 InternalExtractorRow::local_component(ti_out, 0);
3977 const unsigned int c =
3978 InternalExtractorCol::local_component(ti_out,
3979 InternalExtractorRow::rank);
3982 out, index, hessian[row_index_set[r]][col_index_set[c]]);
3996 typename ScalarType>
3997 template <
typename ValueType,
typename ExtractorType>
4001 const ExtractorType &extractor)
4003 const std::vector<unsigned int> index_set(
4004 internal::extract_field_component_indices<dim>(extractor));
4005 for (
unsigned int i = 0; i < index_set.size(); ++i)
4007 Assert(this->registered_marked_dependent_variables[index_set[i]] ==
4009 ExcMessage(
"Overlapping indices for dependent variables."));
4019 typename ScalarType>
4020 template <
typename ExtractorType_Row>
4024 ExtractorType_Row>::type
4026 const Vector<scalar_type> &values,
4027 const ExtractorType_Row & extractor_row)
4031 typename internal::VectorFieldValue<dim, scalar_type, ExtractorType_Row>::
4036 const std::vector<unsigned int> row_index_set(
4037 internal::extract_field_component_indices<dim>(extractor_row));
4038 Assert(out.n_independent_components == row_index_set.size(),
4039 ExcMessage(
"Not all tensor components have been extracted!"));
4040 for (
unsigned int r = 0; r < row_index_set.size(); ++r)
4050 typename ScalarType>
4051 template <
typename ExtractorType_Row,
typename ExtractorType_Col>
4056 ExtractorType_Col>::type
4059 const ExtractorType_Row & extractor_row,
4060 const ExtractorType_Col & extractor_col)
4066 using InternalExtractorRow = internal::Extractor<dim, ExtractorType_Row>;
4067 using InternalExtractorCol = internal::Extractor<dim, ExtractorType_Col>;
4068 using JacobianType =
typename InternalJacobian::type;
4084 const std::vector<unsigned int> row_index_set(
4085 internal::extract_field_component_indices<dim>(
4086 extractor_row,
false ));
4087 const std::vector<unsigned int> col_index_set(
4088 internal::extract_field_component_indices<dim>(
4089 extractor_col,
false ));
4091 for (
unsigned int index = 0;
4092 index < JacobianType::n_independent_components;
4096 JacobianType::unrolled_to_component_indices(index);
4097 const unsigned int r =
4098 InternalExtractorRow::local_component(ti_out, 0);
4099 const unsigned int c =
4100 InternalExtractorCol::local_component(ti_out,
4101 InternalExtractorRow::rank);
4104 out, index, jacobian[row_index_set[r]][col_index_set[c]]);
4118 DEAL_II_NAMESPACE_CLOSE
4120 #endif // defined(DEAL_II_WITH_ADOLC) || defined(DEAL_II_TRILINOS_WITH_SACADO) 4122 #endif // dealii_differentiation_ad_ad_helpers_h TapedDrivers< ad_type, scalar_type > taped_driver
virtual void reset(const unsigned int n_independent_variables=::numbers::invalid_unsigned_int, const unsigned int n_dependent_variables=::numbers::invalid_unsigned_int, const bool clear_registered_tapes=true)
bool is_recording() const
static const unsigned int invalid_unsigned_int
HelperBase(const unsigned int n_independent_variables, const unsigned int n_dependent_variables)
PointLevelFunctionsBase(const unsigned int n_independent_variables, const unsigned int n_dependent_variables)
static unsigned int component_to_unrolled_index(const TableIndices< rank_ > &indices)
void compute_jacobian(FullMatrix< scalar_type > &jacobian) const
VectorFunction(const unsigned int n_independent_variables, const unsigned int n_dependent_variables)
void set_sensitivity_value(const unsigned int index, const scalar_type &value)
std::vector< IndexType > extract_field_component_indices(const ExtractorType &extractor, const bool ignore_symmetries=true)
scalar_type compute_energy() const
void mark_independent_variable(const unsigned int index, ad_type &out) const
void set_tensor_entry(TensorType &t, const unsigned int &unrolled_index, const NumberType &value)
void compute_residual(Vector< scalar_type > &residual) const override
CellLevelBase(const unsigned int n_independent_variables, const unsigned int n_dependent_variables)
void register_independent_variables(const std::vector< scalar_type > &values)
virtual ~ScalarFunction()=default
typename HelperBase< ADNumberTypeCode, ScalarType >::scalar_type scalar_type
static internal::VectorFieldJacobian< dim, scalar_type, ExtractorType_Row, ExtractorType_Col >::type extract_jacobian_component(const FullMatrix< scalar_type > &jacobian, const ExtractorType_Row &extractor_row, const ExtractorType_Col &extractor_col)
static internal::ScalarFieldHessian< dim, scalar_type, ExtractorType_Row, ExtractorType_Col >::type extract_hessian_component(const FullMatrix< scalar_type > &hessian, const ExtractorType_Row &extractor_row, const ExtractorType_Col &extractor_col)
virtual void compute_residual(Vector< scalar_type > &residual) const override
typename Extractor< dim, ExtractorType >::template tensor_type< NumberType > type
void set_tape_buffer_sizes(const typename Types< ad_type >::tape_buffer_sizes obufsize=64 *1024 *1024, const typename Types< ad_type >::tape_buffer_sizes lbufsize=64 *1024 *1024, const typename Types< ad_type >::tape_buffer_sizes vbufsize=64 *1024 *1024, const typename Types< ad_type >::tape_buffer_sizes tbufsize=64 *1024 *1024)
void register_independent_variable(const ValueType &value, const ExtractorType &extractor)
const std::vector< ad_type > & get_sensitive_dof_values() const
unsigned int tape_buffer_sizes
void register_dependent_variable(const ad_type &func)
void stop_recording_operations(const bool write_tapes_to_file=false)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
virtual void compute_linearization(FullMatrix< scalar_type > &linearization) const =0
void compute_gradient(Vector< scalar_type > &gradient) const
static void configure_tapeless_mode(const unsigned int n_independent_variables, const bool ensure_persistent_setting=true)
std::vector< scalar_type > independent_variable_values
Types< ad_type >::tape_index active_tape_index() const
LinearAlgebra::distributed::Vector< Number > Vector
std::vector< bool > symmetric_independent_variables
static const unsigned int dimension
void set_sensitivity_value(const unsigned int index, const bool symmetric_component, const scalar_type &value)
std::vector< bool > registered_marked_independent_variables
ResidualLinearization(const unsigned int n_independent_variables, const unsigned int n_dependent_variables)
static internal::ScalarFieldGradient< dim, scalar_type, ExtractorType_Row >::type extract_gradient_component(const Vector< scalar_type > &gradient, const ExtractorType_Row &extractor_row)
static const Types< ADNumberType >::tape_index invalid_tape_index
bool start_recording_operations(const typename Types< ad_type >::tape_index tape_index, const bool overwrite_tape=false, const bool keep_independent_values=true)
void compute_values(Vector< scalar_type > &values) const
unsigned int n_symmetric_independent_variables() const
void reset_registered_dependent_variables(const bool flag=false)
void register_dependent_variable(const unsigned int index, const ad_type &func)
void print_values(std::ostream &stream) const
virtual ~HelperBase()=default
static ::ExceptionBase & ExcMessage(std::string arg1)
typename HessianType< ExtractorType_Row, ExtractorType_Col >::template type< rank, dim, NumberType > type
std::vector< ad_type > dependent_variables
typename AD::NumberTraits< ScalarType, ADNumberTypeCode >::ad_type ad_type
virtual void compute_linearization(FullMatrix< scalar_type > &linearization) const override
void compute_hessian(FullMatrix< scalar_type > &hessian) const
std::size_t n_independent_variables() const
typename AD::NumberTraits< ScalarType, ADNumberTypeCode >::scalar_type scalar_type
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void reset_registered_independent_variables()
std::vector< bool > registered_marked_dependent_variables
ScalarFunction(const unsigned int n_independent_variables)
scalar_type compute_value() const
void register_dependent_variable(const ValueType &funcs, const ExtractorType &extractor)
unsigned int n_registered_dependent_variables() const
virtual void reset(const unsigned int n_independent_variables=::numbers::invalid_unsigned_int, const unsigned int n_dependent_variables=::numbers::invalid_unsigned_int, const bool clear_registered_tapes=true) override
void register_energy_functional(const ad_type &energy)
virtual ~VectorFunction()=default
ScalarFieldHessian< dim, NumberType, ExtractorType_Field, ExtractorType_Derivative > VectorFieldJacobian
void print(std::ostream &stream) const
static TableIndices< rank_ > unrolled_to_component_indices(const unsigned int i)
void finalize_sensitive_independent_variables() const
ScalarFieldGradient< dim, NumberType, ExtractorType_Field > VectorFieldValue
virtual void compute_linearization(FullMatrix< scalar_type > &linearization) const override
bool is_symmetric_independent_variable(const unsigned int index) const
void register_dof_values(const std::vector< scalar_type > &dof_values)
NumberType get_tensor_entry(const TensorType< rank, dim, NumberType > &t, const unsigned int &unrolled_index)
bool active_tape_requires_retaping() const
virtual ~EnergyFunctional()=default
void register_dependent_variables(const std::vector< ad_type > &funcs)
std::vector< bool > registered_independent_variable_values
static internal::VectorFieldValue< dim, scalar_type, ExtractorType_Row >::type extract_value_component(const Vector< scalar_type > &values, const ExtractorType_Row &extractor_row)
virtual void compute_residual(Vector< scalar_type > &residual) const =0
void initialize_non_sensitive_independent_variable(const unsigned int index, ad_type &out) const
bool recorded_tape_requires_retaping(const typename Types< ad_type >::tape_index tape_index) const
void set_independent_variable(const ValueType &value, const ExtractorType &extractor)
void register_residual_vector(const std::vector< ad_type > &residual)
virtual ~PointLevelFunctionsBase()=default
void print_tape_stats(const typename Types< ad_type >::tape_index tape_index, std::ostream &stream) const
TapelessDrivers< ad_type, scalar_type > tapeless_driver
bool is_registered_tape(const typename Types< ad_type >::tape_index tape_index) const
virtual ~ResidualLinearization()=default
std::vector< ad_type > independent_variables
std::size_t n_dependent_variables() const
void activate_recorded_tape(const typename Types< ad_type >::tape_index tape_index)
typename HelperBase< ADNumberTypeCode, ScalarType >::scalar_type scalar_type
void set_independent_variables(const std::vector< scalar_type > &values)
virtual ~CellLevelBase()=default
EnergyFunctional(const unsigned int n_independent_variables)
const std::vector< ad_type > & get_sensitive_variables() const
void set_dof_values(const std::vector< scalar_type > &dof_values)
unsigned int n_registered_independent_variables() const
static ::ExceptionBase & ExcInternalError()
void activate_tape(const typename Types< ad_type >::tape_index tape_index, const bool read_mode)