OpenLB 1.7
Loading...
Searching...
No Matches
Namespaces | Functions
adHelpers.h File Reference

Some helper functions for the ADf data type. More...

#include "aDiff.h"
+ Include dependency graph for adHelpers.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  olb
 Top level namespace for all of OpenLB.
 
namespace  olb::util
 

Functions

template<typename SAD >
void olb::util::iniDiagonal (SAD *a, int dim)
 The variables of an array are set to be the differential variables.
 
template<typename C >
void olb::util::iniDiagonal (C &a)
 
template<typename T , typename TAD >
void olb::util::copyDerivatives (T *target, const TAD *source, int length)
 Copy the derivatives from an ADf array into an array.
 
template<typename T , typename S , template< typename > typename C>
C< T > olb::util::copyAs (const C< S > &input)
 copy vector with specified typecast
 
template<typename S >
ADf< S, 1 > olb::util::iniAD (const S source)
 copy value and initialize derivative
 
template<unsigned n, typename S >
ADf< S, n > * olb::util::iniAD (const S *source)
 copy array values and initialize derivatives
 
template<unsigned n, typename S , template< typename > typename C>
C< ADf< S, n > > olb::util::iniAD (const C< S > &source)
 copy values and initialize derivatives
 
template<typename S , typename F >
auto olb::util::derivativeFAD (F f, const S input)
 Compute derivatives of a function f: S -> T via forward AD Signature is "V f(U)" so f is expected to accept and return a single value.
 
template<unsigned sourceDIM, typename S , typename F >
auto olb::util::derivativeFAD (F f, const S *input)
 Compute derivatives of a function f: S^sourceDIM -> T via forward AD Signature is "V f(U*)" so f is expected to return a single value.
 
template<unsigned sourceDIM, typename T , typename S , typename F >
void olb::util::derivativeFAD (F f, T *output, const S *input, unsigned targetDIM)
 Compute derivatives of a function f: S^sourceDIM -> T^targetDIM via forward AD Signature of f is "void f(V*, U*)", it is expected to modify the first argument in-place.
 

Detailed Description

Some helper functions for the ADf data type.

Definition in file adHelpers.h.