49template<
typename S, std::size_t n,
55 std::function<S (
const C<S>&)>
_functionHelp { [](
const C<S>&){
return S{}; } };
64 std::function<S (
const C<S>&,
unsigned)> function,
65 std::function<
T (
const C<T>&,
unsigned)> adFunction,
72 std::function<S (
const C<S>&)> function,
73 std::function<
T (
const C<T>&)> adFunction,
82 const C<S>&
control,
unsigned optiStep=0)
override
88 C<S>& derivatives,
unsigned optiStep=0)
override
90 assert((
control.size() == derivatives.size()));
92 auto adControl = util::iniAD<n,S,C>(
control);
96 for(std::size_t it = 0; it <
control.size(); ++it){
97 derivatives[it] = adResult.
d(it);
106template<
typename S, std::
size_t n,
template<
typename>
typename SOLVER,
116 std::shared_ptr<SOLVER<T>> adSolver)
118 std::bind(&SOLVER<S>::postProcess, solver)),
129template<
typename S,
typename T,
template<
typename>
typename SOLVER>
The description of a algoritmic differentiation data type using the forward method – header file.
Derivatives are computed with automatic differentiation.
std::function< S(const C< S > &, unsigned) _function)
std::function< T(const C< T > &) _adFunctionHelp)
S evaluateObjective(const C< S > &control, unsigned optiStep=0) override
std::function< S(const C< S > &) _functionHelp)
std::function< T(const C< T > &, unsigned) _adFunction)
void computeDerivatives(const C< S > &control, C< S > &derivatives, unsigned optiStep=0) override
OptiCaseAD(std::function< S(const C< S > &, unsigned)> function, std::function< T(const C< T > &, unsigned)> adFunction, std::function< void(void)> postEvaluation=[](){})
OptiCaseAD(std::function< S(const C< S > &)> function, std::function< T(const C< T > &)> adFunction, std::function< void(void)> postEvaluation=[](){})
Interface for OptiCaseAD that performs Lattice-Boltzmann-Solver construction itself (from xml file)
OptiCaseAdForSolver(XMLreader const &xml)
OptiCaseAdForSolver(std::shared_ptr< SOLVER< S > > solver, std::shared_ptr< SOLVER< T > > adSolver)
std::shared_ptr< SOLVER< T > > _adSolver
std::shared_ptr< SOLVER< S > > _solver
Abstract base class for optimization tasks.
Definition of a description of a algoritmic differentiation data type using the forward method.
constexpr T & d(unsigned i)
OptiCaseAdForSolver(std::shared_ptr< SOLVER< S > >, std::shared_ptr< SOLVER< T > >) -> OptiCaseAdForSolver< S, T::dim, SOLVER, util::StdVector >
std::vector< S, std::allocator< S > > StdVector
Top level namespace for all of OpenLB.
std::shared_ptr< SOLVER > createLbSolver(XMLreader const &xml)
std::function< T(const std::vector< T > &, unsigned) getCallable)(std::shared_ptr< SOLVER > solver)
Returns a function that encapsulates the solving process.