DOpE
Public Member Functions | Protected Member Functions
DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > Class Template Reference

#include <ts_base.h>

Inheritance diagram for DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >:
DOpE::PrimalTSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > DOpE::BackwardEulerProblem< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > DOpE::CrankNicolsonProblem< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > DOpE::ForwardEulerProblem< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > DOpE::FractionalStepThetaProblem< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > DOpE::ShiftedCrankNicolsonProblem< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >

Public Member Functions

 TSBase (OPTPROBLEM &OP)
 
 ~TSBase ()
 
void SetStepPart (std::string s)
 
void SetTime (double time, unsigned int time_dof_number, const TimeIterator &interval, bool initial=false)
 
template<typename DATACONTAINER >
double ElementFunctional (const DATACONTAINER &dc)
 
double PointFunctional (const std::map< std::string, const dealii::Vector< double > * > &param_values, const std::map< std::string, const VECTOR * > &domain_values)
 
template<typename FACEDATACONTAINER >
double BoundaryFunctional (const FACEDATACONTAINER &fdc)
 
template<typename FACEDATACONTAINER >
double FaceFunctional (const FACEDATACONTAINER &fdc)
 
const dealii::SmartPointer
< const dealii::FESystem
< dealdim > > 
GetFESystem () const
 
bool HasFaces () const
 
bool HasPoints () const
 
bool HasInterfaces () const
 
template<typename ELEMENTITERATOR >
bool AtInterface (ELEMENTITERATOR &element, unsigned int face) const
 
dealii::UpdateFlags GetUpdateFlags () const
 
dealii::UpdateFlags GetFaceUpdateFlags () const
 
const std::vector< unsigned int > & GetDirichletColors () const
 
const std::vector< bool > & GetDirichletCompMask (unsigned int color) const
 
const dealii::Function< dealdim > & GetDirichletValues (unsigned int color, const std::map< std::string, const dealii::Vector< double > * > &param_values, const std::map< std::string, const VECTOR * > &domain_values) const
 
const dealii::Function< dealdim > & GetInitialValues () const
 
const std::vector< unsigned int > & GetBoundaryEquationColors () const
 
const std::vector< unsigned int > & GetBoundaryFunctionalColors () const
 
unsigned int GetNFunctionals () const
 
unsigned int GetNBlocks () const
 
unsigned int GetDoFsPerBlock (unsigned int b) const
 
const std::vector< unsigned int > & GetDoFsPerBlock () const
 
const dealii::ConstraintMatrix & GetDoFConstraints () const
 
std::string GetType () const
 
std::string GetDoFType () const
 
std::string GetFunctionalType () const
 
std::string GetFunctionalName () const
 
DOpEOutputHandler< VECTOR > * GetOutputHandler ()
 
const SpaceTimeHandler< FE, DH,
SPARSITYPATTERN, VECTOR,
dopedim, dealdim > * 
GetSpaceTimeHandler () const
 
SpaceTimeHandler< FE, DH,
SPARSITYPATTERN, VECTOR,
dopedim, dealdim > * 
GetSpaceTimeHandler ()
 
void ComputeSparsityPattern (SPARSITYPATTERN &sparsity) const
 

Protected Member Functions

OPTPROBLEM & GetProblem ()
 
std::string GetPart () const
 

Detailed Description

template<typename OPTPROBLEM, typename SPARSITYPATTERN, typename VECTOR, int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
class DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >

This class contains the methods which all time stepping schemes share.

Template Parameters
<OPTPROBLEM>The problem to deal with.
<SPARSITYPATTERN>The sparsity pattern for control & state.
<VECTOR>The vector type for control & state (i.e. dealii::Vector<double> or dealii::BlockVector<double>)
<dopedim>The dimension for the control variable.
<dealdim>The dimension of the state variable.
<FE>The type of finite elements in use, must be compatible with the DH.
<DH>The type of the DoFHandler in use (to be more precise: The type of the dealii-DoFhandler which forms the base class of the DOpEWrapper::DoFHandler in use.)

Constructor & Destructor Documentation

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::TSBase ( OPTPROBLEM &  OP)
inline
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::~TSBase ( )
inline

Member Function Documentation

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
template<typename ELEMENTITERATOR >
bool DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::AtInterface ( ELEMENTITERATOR &  element,
unsigned int  face 
) const
inline
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
template<typename FACEDATACONTAINER >
double DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::BoundaryFunctional ( const FACEDATACONTAINER &  fdc)
inline

Not implemented so far. Returns just OP_.BoundaryFunctional(...). For more information we refer to the file optproblemcontainer.h

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
void DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::ComputeSparsityPattern ( SPARSITYPATTERN &  sparsity) const
inline
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
template<typename DATACONTAINER >
double DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::ElementFunctional ( const DATACONTAINER &  dc)
inline

Returns just OP_.ElementFunctional(...). For more information we refer to the file optproblemcontainer.h

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
template<typename FACEDATACONTAINER >
double DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::FaceFunctional ( const FACEDATACONTAINER &  fdc)
inline

Not implemented so far. Returns just OP_.FaceFunctional(...). For more information we refer to the file optproblemcontainer.h

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const std::vector<unsigned int>& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetBoundaryEquationColors ( ) const
inline

A std::vector of integer values which contains the colors of the boundary equation.

Returns
Returns colors for the boundary equation.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const std::vector<unsigned int>& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetBoundaryFunctionalColors ( ) const
inline

A std::vector of integer values which contains the colors of the boundary functionals.

Returns
Returns colors for the boundary functionals.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const std::vector<unsigned int>& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetDirichletColors ( ) const
inline

A std::vector of integer values which contains the colors of Dirichlet boundaries.

Returns
Returns the Dirichlet Colors.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const std::vector<bool>& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetDirichletCompMask ( unsigned int  color) const
inline

A std::vector of boolean values to decide at which parts of the boundary and solutions variables Dirichlet values should be applied.

Returns
Returns a component mask for each boundary color.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const dealii::Function<dealdim>& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetDirichletValues ( unsigned int  color,
const std::map< std::string, const dealii::Vector< double > * > &  param_values,
const std::map< std::string, const VECTOR * > &  domain_values 
) const
inline

This dealii::Function of dimension `dealdim' knows what Dirichlet values to apply on each boundary part with color 'color'.

Returns
Returns a dealii::Function of Dirichlet values of the boundary part with color 'color'.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const dealii::ConstraintMatrix& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetDoFConstraints ( ) const
inline

A dealii function. Please visit: ConstraintMatrix in the deal.ii manual.

Returns
Returns a matrix with hanging node constraints.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
unsigned int DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetDoFsPerBlock ( unsigned int  b) const
inline

A function which has the number of degrees of freedom for the block `b'.

Returns
Returns the number of DoFs for block `b'.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const std::vector<unsigned int>& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetDoFsPerBlock ( ) const
inline

A std::vector which contains the number of degrees of freedom per block.

Returns
Returns a vector with DoFs.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
std::string DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetDoFType ( ) const
inline
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
dealii::UpdateFlags DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetFaceUpdateFlags ( ) const
inline

This function returns the update flags for face values for the computation of shape values, gradients, etc. For detailed explication, please visit `FEFaceValues< dim, spacedim > Class Template Reference' in the deal.ii manual.

Returns
Returns the update flags for faces to use in a computation.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const dealii::SmartPointer<const dealii::FESystem<dealdim> > DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetFESystem ( ) const
inline

A pointer to the whole FESystem

Returns
A const pointer to the FESystem()
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
std::string DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetFunctionalName ( ) const
inline

This function is used to name the Functional, this is helpful to distinguish different Functionals in the output.

Returns
A string. This is the name beeing displayed next to the computed values.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
std::string DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetFunctionalType ( ) const
inline

This function describes what type of Functional is considered

Returns
A string describing the functional, feasible values are "domain", "boundary", "point" or "face" if it contains domain, or boundary ... parts all combinations of these keywords are feasible. In time dependent problems use "timelocal" to indicate that it should only be evaluated at a certain time_point, or "timedistributed" to consider ^T J(t,q(t),u(t)) only one of the words "timelocal" and "timedistributed" should be considered if not it will be considered to be "timelocal"
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const dealii::Function<dealdim>& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetInitialValues ( ) const
inline

This dealii::Function of dimension `dealdim' applys the initial values to the PDE- or Optimization problem, respectively.

Returns
Returns a dealii::Function of initial values.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
unsigned int DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetNBlocks ( ) const
inline

This function gets the number of blocks considered in the PDE problem.

Returns
Returns the number of blocks.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
unsigned int DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetNFunctionals ( ) const
inline

This function returns the number of functionals to be considered in the problem.

Returns
Returns the number of functionals.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
DOpEOutputHandler<VECTOR>* DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetOutputHandler ( )
inline

A pointer to the OutputHandler() object.

Returns
The OutputHandler() object.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
std::string DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetPart ( ) const
inlineprotected

Sets the step part which should actually computed, e.g., previous solution within the NewtonStepSolver or last time step solutions.

Parameters
sName of the step part
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
OPTPROBLEM& DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetProblem ( )
inlineprotected

Return the problem.

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
const SpaceTimeHandler<FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim>* DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetSpaceTimeHandler ( ) const
inline

A pointer to the SpaceTimeHandler<dopedim,dealdim> object.

Returns
The SpaceTimeHandler() object.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
SpaceTimeHandler<FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim>* DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetSpaceTimeHandler ( )
inline
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
std::string DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetType ( ) const
inline
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
dealii::UpdateFlags DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::GetUpdateFlags ( ) const
inline

This function returns the update flags for domain values for the computation of shape values, gradients, etc. For detailed explication, please visit `Finite element access/FEValues classes' in the deal.ii manual.

Returns
Returns the update flags to use in a computation.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
bool DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::HasFaces ( ) const
inline

This function determines whether a loop over all faces is required or not.

Returns
Returns whether or not this functional has components on faces between elements. The default value is false.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
bool DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::HasInterfaces ( ) const
inline

This function determines whether a loop over all faces is required or not.

Returns
Returns whether or not this functional has components on faces between elements. The default value is false.
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
bool DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::HasPoints ( ) const
inline

See optproblem.h.

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
double DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::PointFunctional ( const std::map< std::string, const dealii::Vector< double > * > &  param_values,
const std::map< std::string, const VECTOR * > &  domain_values 
)
inline

Returns just OP_.PointFunctional(...). For more information we refer to the file optproblemcontainer.h

template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
void DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::SetStepPart ( std::string  s)
inline

Sets the step part which should actually computed, e.g., previous solution within the NewtonStepSolver or last time step solutions.

Parameters
sName of the step part
template<typename OPTPROBLEM , typename SPARSITYPATTERN , typename VECTOR , int dopedim, int dealdim, template< int, int > class FE = dealii::FESystem, template< int, int > class DH = dealii::DoFHandler>
void DOpE::TSBase< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >::SetTime ( double  time,
unsigned int  time_dof_number,
const TimeIterator interval,
bool  initial = false 
)
inline

Sets the actual time.

Parameters
timeThe actual time.
time_dof_numberThe dofnumber in time associated to the vectors
intervalThe actual interval. Make sure that time lies in interval!
initialDo we solve at the initial time?

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