9 #ifndef Tempus_PhysicsStateTest_StepperForwardEuler_hpp
10 #define Tempus_PhysicsStateTest_StepperForwardEuler_hpp
12 #include "Tempus_config.hpp"
13 #include "Tempus_StepperForwardEuler.hpp"
17 namespace Tempus_Test {
24 template<
class Scalar>
32 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel,
33 Teuchos::RCP<Teuchos::ParameterList> pList = Teuchos::null)
42 TEMPUS_FUNC_TIME_MONITOR(
"Tempus::StepperForwardEuler::takeStep()");
45 RCP<Tempus::SolutionState<Scalar> > currentState =
48 typedef Thyra::ModelEvaluatorBase MEB;
49 this->
inArgs_.set_x(currentState->getX());
50 if (this->
inArgs_.supports(MEB::IN_ARG_t))
51 this->
inArgs_.set_t(currentState->getTime());
58 if (this->
inArgs_.supports(MEB::IN_ARG_x_dot))
59 this->
inArgs_.set_x_dot(Teuchos::null);
60 this->
outArgs_.set_f(currentState->getXDot());
67 RCP<Tempus::SolutionState<Scalar> > workingState =
69 const Scalar dt = workingState->getTimeStep();
70 Thyra::V_VpStV(Teuchos::outArg(*(workingState->getX())),
71 *(currentState->getX()),dt,*(currentState->getXDot()));
73 RCP<PhysicsStateCounter<Scalar> > pSC =
75 (workingState->getPhysicsState());
78 pSC->setCounter(counter);
81 workingState->setOrder(this->
getOrder());
91 #endif // Tempus_PhysicsStateTest_StepperForwardEuler_hpp
virtual Scalar getOrder() const
This is a Forward Euler time stepper to test the PhysicsState.
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > appModel_
Explicit ODE ModelEvaluator.
Forward Euler time stepper.
virtual int getCounter() const
Return counter of PhysicsStateCounter.
PhysicsStateTest_StepperForwardEuler(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel, Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Constructor.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs_
virtual void takeStep(const Teuchos::RCP< Tempus::SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
Teuchos::RCP< StepperForwardEulerObserver< Scalar > > stepperFEObserver_
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
PhysicsStateCounter is a simple PhysicsState that counts steps.
Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs_
StepperForwardEuler()
Default constructor.