ug4
ug::TimeIntegratorSubject< TDomain, TAlgebra > Class Template Reference

Base class for a subject notifying observers attachment. More...

#include <time_integrator_subject.hpp>

Inherited by ug::ITimeIntegrator< class, class >.

Public Types

typedef ITimeIntegratorStageObserver_end< TDomain, TAlgebra > end_observer_type
 
typedef ITimeIntegratorStageObserver_finalize< TDomain, TAlgebra > finalize_observer_type
 
typedef GridFunction< TDomain, TAlgebra > grid_function_type
 
typedef ITimeIntegratorStageObserver_init< TDomain, TAlgebra > init_observer_type
 
enum  observer_group_type {
  TIO_GROUP_INIT_STEP =0 , TIO_GROUP_REWIND_STEP , TIO_GROUP_FINALIZE_STEP , TIO_GROUP_PREPROCESS_STEP ,
  TIO_GROUP_POSTPROCESS_STEP , TIO_GROUP_START , TIO_GROUP_END , TIO_GROUP_SIZE
}
 
typedef ITimeIntegratorStageObserver_postprocess< TDomain, TAlgebra > postprocess_observer_type
 
typedef ITimeIntegratorStageObserver_preprocess< TDomain, TAlgebra > preprocess_observer_type
 
typedef std::vector< SmartPtr< process_observer_type > > process_observer_container_type
 
typedef ITimeIntegratorObserver< TDomain, TAlgebra > process_observer_type
 
typedef ITimeIntegratorStageObserver_rewind< TDomain, TAlgebra > rewind_observer_type
 
typedef ITimeIntegratorStageObserver_start< TDomain, TAlgebra > start_observer_type
 

Public Member Functions

void attach_end_observer (SmartPtr< process_observer_type > obs)
 
void attach_finalize_observer (SmartPtr< process_observer_type > obs)
 
void attach_init_observer (SmartPtr< process_observer_type > obs)
 
void attach_observer (SmartPtr< process_observer_type > obs)
 
void attach_postprocess_observer (SmartPtr< process_observer_type > obs)
 
void attach_preprocess_observer (SmartPtr< process_observer_type > obs)
 
void attach_rewind_observer (SmartPtr< process_observer_type > obs)
 
void attach_start_observer (SmartPtr< process_observer_type > obs)
 
void reset_observers ()
 

Protected Member Functions

void attach_to_group (int tGroup, SmartPtr< process_observer_type > obs)
 register observer (default: postprocess) More...
 
template<int tGroup>
void attach_to_group (SmartPtr< process_observer_type > obs)
 register observer (default: postprocess) More...
 
template<int tGroup>
bool notify_group (SmartPtr< grid_function_type > u, int step, number time, number dt)
 Notify all observers for a certain group. More...
 

Protected Attributes

std::vector< SmartPtr< end_observer_type > > m_vEndObservers
 
std::vector< SmartPtr< finalize_observer_type > > m_vFinalizeObservers
 
std::vector< SmartPtr< init_observer_type > > m_vInitObservers
 
std::vector< SmartPtr< postprocess_observer_type > > m_vPostprocessObservers
 
std::vector< SmartPtr< preprocess_observer_type > > m_vPreprocessObservers
 
process_observer_container_type m_vProcessObservers [TIO_GROUP_SIZE]
 
std::vector< SmartPtr< rewind_observer_type > > m_vRewindObservers
 
std::vector< SmartPtr< start_observer_type > > m_vStartObservers
 

Detailed Description

template<class TDomain, class TAlgebra>
class ug::TimeIntegratorSubject< TDomain, TAlgebra >

Base class for a subject notifying observers attachment.

Provides the option to perform pre-/postprocessing for a (tentative step for evolving from t -> t+dt). Seven cases are distinguished 1) INIT (STEP) : Called at t=t_i before time step is executed. Contains solution u0=u(t0). 2) FINALIZE (STEP) : Called at t=t_i+dt, after time step has been executed and can be accepted. Provides solution u = u(t+dt). 3) REWIND (STEP) : Called at t=t_i+dt, after time step has been executed, but must be rejected. Provides (rejected) solution u = u(t+dt). 4) PREPROCESS (STEP) : Called at t=t_i before newton solver is executed (if applicable). Contains solution u0=u(t0). This may happen multiple times per time step. 5) POSTPROCESS (STEP) : Called at t=t_i+dt, after newton solver has been executed (if applicable). Provides solution u = u(t+dt). This may happen multiple times per time step. 6) START : Called at t=t_0, at the beginning of the time integration process (start of the simulation) 7) END : Called at t=T, at the end of the time integration process (end of the simulation)

Member Typedef Documentation

◆ end_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorStageObserver_end<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::end_observer_type

◆ finalize_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorStageObserver_finalize<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::finalize_observer_type

◆ grid_function_type

template<class TDomain , class TAlgebra >
typedef GridFunction<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::grid_function_type

◆ init_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorStageObserver_init<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::init_observer_type

◆ postprocess_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorStageObserver_postprocess<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::postprocess_observer_type

◆ preprocess_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorStageObserver_preprocess<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::preprocess_observer_type

◆ process_observer_container_type

template<class TDomain , class TAlgebra >
typedef std::vector<SmartPtr<process_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::process_observer_container_type

◆ process_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorObserver<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::process_observer_type

◆ rewind_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorStageObserver_rewind<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::rewind_observer_type

◆ start_observer_type

template<class TDomain , class TAlgebra >
typedef ITimeIntegratorStageObserver_start<TDomain, TAlgebra> ug::TimeIntegratorSubject< TDomain, TAlgebra >::start_observer_type

Member Enumeration Documentation

◆ observer_group_type

template<class TDomain , class TAlgebra >
enum ug::TimeIntegratorSubject::observer_group_type
Enumerator
TIO_GROUP_INIT_STEP 
TIO_GROUP_REWIND_STEP 
TIO_GROUP_FINALIZE_STEP 
TIO_GROUP_PREPROCESS_STEP 
TIO_GROUP_POSTPROCESS_STEP 
TIO_GROUP_START 
TIO_GROUP_END 
TIO_GROUP_SIZE 

Member Function Documentation

◆ attach_end_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_end_observer ( SmartPtr< process_observer_type obs)
inline

◆ attach_finalize_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_finalize_observer ( SmartPtr< process_observer_type obs)
inline

◆ attach_init_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_init_observer ( SmartPtr< process_observer_type obs)
inline

◆ attach_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_observer ( SmartPtr< process_observer_type obs)
inline

Attach statically mapped observers to their respective stages. Other observers are mapped to the finalize stage.

References ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_finalize_observer().

◆ attach_postprocess_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_postprocess_observer ( SmartPtr< process_observer_type obs)
inline

◆ attach_preprocess_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_preprocess_observer ( SmartPtr< process_observer_type obs)
inline

◆ attach_rewind_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_rewind_observer ( SmartPtr< process_observer_type obs)
inline

◆ attach_start_observer()

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_start_observer ( SmartPtr< process_observer_type obs)
inline

◆ attach_to_group() [1/2]

template<class TDomain , class TAlgebra >
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_to_group ( int  tGroup,
SmartPtr< process_observer_type obs 
)
inlineprotected

register observer (default: postprocess)

References ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vProcessObservers.

◆ attach_to_group() [2/2]

template<class TDomain , class TAlgebra >
template<int tGroup>
void ug::TimeIntegratorSubject< TDomain, TAlgebra >::attach_to_group ( SmartPtr< process_observer_type obs)
inlineprotected

register observer (default: postprocess)

References ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vProcessObservers.

◆ notify_group()

template<class TDomain , class TAlgebra >
template<int tGroup>
bool ug::TimeIntegratorSubject< TDomain, TAlgebra >::notify_group ( SmartPtr< grid_function_type u,
int  step,
number  time,
number  dt 
)
inlineprotected

Notify all observers for a certain group.

References ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vProcessObservers.

◆ reset_observers()

Member Data Documentation

◆ m_vEndObservers

template<class TDomain , class TAlgebra >
std::vector<SmartPtr<end_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vEndObservers
protected

◆ m_vFinalizeObservers

template<class TDomain , class TAlgebra >
std::vector<SmartPtr<finalize_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vFinalizeObservers
protected

◆ m_vInitObservers

template<class TDomain , class TAlgebra >
std::vector<SmartPtr<init_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vInitObservers
protected

◆ m_vPostprocessObservers

template<class TDomain , class TAlgebra >
std::vector<SmartPtr<postprocess_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vPostprocessObservers
protected

◆ m_vPreprocessObservers

template<class TDomain , class TAlgebra >
std::vector<SmartPtr<preprocess_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vPreprocessObservers
protected

◆ m_vProcessObservers

◆ m_vRewindObservers

template<class TDomain , class TAlgebra >
std::vector<SmartPtr<rewind_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vRewindObservers
protected

◆ m_vStartObservers

template<class TDomain , class TAlgebra >
std::vector<SmartPtr<start_observer_type> > ug::TimeIntegratorSubject< TDomain, TAlgebra >::m_vStartObservers
protected

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