DOpE
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim > Class Template Reference

#include <statpdeproblem.h>

Inheritance diagram for DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >:
DOpE::PDEProblemInterface< PROBLEM, VECTOR, dealdim > DOpE::ReducedProblemInterface_Base< VECTOR >

Public Member Functions

template<typename INTEGRATORDATACONT >
 StatPDEProblem (PROBLEM *OP, DOpEtypes::VectorStorageType state_behavior, ParameterReader &param_reader, INTEGRATORDATACONT &idc, int base_priority=0)
 
template<typename INTEGRATORDATACONT >
 StatPDEProblem (PROBLEM *OP, DOpEtypes::VectorStorageType state_behavior, ParameterReader &param_reader, INTEGRATORDATACONT &idc1, INTEGRATORDATACONT &idc2, int base_priority=0)
 
virtual ~StatPDEProblem ()
 
void ReInit ()
 
void ComputeReducedFunctionals ()
 
void ComputeReducedFunctionals (const StateVector< VECTOR > &st_u)
 
template<class DWRC , class PDE >
void ComputeRefinementIndicators (DWRC &dwrc, PDE &pde)
 
void StateSizeInfo (std::stringstream &out)
 
void WriteToFile (const VECTOR &v, std::string name, std::string outfile, std::string dof_type, std::string filetype)
 
void WriteToFileElementwise (const Vector< double > &v, std::string name, std::string outfile, std::string dof_type, std::string filetype)
 
void WriteToFile (const ControlVector< VECTOR > &v, std::string name, std::string dof_type)
 
void WriteToFile (const std::vector< double > &, std::string)
 
- Public Member Functions inherited from DOpE::PDEProblemInterface< PROBLEM, VECTOR, dealdim >
 PDEProblemInterface (PROBLEM *OP, int base_priority=0)
 
virtual ~PDEProblemInterface ()
 
void SetProblemType (std::string type, unsigned int num=0)
 
template<class DWRC >
void InitializeDWRC (DWRC &dwrc)
 
- Public Member Functions inherited from DOpE::ReducedProblemInterface_Base< VECTOR >
 ReducedProblemInterface_Base ()
 
virtual ~ReducedProblemInterface_Base ()
 
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)
 

Static Public Member Functions

static void declare_params (ParameterReader &param_reader)
 

Protected Member Functions

void ComputeReducedState ()
 
void ComputeDualForErrorEstimation (DOpEtypes::WeightComputation)
 
const StateVector< VECTOR > & GetU () const
 
StateVector< VECTOR > & GetU ()
 
const StateVector< VECTOR > & GetZForEE () const
 
StateVector< VECTOR > & GetZForEE ()
 
NONLINEARSOLVER & GetNonlinearSolver (std::string type)
 
INTEGRATOR & GetIntegrator ()
 
const bool & GetBuildStateMatrix () const
 
const bool & GetBuildAdjointMatrix () const
 
const bool & GetStateReinit () const
 
const bool & GetAdjointReinit () const
 
bool & GetBuildStateMatrix ()
 
bool & GetBuildAdjointMatrix ()
 
bool & GetStateReinit ()
 
bool & GetAdjointReinit ()
 
- Protected Member Functions inherited from DOpE::PDEProblemInterface< PROBLEM, VECTOR, dealdim >
virtual const std::map
< std::string, unsigned int > & 
GetFunctionalPosition () const
 
PROBLEM * GetProblem ()
 
const PROBLEM * GetProblem () const
 
std::string GetPostIndex ()
 
int GetBasePriority ()
 
- 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
 

Friends

class SolutionExtractor< StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >, VECTOR >
 

Detailed Description

template<typename NONLINEARSOLVER, typename INTEGRATOR, typename PROBLEM, typename VECTOR, int dealdim>
class DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >

Basic class to solve stationary PDE-problems. In contrast to StatReducedProblem no control variable is present. This allows to avoid initialization of the related and objects which will not be used.

Template Parameters
<NONLINEARSOLVER>Newton solver for the state variables.
<INTEGRATOR>An integrator for the state variables, e.g, Integrator
<PROBLEM>PDE- or optimization problem under consideration.
<VECTOR>Class in which we want to store the spatial vector (i.e. dealii::Vector<double> or dealii::BlockVector<double>)
<dopedim>The dimension for the control variable.
<dealdim>The dimension for the state variable.

Constructor & Destructor Documentation

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
template<typename INTEGRATORDATACONT >
DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::StatPDEProblem ( PROBLEM *  OP,
DOpEtypes::VectorStorageType  state_behavior,
ParameterReader param_reader,
INTEGRATORDATACONT &  idc,
int  base_priority = 0 
)

Constructor for the StatPDEProblem.

Template Parameters
<INTEGRATORDATACONT>An IntegratorDataContainer
Parameters
OPProblem is given to the stationary solver.
state_behaviorIndicates the behavior of the StateVector.
param_readerAn object which has run time data.
idcAn INTETGRATORDATACONT which has all the data needed by the integrator.
base_priorityAn offset for the priority of the output written to the OutputHandler
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
template<typename INTEGRATORDATACONT >
DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::StatPDEProblem ( PROBLEM *  OP,
DOpEtypes::VectorStorageType  state_behavior,
ParameterReader param_reader,
INTEGRATORDATACONT &  idc1,
INTEGRATORDATACONT &  idc2,
int  base_priority = 0 
)

Constructor for the StatPDEProblem.

Parameters
OPProblem is given to the stationary solver.
state_behaviorIndicates the behavior of the StateVector.
param_readerAn object which has run time data.
idcAn INTETGRATORDATACONT which has all the data needed by the integrator.
idc2An INTETGRATORDATACONT which is used by the integrator to evalueate the functionals.
base_priorityAn offset for the priority of the output written to the OutputHandler
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::~StatPDEProblem ( )
virtual

Member Function Documentation

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::ComputeDualForErrorEstimation ( DOpEtypes::WeightComputation  weight_comp)
protected

This function computes the solution for the dual variable for error estimation.

I is assumed that the state u(q) corresponding to the argument q is already calculated.

Parameters
weight_compA flag deciding how the weights should be calculated
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::ComputeReducedFunctionals ( )
virtual

Implementation of Virtual Method in Base Class ReducedProblemInterface

Implements DOpE::PDEProblemInterface< PROBLEM, VECTOR, dealdim >.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::ComputeReducedFunctionals ( const StateVector< VECTOR > &  st_u)

This function evaluates reduced functionals of interest for the given statevector st_u.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::ComputeReducedState ( )
protected

This function computes the solution for the state variable.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
template<class DWRC , class PDE >
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::ComputeRefinementIndicators ( DWRC &  dwrc,
PDE &  pde 
)

Computes the error indicators for the error of a previosly specified functional. Assumes that the primal state solution is already computed and the functional is specified (see problem::SetFunctionalForErrorEstimation).

Everything else is determined by the DWRDataContainer you use (represented by the template parameter DWRC).

Template Parameters
<DWRC>A container for the refinement indicators See, e.g., DWRDataContainer
<PDE>The problem contrainer
Parameters
dwrcThe data container
pdeThe problem
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::declare_params ( ParameterReader param_reader)
static

Static member function for run time parameters.

Parameters
param_readerAn object which has run time data.
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
const bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetAdjointReinit ( ) const
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetAdjointReinit ( )
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
const bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetBuildAdjointMatrix ( ) const
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetBuildAdjointMatrix ( )
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
const bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetBuildStateMatrix ( ) const
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetBuildStateMatrix ( )
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
INTEGRATOR& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetIntegrator ( )
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
NONLINEARSOLVER & DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetNonlinearSolver ( std::string  type)
protected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
const bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetStateReinit ( ) const
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
bool& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetStateReinit ( )
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
const StateVector<VECTOR>& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetU ( ) const
inlineprotected

Returns the solution of the state-equation.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
StateVector<VECTOR>& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetU ( )
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
const StateVector<VECTOR>& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetZForEE ( ) const
inlineprotected

Returns the solution of the dual equation for error estimation.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
StateVector<VECTOR>& DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::GetZForEE ( )
inlineprotected
template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::ReInit ( )
virtual

This function sets state- and dual vectors to their correct sizes. Further, the flags to build the system matrices are set to true.

Reimplemented from DOpE::PDEProblemInterface< PROBLEM, VECTOR, dealdim >.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::StateSizeInfo ( std::stringstream &  out)
inlinevirtual

Implementation of Virtual Method in Base Class ReducedProblemInterface

Implements DOpE::ReducedProblemInterface_Base< VECTOR >.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::WriteToFile ( const VECTOR &  v,
std::string  name,
std::string  outfile,
std::string  dof_type,
std::string  filetype 
)
virtual

Here, the given VECTOR v is printed to a file of *.vtk format. However, in later implementations other file formats will be available.

Parameters
vThe VECTOR to write to a file.
nameThe names of the variables, e.g., in a fluid problem: v1, v2, p.
outfileThe basic name for the output file to print.
dof_typeHas the DoF type: state or control.
filetypeThe filetype. Actually, *.vtk outputs are possible.

Implements DOpE::ReducedProblemInterface_Base< VECTOR >.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::WriteToFile ( const ControlVector< VECTOR > &  v,
std::string  name,
std::string  dof_type 
)
virtual

Here, the given ControlVector<VECTOR> v is printed to a file of *.vtk format. However, in later implementations other file formats will be available.

Parameters
vThe ControlVector<VECTOR> to write to a file.
nameThe names of the variables, e.g., in a fluid problem: v1, v2, p.
dof_typeHas the DoF type: state or control.

Implements DOpE::ReducedProblemInterface_Base< VECTOR >.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::WriteToFile ( const std::vector< double > &  ,
std::string   
)
inlinevirtual

Basic function to write a std::vector to a file.

Parameters
vA std::vector to write to a file.
outfileThe basic name for the output file to print. Doesn't make sense here so aborts if called!

Implements DOpE::ReducedProblemInterface_Base< VECTOR >.

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
void DOpE::StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >::WriteToFileElementwise ( const Vector< double > &  v,
std::string  name,
std::string  outfile,
std::string  dof_type,
std::string  filetype 
)
virtual

Here, the given Vector v (containing element-related data) is printed to a file of *.vtk format. However, in later implementations other file formats will be available.

Parameters
vThe Vector to write to a file.
nameThe names of the variables, e.g., in a fluid problem: v1, v2, p.
outfileThe basic name for the output file to print.
dof_typeHas the DoF type: state or control.
filetypeThe filetype. Actually, *.vtk outputs are possible.
typeHow to interprete the given data, i.e. does v contain nodal-related or element-related data.

Reimplemented from DOpE::ReducedProblemInterface_Base< VECTOR >.

Friends And Related Function Documentation

template<typename NONLINEARSOLVER , typename INTEGRATOR , typename PROBLEM , typename VECTOR , int dealdim>
friend class SolutionExtractor< StatPDEProblem< NONLINEARSOLVER, INTEGRATOR, PROBLEM, VECTOR, dealdim >,VECTOR >
friend

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