50 bool operator() (T output[],
const T input[])
override;
60 input2[0] = input[0] + _eps;
70template <
unsigned D,
typename T,
typename S>
77 bool operator() (T output[],
const S input[])
override;
84template <
unsigned D,
typename T,
typename S>
95 output[0] = outAD.
d(0);
103 typename T,
typename S,
unsigned sourceDIM,
113 typename F::template exchange_type<TAD,SAD>
_f;
117 :
AnalyticalF<sourceDIM,T,S>(targetDIM*sourceDIM),
_f(args...) { }
121 _f(f.template copyAs<
TAD,
SAD>()) { }
128 SAD inputAD[sourceDIM];
131 TAD outputAD[
_f.getTargetDim()];
133 _f(outputAD, inputAD);
149 typename F::targetType,
typename F::sourceType, F::dim>;
The description of a algoritmic differentiation data type using the forward method – header file.
Some helper functions for the ADf data type.
Class for AD Differentiation of 1-dim Functor F: S -> T.
bool operator()(T output[], const S input[]) override
AD Differentiation operator implementation.
AnalyticalF< D, TAD, SAD > & _f
AnalyticalDerivativeAD1D(AnalyticalF< D, TAD, SAD > &f)
bool operator()(T output[], const S input[]) override
Computes the partial derivatives of _f and writes them into output.
AnalyticalDerivativeAD(unsigned targetDIM, ARGS &&... args)
AnalyticalDerivativeAD(const F &f)
F::template exchange_type< TAD, SAD > _f
Class for computing the derivative of a given 1D functor with a finite difference.
AnalyticalF1D< T, T > & _f
AnalyticalDerivativeFD1D(AnalyticalF1D< T, T > &f, T eps)
AnalyticalDerivativeFD1D(AnalyticalF1D< T, T > &f)
bool operator()(T output[], const T input[]) override
Finite Difference computation.
int getTargetDim() const
read only access to member variable _n
Definition of a description of a algoritmic differentiation data type using the forward method.
constexpr void setDiffVariable(unsigned iD)
constexpr T & d(unsigned i)
void copyDerivatives(T *target, const TAD *source, int length)
Copy the derivatives from an ADf array into an array.
void copyN(T c[], const T a[], const unsigned dim) any_platform
void iniDiagonal(SAD *a, int dim)
The variables of an array are set to be the differential variables.
Top level namespace for all of OpenLB.
AnalyticalDerivativeAD(const F &) -> AnalyticalDerivativeAD< F, typename F::targetType, typename F::sourceType, F::dim >