DOpE
Public Member Functions | Static Public Member Functions | Protected Member Functions
DOpE::ReducedAlgorithm< PROBLEM, VECTOR > Class Template Referenceabstract

#include <reducedalgorithm.h>

Inheritance diagram for DOpE::ReducedAlgorithm< PROBLEM, VECTOR >:
DOpE::Reduced_IpoptAlgorithm< PROBLEM, VECTOR > DOpE::Reduced_SnoptAlgorithm< PROBLEM, VECTOR > DOpE::ReducedNewtonAlgorithm< PROBLEM, VECTOR > DOpE::ReducedTrustregion_NewtonAlgorithm< PROBLEM, VECTOR > DOpE::ReducedNewtonAlgorithmWithInverse< PROBLEM, VECTOR >

Public Member Functions

 ReducedAlgorithm (PROBLEM *OP, ReducedProblemInterface< PROBLEM, VECTOR > *S, ParameterReader &param_reader, DOpEExceptionHandler< VECTOR > *Except=NULL, DOpEOutputHandler< VECTOR > *Output=NULL, int base_priority=0)
 
virtual ~ReducedAlgorithm ()
 
virtual void ReInit ()
 
virtual int Solve (ControlVector< VECTOR > &q, double global_tol=-1.)=0
 
virtual void SolveForward (ControlVector< VECTOR > &q)
 
virtual void CheckGrads (double c, ControlVector< VECTOR > &q, ControlVector< VECTOR > &dq, unsigned int niter=1, double eps=1.)
 
virtual void FirstDifferenceQuotient (double exact, double eps, const ControlVector< VECTOR > &q, const ControlVector< VECTOR > &dq)
 
virtual void CheckHessian (double c, ControlVector< VECTOR > &q, ControlVector< VECTOR > &dq, unsigned int niter=1, double eps=1.)
 
virtual void SecondDifferenceQuotient (double exact, double eps, const ControlVector< VECTOR > &q, const ControlVector< VECTOR > &dq)
 
DOpEExceptionHandler< VECTOR > * GetExceptionHandler ()
 
DOpEOutputHandler< VECTOR > * GetOutputHandler ()
 

Static Public Member Functions

static void declare_params (ParameterReader &param_reader)
 

Protected Member Functions

PROBLEM * GetProblem ()
 
const PROBLEM * GetProblem () const
 
const ReducedProblemInterface
< PROBLEM, VECTOR > * 
GetReducedProblem () const
 
ReducedProblemInterface
< PROBLEM, VECTOR > * 
GetReducedProblem ()
 
int GetBasePriority () const
 

Detailed Description

template<typename PROBLEM, typename VECTOR>
class DOpE::ReducedAlgorithm< PROBLEM, VECTOR >

This class is the base class for solvers for equality constrained optimization problems in reduced form, i.e., the dependent variable is assumed to be eliminated by solving the equation. I.e., we solve the problem min j(q)

Template Parameters
<PROBLEM>The problem container. See, e.g., OptProblemContainer
<VECTOR>The vector type of the solution.

Constructor & Destructor Documentation

template<typename PROBLEM , typename VECTOR >
DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::ReducedAlgorithm ( PROBLEM *  OP,
ReducedProblemInterface< PROBLEM, VECTOR > *  S,
ParameterReader param_reader,
DOpEExceptionHandler< VECTOR > *  Except = NULL,
DOpEOutputHandler< VECTOR > *  Output = NULL,
int  base_priority = 0 
)

The constructor for the algorithm

Parameters
OPA pointer to the problem container
SThe reduced problem. This object handles the equality constraint. For the interface see ReducedProblemInterface.
param_readerA parameter reader to access user given runtime parameters.
ExceptThe DOpEExceptionHandler. This is used to handle the output by all exception.
OutputThe DOpEOutputHandler. This takes care of all output generated by the problem.
base_priorityAn offset for the priority of the output generated by the algorithm.
template<typename PROBLEM , typename VECTOR >
DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::~ReducedAlgorithm ( )
virtual

Member Function Documentation

template<typename PROBLEM , typename VECTOR >
void DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::CheckGrads ( double  c,
ControlVector< VECTOR > &  q,
ControlVector< VECTOR > &  dq,
unsigned int  niter = 1,
double  eps = 1. 
)
virtual

This function calculates j'(q)dq, i.e., the directional derivative and difference quotients for comparison to allow checking of the implementation of all things related to the first derivative of the functional once it is confirmed that functional evaluations are correct.

c The direction will be initialized to the constant value c.

Parameters
qThe point at which we calculate the derivative.
dqStorage or the direction.
niterNumber of difference quotient evaluations, i.e., how many times eps is reduced.
epsThe initial value for eps in the difference quotients.
template<typename PROBLEM , typename VECTOR >
void DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::CheckHessian ( double  c,
ControlVector< VECTOR > &  q,
ControlVector< VECTOR > &  dq,
unsigned int  niter = 1,
double  eps = 1. 
)
virtual

This function calculates dq*H(q)dq , i.e., some diagonal entry of the hessian and corresponting difference quotients for comparison.

c The direction will be initialized to the constant value c.

Parameters
qThe point at which we calculate the derivative.
dqStorage or the direction.
niterNumber of difference quotient evaluations, i.e., how many times eps is reduced.
epsThe initial value for eps in the difference quotients.
template<typename PROBLEM , typename VECTOR >
void DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::declare_params ( ParameterReader param_reader)
static

Used to declare run time parameters. This is needed to declare all parameters a startup without the need for an object to be already declared.

template<typename PROBLEM , typename VECTOR >
void DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::FirstDifferenceQuotient ( double  exact,
double  eps,
const ControlVector< VECTOR > &  q,
const ControlVector< VECTOR > &  dq 
)
virtual

Is called to calculate first difference quotients

exact The value of j'(q)

Parameters
epsThe value for eps in the difference quotient .
qThe point at which we try to approximate the derivative.
dqThe direction.
template<typename PROBLEM , typename VECTOR >
int DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::GetBasePriority ( ) const
inlineprotected
template<typename PROBLEM , typename VECTOR >
DOpEExceptionHandler<VECTOR>* DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::GetExceptionHandler ( )
inline
template<typename PROBLEM , typename VECTOR >
DOpEOutputHandler<VECTOR>* DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::GetOutputHandler ( )
inline
template<typename PROBLEM , typename VECTOR >
PROBLEM* DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::GetProblem ( )
inlineprotected

Grants access to the optimization problem container

template<typename PROBLEM , typename VECTOR >
const PROBLEM* DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::GetProblem ( ) const
inlineprotected

Grants access to the optimization problem container

template<typename PROBLEM , typename VECTOR >
const ReducedProblemInterface<PROBLEM,VECTOR>* DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::GetReducedProblem ( ) const
inlineprotected

Grants access to the reduced optimization problem

template<typename PROBLEM , typename VECTOR >
ReducedProblemInterface<PROBLEM,VECTOR>* DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::GetReducedProblem ( )
inlineprotected

Grants access to the reduced optimization problem

template<typename PROBLEM , typename VECTOR >
virtual void DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::ReInit ( )
inlinevirtual

Needs to be called once after changing the discretization, e.g., due to mesh changes, to reinitialize all dependent objects.

template<typename PROBLEM , typename VECTOR >
void DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::SecondDifferenceQuotient ( double  exact,
double  eps,
const ControlVector< VECTOR > &  q,
const ControlVector< VECTOR > &  dq 
)
virtual

Is called to calculate second difference quotients

exact The value of j'(q)

Parameters
epsThe value for eps in the difference quotient .
qThe point at which we try to approximate the derivative.
dqThe direction.
template<typename PROBLEM , typename VECTOR >
virtual int DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::Solve ( ControlVector< VECTOR > &  q,
double  global_tol = -1. 
)
pure virtual

Common interface for all algorithms solving a reduced problem.

Parameters
qThe initial point.
global_tolAn optional parameter specifying the required tolerance. The actual tolerance is the maximum of this and the one specified in the param file. Its default value is negative, so that it has no influence if not specified.

Implemented in DOpE::Reduced_IpoptAlgorithm< PROBLEM, VECTOR >, DOpE::ReducedNewtonAlgorithmWithInverse< PROBLEM, VECTOR >, DOpE::ReducedTrustregion_NewtonAlgorithm< PROBLEM, VECTOR >, DOpE::ReducedNewtonAlgorithm< PROBLEM, VECTOR >, and DOpE::Reduced_SnoptAlgorithm< PROBLEM, VECTOR >.

template<typename PROBLEM , typename VECTOR >
void DOpE::ReducedAlgorithm< PROBLEM, VECTOR >::SolveForward ( ControlVector< VECTOR > &  q)
virtual

This just evaluates j(q). And can be used to solve PDEs that do not require any control.

Parameters
qThe initial point.

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