OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::opti::OptiCaseAnalytical< S, C > Class Template Reference

Gradient is just passed as a function (and not computed by an own routine) More...

#include <optiCase.h>

+ Inheritance diagram for olb::opti::OptiCaseAnalytical< S, C >:
+ Collaboration diagram for olb::opti::OptiCaseAnalytical< S, C >:

Public Member Functions

 OptiCaseAnalytical (std::function< S(const C &)> function, std::function< void(const C &, C &)> derivative, std::function< void(void)> postEvaluation=[](){})
 
evaluateObjective (const C &control, unsigned optiStep=0) override
 
void computeDerivatives (const C &control, C &derivatives, unsigned optiStep=0) override
 
- Public Member Functions inherited from olb::opti::OptiCase< S, C >
 OptiCase ()=default
 
 OptiCase (std::function< void(void)> postEvaluation)
 
void postEvaluation ()
 

Protected Attributes

std::function< S(const C &) _function )
 
std::function< void(const C &, C &) _derivative )
 
- Protected Attributes inherited from olb::opti::OptiCase< S, C >
std::function< void(void)> _postEvaluation { [](){} }
 

Detailed Description

template<typename S, typename C>
class olb::opti::OptiCaseAnalytical< S, C >

Gradient is just passed as a function (and not computed by an own routine)

Definition at line 64 of file optiCase.h.

Constructor & Destructor Documentation

◆ OptiCaseAnalytical()

template<typename S , typename C >
olb::opti::OptiCaseAnalytical< S, C >::OptiCaseAnalytical ( std::function< S(const C &)> function,
std::function< void(const C &, C &)> derivative,
std::function< void(void)> postEvaluation = [](){} )
inline

Definition at line 71 of file optiCase.h.

73 {})
75 { }
std::function< S(const C &) _function)
Definition optiCase.h:67
std::function< void(const C &, C &) _derivative)
Definition optiCase.h:68
void postEvaluation()
Definition optiCase.h:56

Member Function Documentation

◆ computeDerivatives()

template<typename S , typename C >
void olb::opti::OptiCaseAnalytical< S, C >::computeDerivatives ( const C & control,
C & derivatives,
unsigned optiStep = 0 )
inlineoverridevirtual

Implements olb::opti::OptiCase< S, C >.

Definition at line 82 of file optiCase.h.

83 {
84 _derivative(control, derivatives);
85 }

References olb::opti::OptiCaseAnalytical< S, C >::_derivative, and olb::opti::control.

◆ evaluateObjective()

template<typename S , typename C >
S olb::opti::OptiCaseAnalytical< S, C >::evaluateObjective ( const C & control,
unsigned optiStep = 0 )
inlineoverridevirtual

Implements olb::opti::OptiCase< S, C >.

Definition at line 77 of file optiCase.h.

78 {
79 return _function(control);
80 }

References olb::opti::OptiCaseAnalytical< S, C >::_function, and olb::opti::control.

Member Data Documentation

◆ _derivative

template<typename S , typename C >
std::function<void (const C&, C&) olb::opti::OptiCaseAnalytical< S, C >::_derivative)
protected

Definition at line 68 of file optiCase.h.

◆ _function

template<typename S , typename C >
std::function<S (const C&) olb::opti::OptiCaseAnalytical< S, C >::_function)
protected

Definition at line 67 of file optiCase.h.


The documentation for this class was generated from the following file: