33 bool useFSAL, std::string ICConsistency,
bool ICConsistencyCheck,
37 this->setStepperName(
"Forward Euler");
38 this->setStepperType(
"Forward Euler");
39 this->setUseFSAL(useFSAL);
40 this->setICConsistency(ICConsistency);
41 this->setICConsistencyCheck(ICConsistencyCheck);
43 this->setAppAction(stepperFEAppAction);
44 if (appModel != Teuchos::null) {
45 this->setModel(appModel);
85 this->checkInitialized();
89 TEMPUS_FUNC_TIME_MONITOR(
"Tempus::StepperForwardEuler::takeStep()");
91 TEUCHOS_TEST_FOR_EXCEPTION(
92 solutionHistory->getNumStates() < 2, std::logic_error,
93 "Error - StepperForwardEuler<Scalar>::takeStep(...)\n"
94 <<
"Need at least two SolutionStates for Forward Euler.\n"
95 <<
" Number of States = " << solutionHistory->getNumStates()
96 <<
"\n Try setting in \"Solution History\" \"Storage Type\" = "
97 <<
"\"Undo\"\n or \"Storage Type\" = \"Static\" and \"Storage Limit\" = "
100 RCP<StepperForwardEuler<Scalar> > thisStepper = Teuchos::rcpFromRef(*
this);
101 stepperFEAppAction_->execute(
102 solutionHistory, thisStepper,
105 RCP<SolutionState<Scalar> > currentState =
106 solutionHistory->getCurrentState();
107 RCP<SolutionState<Scalar> > workingState =
108 solutionHistory->getWorkingState();
109 if (currentState->getXDot() != Teuchos::null)
110 this->setStepperXDot(currentState->getXDot());
111 RCP<Thyra::VectorBase<Scalar> > xDot = this->getStepperXDot();
112 const Scalar dt = workingState->getTimeStep();
114 if (!(this->getUseFSAL()) || workingState->getNConsecutiveFailures() != 0) {
116 stepperFEAppAction_->execute(
117 solutionHistory, thisStepper,
119 Scalar>::ACTION_LOCATION::BEFORE_EXPLICIT_EVAL);
124 this->evaluateExplicitODE(xDot, currentState->getX(),
125 currentState->getTime(), p);
129 currentState->setIsSynced(
true);
133 Thyra::V_VpStV(Teuchos::outArg(*(workingState->getX())),
134 *(currentState->getX()), dt, *(xDot));
136 if (workingState->getXDot() != Teuchos::null)
137 this->setStepperXDot(workingState->getXDot());
138 xDot = this->getStepperXDot();
140 if (this->getUseFSAL()) {
142 stepperFEAppAction_->execute(
143 solutionHistory, thisStepper,
145 Scalar>::ACTION_LOCATION::BEFORE_EXPLICIT_EVAL);
150 this->evaluateExplicitODE(xDot, workingState->getX(),
151 workingState->getTime(), p);
155 workingState->setIsSynced(
true);
158 assign(xDot.ptr(), Teuchos::ScalarTraits<Scalar>::zero());
159 workingState->setIsSynced(
false);
163 workingState->setOrder(this->getOrder());
164 workingState->computeNorms(currentState);
165 stepperFEAppAction_->execute(
166 solutionHistory, thisStepper,
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...