DOpE
Public Member Functions | Protected Member Functions
DOpE::SpaceTimeHandlerBase< VECTOR > Class Template Referenceabstract

#include <spacetimehandler_base.h>

Inheritance diagram for DOpE::SpaceTimeHandlerBase< VECTOR >:
DOpE::SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim > DOpE::StateSpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dealdim > DOpE::SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim, dim > DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim > DOpE::MethodOfLines_StateSpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dealdim > DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >

Public Member Functions

 SpaceTimeHandlerBase (DOpEtypes::ControlType control_type=DOpEtypes::stationary)
 
 SpaceTimeHandlerBase (dealii::Triangulation< 1 > &times, DOpEtypes::ControlType type=DOpEtypes::stationary)
 
 SpaceTimeHandlerBase (dealii::Triangulation< 1 > &times, const dealii::FiniteElement< 1 > &fe, DOpEtypes::ControlType type=DOpEtypes::stationary)
 
virtual ~SpaceTimeHandlerBase ()
 
void ReInitTime ()
 
unsigned int GetMaxTimePoint () const
 
unsigned int GetNbrOfIntervals () const
 
void SetInterval (const TimeIterator &it)
 
const TimeIteratorGetInterval () const
 
double GetTime (unsigned int time_point) const
 
const TimeDoFHandlerGetTimeDoFHandler () const
 
const std::vector< double > & GetTimes () const
 
void GetTimes (const TimeIterator &interval, std::vector< double > &local_times) const
 
bool IsValidStateTicket (unsigned int &ticket) const
 
bool IsValidControlTicket (unsigned int &ticket) const
 
DOpEtypes::ControlType GetControlType () const
 
virtual void InterpolateControl (VECTOR &, const std::vector< VECTOR * > &, double, const TimeIterator &) const
 
virtual void InterpolateState (VECTOR &, const std::vector< VECTOR * > &, double, const TimeIterator &) const =0
 
virtual void InterpolateConstraint (VECTOR &, const std::vector< VECTOR * > &, double, const TimeIterator &) const
 
virtual unsigned int GetControlNDoFs (int=-1) const
 
virtual unsigned int GetStateNDoFs (int time_point=-1) const =0
 
virtual unsigned int GetConstraintNDoFs (std::string) const
 
virtual const std::vector
< unsigned int > & 
GetControlDoFsPerBlock (int=-1) const
 
virtual const std::vector
< unsigned int > & 
GetStateDoFsPerBlock (int time_point=-1) const =0
 
virtual const std::vector
< unsigned int > & 
GetConstraintDoFsPerBlock (std::string) const
 
virtual unsigned int GetNGlobalConstraints () const
 
virtual unsigned int GetNLocalConstraints () const
 
double GetStepSize () const
 
double GetNextStepSize () const
 
double GetPreviousStepSize () const
 
virtual unsigned int NewTimePointToOldTimePoint (unsigned int t) const =0
 
virtual void SpatialMeshTransferControl (const VECTOR &, VECTOR &) const
 
virtual void SpatialMeshTransferState (const VECTOR &, VECTOR &) const
 
void RefineTime (DOpEtypes::RefinementType ref_type=DOpEtypes::RefinementType::global)
 
void RefineTime (const RefinementContainer &ref_container)
 

Protected Member Functions

void IncrementStateTicket ()
 
void IncrementControlTicket ()
 

Detailed Description

template<typename VECTOR>
class DOpE::SpaceTimeHandlerBase< VECTOR >

Interface to the dimension independent functionality of a SpaceTimeDoFHandler

Constructor & Destructor Documentation

template<typename VECTOR>
DOpE::SpaceTimeHandlerBase< VECTOR >::SpaceTimeHandlerBase ( DOpEtypes::ControlType  control_type = DOpEtypes::stationary)
inline
template<typename VECTOR>
DOpE::SpaceTimeHandlerBase< VECTOR >::SpaceTimeHandlerBase ( dealii::Triangulation< 1 > &  times,
DOpEtypes::ControlType  type = DOpEtypes::stationary 
)
inline
template<typename VECTOR>
DOpE::SpaceTimeHandlerBase< VECTOR >::SpaceTimeHandlerBase ( dealii::Triangulation< 1 > &  times,
const dealii::FiniteElement< 1 > &  fe,
DOpEtypes::ControlType  type = DOpEtypes::stationary 
)
inline
template<typename VECTOR>
virtual DOpE::SpaceTimeHandlerBase< VECTOR >::~SpaceTimeHandlerBase ( )
inlinevirtual

Member Function Documentation

template<typename VECTOR>
virtual const std::vector<unsigned int>& DOpE::SpaceTimeHandlerBase< VECTOR >::GetConstraintDoFsPerBlock ( std::string  ) const
inlinevirtual
template<typename VECTOR>
virtual unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::GetConstraintNDoFs ( std::string  ) const
inlinevirtual

Returns the DoFs for the constraint vector at the current time which has to be set prior to calling this function using SetTime.

Reimplemented in DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, and DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >.

template<typename VECTOR>
virtual const std::vector<unsigned int>& DOpE::SpaceTimeHandlerBase< VECTOR >::GetControlDoFsPerBlock ( int  = -1) const
inlinevirtual

Returns the DoFs per block for the control vector at the given point time_point. If time_point==-1, it returns the DoFs per block for the current time which has to be set prior to calling this function using SetTime.

@ param time_point Indicating the time at which we want to know the DoFs per block. -1 means now.

Reimplemented in DOpE::SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, DOpE::SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim, dim >, DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, and DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >.

template<typename VECTOR>
virtual unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::GetControlNDoFs ( int  = -1) const
inlinevirtual

Returns the DoFs for the control vector at the given point time_point. If time_point==-1, it returns the DoFs for the current time which has to be set prior to calling this function using SetTimeDoFNumber.

@ param time_point Indicating the time at which we want to know the DoFs. -1 means now.

Reimplemented in DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, and DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >.

template<typename VECTOR>
DOpEtypes::ControlType DOpE::SpaceTimeHandlerBase< VECTOR >::GetControlType ( ) const
inline

Returns the ControlType.

template<typename VECTOR>
const TimeIterator& DOpE::SpaceTimeHandlerBase< VECTOR >::GetInterval ( ) const
inline

Returns the actual interval, which has to be set prior to this function through Setinterval.

Returns
An iterator 'pointing' to the prevoisly given interval_.
template<typename VECTOR>
unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::GetMaxTimePoint ( ) const
inline

Returns the index of the latest time point (i.e. DoF) in the time mesh. Counting starts at zero.

Returns
The maximal feasible time point.
template<typename VECTOR>
unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::GetNbrOfIntervals ( ) const
inline

Returns the number of intervals in the actual time triangulation.

template<typename VECTOR>
double DOpE::SpaceTimeHandlerBase< VECTOR >::GetNextStepSize ( ) const
inline

Returns the length of interval_++;

template<typename VECTOR>
virtual unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::GetNGlobalConstraints ( ) const
inlinevirtual
template<typename VECTOR>
virtual unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::GetNLocalConstraints ( ) const
inlinevirtual
template<typename VECTOR>
double DOpE::SpaceTimeHandlerBase< VECTOR >::GetPreviousStepSize ( ) const
inline

Returns the length of interval_–;

template<typename VECTOR>
virtual const std::vector<unsigned int>& DOpE::SpaceTimeHandlerBase< VECTOR >::GetStateDoFsPerBlock ( int  time_point = -1) const
pure virtual

Returns the DoFs per block for the state vector at the given point time_point. If time_point==-1, it returns the DoFs per block for the current time which has to be set prior to calling this function using SetTime.

@ param time_point Indicating the time at which we want to know the DoFs per block. -1 means now.

Implemented in DOpE::SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, DOpE::SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim, dim >, DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >, and DOpE::MethodOfLines_StateSpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dealdim >.

template<typename VECTOR>
virtual unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::GetStateNDoFs ( int  time_point = -1) const
pure virtual

Returns the DoFs for the state vector at the given point time_point. If time_point==-1, it returns the DoFs for the current time which has to be set prior to calling this function using SetTimeDoFNumber.

@ param time_point Indicating the time at which we want to know the DoFs. -1 means now.

Implemented in DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >, and DOpE::MethodOfLines_StateSpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dealdim >.

template<typename VECTOR>
double DOpE::SpaceTimeHandlerBase< VECTOR >::GetStepSize ( ) const
inline

Returns the length of interval_;

template<typename VECTOR>
double DOpE::SpaceTimeHandlerBase< VECTOR >::GetTime ( unsigned int  time_point) const
inline

Returns the time corresponding to the time_point.

Parameters
time_pointThe time_point of interest.
Returns
A double containing the time at the given time point.
template<typename VECTOR>
const TimeDoFHandler& DOpE::SpaceTimeHandlerBase< VECTOR >::GetTimeDoFHandler ( ) const
inline

Returns the TimeDoFHandler.

template<typename VECTOR>
const std::vector<double>& DOpE::SpaceTimeHandlerBase< VECTOR >::GetTimes ( ) const
inline

Returns the Vector of all time points.

template<typename VECTOR>
void DOpE::SpaceTimeHandlerBase< VECTOR >::GetTimes ( const TimeIterator interval,
std::vector< double > &  local_times 
) const
inline

Given an interval, this function writes the global position of the dofs in the interval into the vector local_times. It is assumed that local_times has the correct length beforehand!

Parameters
intervalThe interval from which we want to extract the position of the DoFs.
local_tiemsA vector of doubles, in which we want to write the position of the of the given interval. Needs the correct size beforehand!
template<typename VECTOR>
void DOpE::SpaceTimeHandlerBase< VECTOR >::IncrementControlTicket ( )
inlineprotected

Call this function if any ControlDoF related stuff has changed to invalidate all previous tickets.

template<typename VECTOR>
void DOpE::SpaceTimeHandlerBase< VECTOR >::IncrementStateTicket ( )
inlineprotected

Call this function if any StateDoF related stuff has changed to invalidate all previous tickets.

template<typename VECTOR>
virtual void DOpE::SpaceTimeHandlerBase< VECTOR >::InterpolateConstraint ( VECTOR &  ,
const std::vector< VECTOR * > &  ,
double  ,
const TimeIterator  
) const
inlinevirtual

If one requires values at a time not corresponding to a degree of freedom in time, one needs to interpolate this value from the others on the interval. This Function is for vectors associated with the constraint-DoFs.

Parameters
resultA VECTOR where the interpolation is stored into.
local_vectorsThe vectors corresponding to the time-dofs on the actual interval. Needed for the interpolation.
tThe time at which we want to have the interpolation
intervalThe interval we are currently working on.
template<typename VECTOR>
virtual void DOpE::SpaceTimeHandlerBase< VECTOR >::InterpolateControl ( VECTOR &  ,
const std::vector< VECTOR * > &  ,
double  ,
const TimeIterator  
) const
inlinevirtual

If one requires values at a time not corresponding to a degree of freedom in time, one needs to interpolate this value from the others on the interval. This Function is for vectors associated with the control DoFs.

Parameters
resultA VECTOR where the interpolation is stored into.
local_vectorsThe vectors corresponding to the time-dofs on the actual interval. Needed for the interpolation.
tThe time at which we want to have the interpolation
intervalThe interval we are currently working on.

Reimplemented in DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, and DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >.

template<typename VECTOR>
virtual void DOpE::SpaceTimeHandlerBase< VECTOR >::InterpolateState ( VECTOR &  ,
const std::vector< VECTOR * > &  ,
double  ,
const TimeIterator  
) const
pure virtual

If one requires values at a time not corresponding to a degree of freedom in time, one needs to interpolate this value from the others on the interval. This Function is for vectors associated with the state DoFs.

Parameters
resultA VECTOR where the interpolation is stored into.
local_vectorsThe vectors corresponding to the time-dofs on the actual interval. Needed for the interpolation.
tThe time at which we want to have the interpolation
intervalThe interval we are currently working on.

Implemented in DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >, and DOpE::MethodOfLines_StateSpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dealdim >.

template<typename VECTOR>
bool DOpE::SpaceTimeHandlerBase< VECTOR >::IsValidControlTicket ( unsigned int &  ticket) const
inline

Checks if a ticket is still valid, or if the SpaceTimeHandler has been updated in the meantime. This is in order to allow functions that reinitialize control- and constraintvectors to the size of the DoFs to work only if necessary.

Parameters
ticketA ticket to be checked. After the procedure the ticket is always a valid ticket. Note that zero is always invalid.
Returns
A Boolean that is true if the ticket is still valid. It is false if the SpaceTimeHandler has been Updated.
template<typename VECTOR>
bool DOpE::SpaceTimeHandlerBase< VECTOR >::IsValidStateTicket ( unsigned int &  ticket) const
inline

Checks if a ticket is still valid, or if the SpaceTimeHandler has been updated in the meantime. This is in order to allow functions that reinitialize statevectors to the size of the DoFs to work only if necessary.

Parameters
ticketA ticket to be checked. After the procedure the ticket is always a valid ticket. Note that zero is always invalid.
Returns
A Boolean that is true if the ticket is still valid. It is false if the SpaceTimeHandler has been Updated.
template<typename VECTOR>
virtual unsigned int DOpE::SpaceTimeHandlerBase< VECTOR >::NewTimePointToOldTimePoint ( unsigned int  t) const
pure virtual

DEPRECATED. FIXME We have to think about how to realize this with the new TimeDoFHandler.

This functions is used to interpolate Vectors after a refinement of the temporal mesh.

Parameters
tAn unsigned int specifying the current time point in the new enumeration
Returns
An unsigned int indicating the number of the timepoint t before the refinement. If the timepoint has not existed before the return value is identical to argument t given to this function.

Implemented in DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >, DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >, and DOpE::MethodOfLines_StateSpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dealdim >.

template<typename VECTOR>
void DOpE::SpaceTimeHandlerBase< VECTOR >::RefineTime ( DOpEtypes::RefinementType  ref_type = DOpEtypes::RefinementType::global)
inline

This Function is used to refine the temporal mesh globally. After calling a refinement function a reinitialization is required!

Parameters
ref_typeA DOpEtypes::RefinementType telling how to refine the spatial mesh. Only DOpEtypes::RefinementType::global is allowed in this method.
template<typename VECTOR>
void DOpE::SpaceTimeHandlerBase< VECTOR >::RefineTime ( const RefinementContainer ref_container)
inline

This Function is used to refine the temporal mesh. After calling a refinement function a reinitialization is required!

Parameters
ref_containerSteers the local mesh refinement. Currently availabe are RefinementContainer (for global refinement), RefineFixedFraction, RefineFixedNumber and RefineOptimized.
template<typename VECTOR>
void DOpE::SpaceTimeHandlerBase< VECTOR >::ReInitTime ( )
inline

This function has to get called after temporal refinement.

template<typename VECTOR>
void DOpE::SpaceTimeHandlerBase< VECTOR >::SetInterval ( const TimeIterator it)
inline

Sets the current interval

Parameters
intervalThe current interval.
template<typename VECTOR>
virtual void DOpE::SpaceTimeHandlerBase< VECTOR >::SpatialMeshTransferControl ( const VECTOR &  ,
VECTOR &   
) const
inlinevirtual

This functions is used to interpolate Control Vectors after a refinement of the spatial mesh. It expects that the timepoint of the mesh has been initialized correctly prior to calling this function

Parameters
old_valuesThe Vector on the mesh before refinement.
new_valuesThe Vector where the interpolation should be placed

Reimplemented in DOpE::MethodOfLines_MultiMesh_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dim >, and DOpE::MethodOfLines_SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim >.

template<typename VECTOR>
virtual void DOpE::SpaceTimeHandlerBase< VECTOR >::SpatialMeshTransferState ( const VECTOR &  ,
VECTOR &   
) const
inlinevirtual

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