29 #ifndef RYTHMOS_COMPOSITE_INTEGRATION_OBSERVER_HPP
30 #define RYTHMOS_COMPOSITE_INTEGRATION_OBSERVER_HPP
33 #include "Rythmos_IntegrationObserverBase.hpp"
34 #include "Teuchos_as.hpp"
44 template<
class Scalar>
69 virtual RCP<IntegrationObserverBase<Scalar> >
84 const int timeStepIter
91 const int timeStepIter
98 const int timeStepIter
105 Array<RCP<IntegrationObserverBase<Scalar> > > observers_;
114 template<
class Scalar>
117 RCP<CompositeIntegrationObserver<Scalar> >
131 template<
class Scalar>
136 template<
class Scalar>
141 observers_.push_back(observer);
148 template<
class Scalar>
149 RCP<IntegrationObserverBase<Scalar> >
153 RCP<CompositeIntegrationObserver<Scalar> >
154 compositeObserver = createCompositeIntegrationObserver<Scalar>();
155 for (
int i = 0; i < as<int>(observers_.size()); ++i ) {
156 compositeObserver->addObserver(observers_[i]->cloneIntegrationObserver());
158 return compositeObserver;
162 template<
class Scalar>
168 for (
int i = 0; i < as<int>(observers_.size()); ++i ) {
169 observers_[i]->resetIntegrationObserver(integrationTimeDomain);
173 template<
class Scalar>
180 const RCP<FancyOStream> out = this->getOStream();
181 const Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
183 for (
int i = 0; i < as<int>(observers_.size()); ++i ) {
184 RCP<IntegrationObserverBase<Scalar> > observer = observers_[i];
185 observer->setOStream(out);
186 observer->setVerbLevel(verbLevel);
187 observer->observeStartTimeIntegration(stepper);
191 template<
class Scalar>
198 const RCP<FancyOStream> out = this->getOStream();
199 const Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
201 for (
int i = 0; i < as<int>(observers_.size()); ++i ) {
202 RCP<IntegrationObserverBase<Scalar> > observer = observers_[i];
203 observer->setOStream(out);
204 observer->setVerbLevel(verbLevel);
205 observer->observeEndTimeIntegration(stepper);
209 template<
class Scalar>
213 const int timeStepIter
218 const RCP<FancyOStream> out = this->getOStream();
219 const Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
221 for (
int i = 0; i < as<int>(observers_.size()); ++i ) {
222 RCP<IntegrationObserverBase<Scalar> > observer = observers_[i];
223 observer->setOStream(out);
224 observer->setVerbLevel(verbLevel);
225 observer->observeStartTimeStep(stepper,stepCtrlInfo,timeStepIter);
229 template<
class Scalar>
233 const int timeStepIter
238 const RCP<FancyOStream> out = this->getOStream();
239 const Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
241 for (
int i = 0; i < as<int>(observers_.size()); ++i ) {
242 RCP<IntegrationObserverBase<Scalar> > observer = observers_[i];
243 observer->setOStream(out);
244 observer->setVerbLevel(verbLevel);
245 observer->observeCompletedTimeStep(stepper,stepCtrlInfo,timeStepIter);
250 template<
class Scalar>
254 const int timeStepIter
259 const RCP<FancyOStream> out = this->getOStream();
260 const Teuchos::EVerbosityLevel verbLevel = this->getVerbLevel();
262 for (
int i = 0; i < as<int>(observers_.size()); ++i ) {
263 RCP<IntegrationObserverBase<Scalar> > observer = observers_[i];
264 observer->setOStream(out);
265 observer->setVerbLevel(verbLevel);
266 observer->observeFailedTimeStep(stepper,stepCtrlInfo,timeStepIter);
274 #endif //RYTHMOS_COMPOSITE_INTEGRATOR_OBSERVER_HPP
void addObserver(const RCP< IntegrationObserverBase< Scalar > > &observer)
Base class for defining stepper functionality.
virtual void resetIntegrationObserver(const TimeRange< Scalar > &integrationTimeDomain)
virtual RCP< IntegrationObserverBase< Scalar > > cloneIntegrationObserver() const
Simple struct to aggregate integration/stepper control information.
Standard composite observer subclass.
void observeStartTimeIntegration(const StepperBase< Scalar > &stepper)
Observe the beginning of a time integration loop.
virtual void observeFailedTimeStep(const StepperBase< Scalar > &stepper, const StepControlInfo< Scalar > &stepCtrlInfo, const int timeStepIter)
RCP< CompositeIntegrationObserver< Scalar > > createCompositeIntegrationObserver()
Non-member constructor.
Base class for strategy objects that observe and time integration by observing the stepper object...
void observeEndTimeIntegration(const StepperBase< Scalar > &stepper)
Observe the end of a time integration loop.
void observeStartTimeStep(const StepperBase< Scalar > &stepper, const StepControlInfo< Scalar > &stepCtrlInfo, const int timeStepIter)
Observer the beginning of an integration step.
virtual void observeCompletedTimeStep(const StepperBase< Scalar > &stepper, const StepControlInfo< Scalar > &stepCtrlInfo, const int timeStepIter)
CompositeIntegrationObserver()