69 RCP<SolutionState<Scalar> > initialState = solutionHistory->getCurrentState();
72 if (initialState->getXDotDot() == Teuchos::null)
80 Teuchos::RCP<Teuchos::FancyOStream> out = this->getOStream();
81 Teuchos::OSTab ostab(out, 1,
"StepperLeapfrog::setInitialConditions()");
82 *out <<
"Warning -- The First-Same-As-Last (FSAL) principle is not "
83 <<
"used with Leapfrog because of the algorithm's prescribed "
84 <<
"order of solution update. The default is to set useFSAL=false, "
85 <<
"however useFSAL=true will also work but have no affect "
99 TEMPUS_FUNC_TIME_MONITOR(
"Tempus::StepperLeapfrog::takeStep()");
101 TEUCHOS_TEST_FOR_EXCEPTION(
102 solutionHistory->getNumStates() < 2, std::logic_error,
103 "Error - StepperLeapfrog<Scalar>::takeStep(...)\n"
104 <<
"Need at least two SolutionStates for Leapfrog.\n"
105 <<
" Number of States = " << solutionHistory->getNumStates()
106 <<
"\nTry setting in \"Solution History\" \"Storage Type\" = "
108 <<
" or \"Storage Type\" = \"Static\" and \"Storage Limit\" = "
111 RCP<SolutionState<Scalar> > currentState =
112 solutionHistory->getCurrentState();
113 RCP<SolutionState<Scalar> > workingState =
114 solutionHistory->getWorkingState();
115 const Scalar time = currentState->getTime();
116 const Scalar dt = workingState->getTimeStep();
118 RCP<StepperLeapfrog<Scalar> > thisStepper = Teuchos::rcpFromRef(*
this);
121 solutionHistory, thisStepper,
126 if (workingState->getIsSynced() ==
true) {
128 Thyra::V_VpStV(Teuchos::outArg(*(workingState->getXDot())),
129 *(currentState->getXDot()), 0.5 * dt,
130 *(currentState->getXDotDot()));
133 solutionHistory, thisStepper,
136 Thyra::V_VpStV(Teuchos::outArg(*(workingState->getX())),
137 *(currentState->getX()), dt, *(workingState->getXDot()));
140 solutionHistory, thisStepper,
142 Scalar>::ACTION_LOCATION::BEFORE_EXPLICIT_EVAL);
147 Teuchos::null, time + dt, p);
149 solutionHistory, thisStepper,
151 if (workingState->getOutput() ==
true) {
153 Thyra::V_VpStV(Teuchos::outArg(*(workingState->getXDot())),
154 *(workingState->getXDot()), 0.5 * dt,
155 *(workingState->getXDotDot()));
156 workingState->setIsSynced(
true);
160 Thyra::V_VpStV(Teuchos::outArg(*(workingState->getXDot())),
161 *(workingState->getXDot()), dt,
162 *(workingState->getXDotDot()));
163 workingState->setIsSynced(
false);
167 workingState->setOrder(this->
getOrder());
168 workingState->computeNorms(currentState);
171 solutionHistory, thisStepper,
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...