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

#include <reducedprobleminterface.h>

Inheritance diagram for DOpE::ReducedProblemInterface< PROBLEM, VECTOR >:
DOpE::ReducedProblemInterface_Base< VECTOR > DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim > DOpE::StatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >

Public Member Functions

 ReducedProblemInterface (PROBLEM *OP, int base_priority=0)
 
 ~ReducedProblemInterface ()
 
virtual void ReInit ()
 
virtual bool ComputeReducedConstraints (const ControlVector< VECTOR > &q, ConstraintVector< VECTOR > &g)=0
 
virtual void GetControlBoxConstraints (ControlVector< VECTOR > &lb, ControlVector< VECTOR > &ub)=0
 
virtual void ComputeReducedGradient (const ControlVector< VECTOR > &q, ControlVector< VECTOR > &gradient, ControlVector< VECTOR > &gradient_transposed)=0
 
virtual double ComputeReducedCostFunctional (const ControlVector< VECTOR > &q)=0
 
virtual void ComputeReducedFunctionals (const ControlVector< VECTOR > &q)=0
 
virtual void ComputeReducedHessianVector (const ControlVector< VECTOR > &q, const ControlVector< VECTOR > &direction, ControlVector< VECTOR > &hessian_direction, ControlVector< VECTOR > &hessian_direction_transposed)=0
 
virtual void ComputeReducedHessianInverseVector (const ControlVector< VECTOR > &, const ControlVector< VECTOR > &, ControlVector< VECTOR > &)
 
virtual void ComputeReducedGradientOfGlobalConstraints (unsigned int, const ControlVector< VECTOR > &, const ConstraintVector< VECTOR > &, ControlVector< VECTOR > &, ControlVector< VECTOR > &)
 
void SetProblemType (std::string type, unsigned int num=0)
 
PROBLEM * GetProblem ()
 
const PROBLEM * GetProblem () const
 
template<class DWRC >
void InitializeDWRC (DWRC &dwrc)
 
- Public Member Functions inherited from DOpE::ReducedProblemInterface_Base< VECTOR >
 ReducedProblemInterface_Base ()
 
virtual ~ReducedProblemInterface_Base ()
 
virtual void StateSizeInfo (std::stringstream &out)=0
 
virtual void WriteToFile (const VECTOR &v, std::string name, std::string outfile, std::string dof_type, std::string filetype)=0
 
virtual void WriteToFileElementwise (const Vector< double > &, std::string, std::string, std::string, std::string)
 
virtual void WriteToFile (const ControlVector< VECTOR > &v, std::string name, std::string dof_type)=0
 
virtual void WriteToFile (const std::vector< double > &v, std::string outfile)=0
 
void RegisterOutputHandler (DOpEOutputHandler< VECTOR > *OH)
 
void RegisterExceptionHandler (DOpEExceptionHandler< VECTOR > *OH)
 
DOpEExceptionHandler< VECTOR > * GetExceptionHandler ()
 
DOpEOutputHandler< VECTOR > * GetOutputHandler ()
 
double GetFunctionalValue (std::string name) const
 
const std::vector< double > & GetTimeFunctionalValue (std::string name) const
 
void AddUserDomainData (std::string name, const VECTOR *new_data)
 
void DeleteUserDomainData (std::string name)
 

Protected Member Functions

virtual const std::map
< std::string, unsigned int > & 
GetFunctionalPosition () const
 
std::string GetPostIndex () const
 
int GetBasePriority () const
 
- Protected Member Functions inherited from DOpE::ReducedProblemInterface_Base< VECTOR >
void InitializeFunctionalValues (unsigned int N)
 
std::vector< std::vector
< double > > & 
GetFunctionalValues ()
 
const std::vector< std::vector
< double > > & 
GetFunctionalValues () const
 
const std::map< std::string,
const VECTOR * > & 
GetUserDomainData () const
 

Detailed Description

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

A template for different solver types to be used for solving PDE- as well as optimization problems.

Constructor & Destructor Documentation

template<typename PROBLEM, typename VECTOR>
DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ReducedProblemInterface ( PROBLEM *  OP,
int  base_priority = 0 
)
inline
template<typename PROBLEM, typename VECTOR>
DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::~ReducedProblemInterface ( )
inline

Member Function Documentation

template<typename PROBLEM, typename VECTOR>
virtual bool DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ComputeReducedConstraints ( const ControlVector< VECTOR > &  q,
ConstraintVector< VECTOR > &  g 
)
pure virtual

Basic function which is given to instatsolver.h and statsolver.h, respectively, It computes the value of the constraint mapping and returns a boolean indicating whether the point is feasible.

Parameters
qThe ControlVector is given to this function.
gThe ConstraintVector that contains the value of the constraint mapping after completion.
Returns
True if feasible, false otherwise.

Implemented in DOpE::StatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >, and DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >.

template<typename PROBLEM, typename VECTOR>
virtual double DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ComputeReducedCostFunctional ( const ControlVector< VECTOR > &  q)
pure virtual
template<typename PROBLEM, typename VECTOR>
virtual void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ComputeReducedFunctionals ( const ControlVector< VECTOR > &  q)
pure virtual
template<typename PROBLEM, typename VECTOR>
virtual void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ComputeReducedGradient ( const ControlVector< VECTOR > &  q,
ControlVector< VECTOR > &  gradient,
ControlVector< VECTOR > &  gradient_transposed 
)
pure virtual

Basic function to compute the reduced gradient solution. We assume that state u(q) is already computed. However the adjoint is not assumed to be computed.

Parameters
qThe ControlVector is given to this function.
gradientThe gradient vector.
gradient_transposedThe transposed version of the gradient vector.

Implemented in DOpE::StatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >, and DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >.

template<typename PROBLEM, typename VECTOR>
virtual void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ComputeReducedGradientOfGlobalConstraints ( unsigned int  ,
const ControlVector< VECTOR > &  ,
const ConstraintVector< VECTOR > &  ,
ControlVector< VECTOR > &  ,
ControlVector< VECTOR > &   
)
inlinevirtual

We assume that the constraints g have been evaluated at the corresponding point q. This comutes the reduced gradient of the global constraint num with respect to the control variable.

Parameters
numNumber of the global constraint to which we want to compute the gradient.
qThe ControlVector<VECTOR> is given to this function.
gThe ConstraintVector<VECTOR> which contains the value of the constraints at q.
gradientThe vector where the gradient will be stored in.
gradient_transposedThe transposed version of the gradient vector.

Reimplemented in DOpE::StatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >.

template<typename PROBLEM, typename VECTOR>
virtual void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ComputeReducedHessianInverseVector ( const ControlVector< VECTOR > &  ,
const ControlVector< VECTOR > &  ,
ControlVector< VECTOR > &   
)
inlinevirtual
template<typename PROBLEM, typename VECTOR>
virtual void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ComputeReducedHessianVector ( const ControlVector< VECTOR > &  q,
const ControlVector< VECTOR > &  direction,
ControlVector< VECTOR > &  hessian_direction,
ControlVector< VECTOR > &  hessian_direction_transposed 
)
pure virtual

Basic function to compute the reduced gradient solution. We assume that adjoint state z(u(q)) is already computed.

Parameters
qThe ControlVector is given to this function.
directionDocumentation will follow later.
hessian_directionDocumentation will follow later.
hessian_direction_transposedDocumentation will follow later.

Implemented in DOpE::StatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >, and DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >.

template<typename PROBLEM, typename VECTOR>
int DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::GetBasePriority ( ) const
inlineprotected
template<typename PROBLEM, typename VECTOR>
virtual void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::GetControlBoxConstraints ( ControlVector< VECTOR > &  lb,
ControlVector< VECTOR > &  ub 
)
pure virtual

Basic function which is given to instatsolver.h and statsolver.h, respectively, It fills the values of the lower and upper box constraints on the control variable in a vector

Parameters
lbThe ControlVector to store the lower bounds
ubThe ControlVector to store the upper bounds

Implemented in DOpE::StatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >, and DOpE::InstatReducedProblem< CONTROLNONLINEARSOLVER, NONLINEARSOLVER, CONTROLINTEGRATOR, INTEGRATOR, PROBLEM, VECTOR, dopedim, dealdim >.

template<typename PROBLEM, typename VECTOR>
virtual const std::map<std::string, unsigned int>& DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::GetFunctionalPosition ( ) const
inlineprotectedvirtual

This has to get implemented in the derived classes like optproblem, pdeproblemcontainer etc. It returns a map connecting the names of the added functionals with their position in functional_values_. If a cost functional is present, its values are always stored in functional_values_[0]. Auxiliary functionals are stored after the cost functional (present or not!) in the order as they are added.

Reimplemented from DOpE::ReducedProblemInterface_Base< VECTOR >.

template<typename PROBLEM, typename VECTOR>
std::string DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::GetPostIndex ( ) const
inlineprotected
template<typename PROBLEM, typename VECTOR>
PROBLEM* DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::GetProblem ( )
inline
template<typename PROBLEM, typename VECTOR>
const PROBLEM* DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::GetProblem ( ) const
inline
template<typename PROBLEM, typename VECTOR>
template<class DWRC >
void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::InitializeDWRC ( DWRC &  dwrc)
inline

Initializes the HigherOrderDWRDataContainer

template<typename PROBLEM, typename VECTOR>
virtual void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::ReInit ( )
inlinevirtual
template<typename PROBLEM, typename VECTOR>
void DOpE::ReducedProblemInterface< PROBLEM, VECTOR >::SetProblemType ( std::string  type,
unsigned int  num = 0 
)
inline

Sets the type of the Problem OP_. This function secures the proper initialization of the FEValues after the type has changed. See also the documentation of SetType in optproblemcontainer.h


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