Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_ForwardEulerTest.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ****************************************************************************
3 // Tempus: Copyright (2017) Sandia Corporation
4 //
5 // Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6 // ****************************************************************************
7 // @HEADER
8 
11 #include "Teuchos_TimeMonitor.hpp"
12 
13 #include "Thyra_VectorStdOps.hpp"
14 #include "Thyra_DetachedVectorView.hpp"
15 
16 #include "Tempus_IntegratorBasic.hpp"
17 
18 #include "Tempus_StepperForwardEuler.hpp"
19 
20 #include "../TestModels/SinCosModel.hpp"
21 #include "../TestModels/VanDerPolModel.hpp"
22 #include "../TestUtils/Tempus_ConvergenceTestUtils.hpp"
23 
24 #include <fstream>
25 #include <vector>
26 
27 namespace Tempus_Test {
28 
29 using Teuchos::RCP;
30 using Teuchos::rcp;
31 using Teuchos::rcp_const_cast;
33 using Teuchos::sublist;
34 using Teuchos::getParametersFromXmlFile;
35 
39 
40 
41 // ************************************************************
42 // ************************************************************
44 {
45  // Read params from .xml file
46  RCP<ParameterList> pList =
47  getParametersFromXmlFile("Tempus_ForwardEuler_SinCos.xml");
48 
49  //std::ofstream ftmp("PL.txt");
50  //pList->print(ftmp);
51  //ftmp.close();
52 
53  // Setup the SinCosModel
54  RCP<ParameterList> scm_pl = sublist(pList, "SinCosModel", true);
55  auto model = rcp(new SinCosModel<double> (scm_pl));
56 
57  RCP<ParameterList> tempusPL = sublist(pList, "Tempus", true);
58 
59  // Test constructor IntegratorBasic(tempusPL, model)
60  {
62  Tempus::createIntegratorBasic<double>(tempusPL, model);
63 
64  RCP<ParameterList> stepperPL = sublist(tempusPL, "Demo Stepper", true);
65  RCP<const ParameterList> defaultPL =
66  integrator->getStepper()->getValidParameters();
67 
68  bool pass = haveSameValuesSorted(*stepperPL, *defaultPL, true);
69  if (!pass) {
70  std::cout << std::endl;
71  std::cout << "stepperPL -------------- \n" << *stepperPL << std::endl;
72  std::cout << "defaultPL -------------- \n" << *defaultPL << std::endl;
73  }
74  TEST_ASSERT(pass)
75  }
76 
77  // Test constructor IntegratorBasic(model, stepperType)
78  {
80  Tempus::createIntegratorBasic<double>(model, "Forward Euler");
81 
82  RCP<ParameterList> stepperPL = sublist(tempusPL, "Demo Stepper", true);
83  RCP<const ParameterList> defaultPL =
84  integrator->getStepper()->getValidParameters();
85 
86  bool pass = haveSameValuesSorted(*stepperPL, *defaultPL, true);
87  if (!pass) {
88  std::cout << std::endl;
89  std::cout << "stepperPL -------------- \n" << *stepperPL << std::endl;
90  std::cout << "defaultPL -------------- \n" << *defaultPL << std::endl;
91  }
92  TEST_ASSERT(pass)
93  }
94 }
95 
96 
97 // ************************************************************
98 // ************************************************************
99 TEUCHOS_UNIT_TEST(ForwardEuler, ConstructingFromDefaults)
100 {
101  double dt = 0.1;
102  std::vector<std::string> options;
103  options.push_back("useFSAL=true");
104  options.push_back("useFSAL=false");
105  options.push_back("ICConsistency and Check");
106 
107  for(const auto& option: options) {
108 
109  // Read params from .xml file
110  RCP<ParameterList> pList =
111  getParametersFromXmlFile("Tempus_ForwardEuler_SinCos.xml");
112  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
113 
114  // Setup the SinCosModel
115  RCP<ParameterList> scm_pl = sublist(pList, "SinCosModel", true);
116  //RCP<SinCosModel<double> > model = sineCosineModel(scm_pl);
117  auto model = rcp(new SinCosModel<double>(scm_pl));
118 
119  // Setup Stepper for field solve ----------------------------
120  auto stepper = rcp(new Tempus::StepperForwardEuler<double>());
121  stepper->setModel(model);
122  if (option == "useFSAL=true") stepper->setUseFSAL(true);
123  else if (option == "useFSAL=false") stepper->setUseFSAL(false);
124  else if ( option == "ICConsistency and Check") {
125  stepper->setICConsistency("Consistent");
126  stepper->setICConsistencyCheck(true);
127  }
128  stepper->initialize();
129 
130  // Setup TimeStepControl ------------------------------------
131  auto timeStepControl = rcp(new Tempus::TimeStepControl<double>());
132  ParameterList tscPL = pl->sublist("Demo Integrator")
133  .sublist("Time Step Control");
134  timeStepControl->setInitIndex(tscPL.get<int> ("Initial Time Index"));
135  timeStepControl->setInitTime (tscPL.get<double>("Initial Time"));
136  timeStepControl->setFinalTime(tscPL.get<double>("Final Time"));
137  timeStepControl->setInitTimeStep(dt);
138  timeStepControl->initialize();
139 
140  // Setup initial condition SolutionState --------------------
141  auto inArgsIC = model()->getNominalValues();
142  auto icSolution = rcp_const_cast<Thyra::VectorBase<double> > (inArgsIC.get_x());
143  auto icState = Tempus::createSolutionStateX(icSolution);
144  icState->setTime (timeStepControl->getInitTime());
145  icState->setIndex (timeStepControl->getInitIndex());
146  icState->setTimeStep(0.0);
147  icState->setSolutionStatus(Tempus::Status::PASSED); // ICs are passing.
148 
149  // Setup SolutionHistory ------------------------------------
150  auto solutionHistory = rcp(new Tempus::SolutionHistory<double>());
151  solutionHistory->setName("Forward States");
152  solutionHistory->setStorageType(Tempus::STORAGE_TYPE_STATIC);
153  solutionHistory->setStorageLimit(2);
154  solutionHistory->addState(icState);
155 
156  // Ensure ICs are consistent and stepper memory is set (e.g., xDot is set).
157  stepper->setInitialConditions(solutionHistory);
158 
159  // Setup Integrator -----------------------------------------
161  Tempus::createIntegratorBasic<double>();
162  integrator->setStepper(stepper);
163  integrator->setTimeStepControl(timeStepControl);
164  integrator->setSolutionHistory(solutionHistory);
165  //integrator->setObserver(...);
166  integrator->initialize();
167 
168 
169  // Integrate to timeMax
170  bool integratorStatus = integrator->advanceTime();
171  TEST_ASSERT(integratorStatus)
172 
173 
174  // Test if at 'Final Time'
175  double time = integrator->getTime();
176  double timeFinal =pl->sublist("Demo Integrator")
177  .sublist("Time Step Control").get<double>("Final Time");
178  TEST_FLOATING_EQUALITY(time, timeFinal, 1.0e-14);
179 
180  // Time-integrated solution and the exact solution
181  RCP<Thyra::VectorBase<double> > x = integrator->getX();
183  model->getExactSolution(time).get_x();
184 
185  // Calculate the error
186  RCP<Thyra::VectorBase<double> > xdiff = x->clone_v();
187  Thyra::V_StVpStV(xdiff.ptr(), 1.0, *x_exact, -1.0, *(x));
188 
189  // Check the order and intercept
190  std::cout << " Stepper = " << stepper->description()
191  << "\n with " << option << std::endl;
192  std::cout << " =========================" << std::endl;
193  std::cout << " Exact solution : " << get_ele(*(x_exact), 0) << " "
194  << get_ele(*(x_exact), 1) << std::endl;
195  std::cout << " Computed solution: " << get_ele(*(x ), 0) << " "
196  << get_ele(*(x ), 1) << std::endl;
197  std::cout << " Difference : " << get_ele(*(xdiff ), 0) << " "
198  << get_ele(*(xdiff ), 1) << std::endl;
199  std::cout << " =========================" << std::endl;
200  TEST_FLOATING_EQUALITY(get_ele(*(x), 0), 0.882508, 1.0e-4 );
201  TEST_FLOATING_EQUALITY(get_ele(*(x), 1), 0.570790, 1.0e-4 );
202  }
203 }
204 
205 
206 // ************************************************************
207 // ************************************************************
208 TEUCHOS_UNIT_TEST(ForwardEuler, SinCos)
209 {
211  std::vector<RCP<Thyra::VectorBase<double>>> solutions;
212  std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
213  std::vector<double> StepSize;
214  std::vector<double> xErrorNorm;
215  std::vector<double> xDotErrorNorm;
216  const int nTimeStepSizes = 7;
217  double dt = 0.2;
218  double time = 0.0;
219  for (int n=0; n<nTimeStepSizes; n++) {
220 
221  // Read params from .xml file
222  RCP<ParameterList> pList =
223  getParametersFromXmlFile("Tempus_ForwardEuler_SinCos.xml");
224 
225  //std::ofstream ftmp("PL.txt");
226  //pList->print(ftmp);
227  //ftmp.close();
228 
229  // Setup the SinCosModel
230  RCP<ParameterList> scm_pl = sublist(pList, "SinCosModel", true);
231  //RCP<SinCosModel<double> > model = sineCosineModel(scm_pl);
232  auto model = rcp(new SinCosModel<double> (scm_pl));
233 
234  dt /= 2;
235 
236  // Setup the Integrator and reset initial time step
237  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
238  pl->sublist("Demo Integrator")
239  .sublist("Time Step Control").set("Initial Time Step", dt);
240  integrator = Tempus::createIntegratorBasic<double>(pl, model);
241 
242  // Initial Conditions
243  // During the Integrator construction, the initial SolutionState
244  // is set by default to model->getNominalVales().get_x(). However,
245  // the application can set it also by integrator->initializeSolutionHistory.
247  model->getNominalValues().get_x()->clone_v();
248  integrator->initializeSolutionHistory(0.0, x0);
249  integrator->initialize();
250 
251  // Integrate to timeMax
252  bool integratorStatus = integrator->advanceTime();
253  TEST_ASSERT(integratorStatus)
254 
255  // Test PhysicsState
256  RCP<Tempus::PhysicsState<double> > physicsState =
257  integrator->getSolutionHistory()->getCurrentState()->getPhysicsState();
258  TEST_EQUALITY(physicsState->getName(), "Tempus::PhysicsState");
259 
260  // Test if at 'Final Time'
261  time = integrator->getTime();
262  double timeFinal = pl->sublist("Demo Integrator")
263  .sublist("Time Step Control").get<double>("Final Time");
264  TEST_FLOATING_EQUALITY(time, timeFinal, 1.0e-14);
265 
266  // Time-integrated solution and the exact solution
267  RCP<Thyra::VectorBase<double> > x = integrator->getX();
269  model->getExactSolution(time).get_x();
270 
271  // Plot sample solution and exact solution
272  if (n == 0) {
273  RCP<const SolutionHistory<double> > solutionHistory =
274  integrator->getSolutionHistory();
275  writeSolution("Tempus_ForwardEuler_SinCos.dat", solutionHistory);
276 
277  auto solnHistExact = rcp(new Tempus::SolutionHistory<double>());
278  for (int i=0; i<solutionHistory->getNumStates(); i++) {
279  double time_i = (*solutionHistory)[i]->getTime();
280  auto state = Tempus::createSolutionStateX(
281  rcp_const_cast<Thyra::VectorBase<double> > (
282  model->getExactSolution(time_i).get_x()),
283  rcp_const_cast<Thyra::VectorBase<double> > (
284  model->getExactSolution(time_i).get_x_dot()));
285  state->setTime((*solutionHistory)[i]->getTime());
286  solnHistExact->addState(state);
287  }
288  writeSolution("Tempus_ForwardEuler_SinCos-Ref.dat", solnHistExact);
289  }
290 
291  // Store off the final solution and step size
292  StepSize.push_back(dt);
293  auto solution = Thyra::createMember(model->get_x_space());
294  Thyra::copy(*(integrator->getX()),solution.ptr());
295  solutions.push_back(solution);
296  auto solutionDot = Thyra::createMember(model->get_x_space());
297  Thyra::copy(*(integrator->getXDot()),solutionDot.ptr());
298  solutionsDot.push_back(solutionDot);
299  if (n == nTimeStepSizes-1) { // Add exact solution last in vector.
300  StepSize.push_back(0.0);
301  auto solutionExact = Thyra::createMember(model->get_x_space());
302  Thyra::copy(*(model->getExactSolution(time).get_x()),solutionExact.ptr());
303  solutions.push_back(solutionExact);
304  auto solutionDotExact = Thyra::createMember(model->get_x_space());
305  Thyra::copy(*(model->getExactSolution(time).get_x_dot()),
306  solutionDotExact.ptr());
307  solutionsDot.push_back(solutionDotExact);
308  }
309  }
310 
311  // Check the order and intercept
312  double xSlope = 0.0;
313  double xDotSlope = 0.0;
314  RCP<Tempus::Stepper<double> > stepper = integrator->getStepper();
315  double order = stepper->getOrder();
316  writeOrderError("Tempus_ForwardEuler_SinCos-Error.dat",
317  stepper, StepSize,
318  solutions, xErrorNorm, xSlope,
319  solutionsDot, xDotErrorNorm, xDotSlope);
320 
321  TEST_FLOATING_EQUALITY( xSlope, order, 0.01 );
322  TEST_FLOATING_EQUALITY( xErrorNorm[0], 0.051123, 1.0e-4 );
323  // xDot not yet available for Forward Euler.
324  //TEST_FLOATING_EQUALITY( xDotSlope, order, 0.01 );
325  //TEST_FLOATING_EQUALITY( xDotErrorNorm[0], 0.0486418, 1.0e-4 );
326 
328 }
329 
330 
331 // ************************************************************
332 // ************************************************************
333 TEUCHOS_UNIT_TEST(ForwardEuler, VanDerPol)
334 {
336  std::vector<RCP<Thyra::VectorBase<double>>> solutions;
337  std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
338  std::vector<double> StepSize;
339  std::vector<double> xErrorNorm;
340  std::vector<double> xDotErrorNorm;
341  const int nTimeStepSizes = 7; // 8 for Error plot
342  double dt = 0.2;
343  for (int n=0; n<nTimeStepSizes; n++) {
344 
345  // Read params from .xml file
346  RCP<ParameterList> pList =
347  getParametersFromXmlFile("Tempus_ForwardEuler_VanDerPol.xml");
348 
349  // Setup the VanDerPolModel
350  RCP<ParameterList> vdpm_pl = sublist(pList, "VanDerPolModel", true);
351  auto model = rcp(new VanDerPolModel<double>(vdpm_pl));
352 
353  // Set the step size
354  dt /= 2;
355  if (n == nTimeStepSizes-1) dt /= 10.0;
356 
357  // Setup the Integrator and reset initial time step
358  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
359  pl->sublist("Demo Integrator")
360  .sublist("Time Step Control").set("Initial Time Step", dt);
361  integrator = Tempus::createIntegratorBasic<double>(pl, model);
362 
363  // Integrate to timeMax
364  bool integratorStatus = integrator->advanceTime();
365  TEST_ASSERT(integratorStatus)
366 
367  // Test if at 'Final Time'
368  double time = integrator->getTime();
369  double timeFinal =pl->sublist("Demo Integrator")
370  .sublist("Time Step Control").get<double>("Final Time");
371  double tol = 100.0 * std::numeric_limits<double>::epsilon();
372  TEST_FLOATING_EQUALITY(time, timeFinal, tol);
373 
374  // Store off the final solution and step size
375  StepSize.push_back(dt);
376  auto solution = Thyra::createMember(model->get_x_space());
377  Thyra::copy(*(integrator->getX()),solution.ptr());
378  solutions.push_back(solution);
379  auto solutionDot = Thyra::createMember(model->get_x_space());
380  Thyra::copy(*(integrator->getXDot()),solutionDot.ptr());
381  solutionsDot.push_back(solutionDot);
382 
383  // Output finest temporal solution for plotting
384  // This only works for ONE MPI process
385  if ((n == 0) || (n == nTimeStepSizes-1)) {
386  std::string fname = "Tempus_ForwardEuler_VanDerPol-Ref.dat";
387  if (n == 0) fname = "Tempus_ForwardEuler_VanDerPol.dat";
388  RCP<const SolutionHistory<double> > solutionHistory =
389  integrator->getSolutionHistory();
390  writeSolution(fname, solutionHistory);
391  }
392  }
393 
394  // Check the order and intercept
395  double xSlope = 0.0;
396  double xDotSlope = 0.0;
397  RCP<Tempus::Stepper<double> > stepper = integrator->getStepper();
398  double order = stepper->getOrder();
399  writeOrderError("Tempus_ForwardEuler_VanDerPol-Error.dat",
400  stepper, StepSize,
401  solutions, xErrorNorm, xSlope,
402  solutionsDot, xDotErrorNorm, xDotSlope);
403 
404  TEST_FLOATING_EQUALITY( xSlope, order, 0.10 );
405  TEST_FLOATING_EQUALITY( xErrorNorm[0], 0.387476, 1.0e-4 );
406  // xDot not yet available for Forward Euler.
407  //TEST_FLOATING_EQUALITY( xDotSlope, 1.74898, 0.10 );
408  //TEST_FLOATING_EQUALITY( xDotErrorNorm[0], 1.0038, 1.0e-4 );
409 
411 }
412 
413 
414 // ************************************************************
415 // ************************************************************
416 TEUCHOS_UNIT_TEST(ForwardEuler, NumberTimeSteps)
417 {
418 
419  std::vector<double> StepSize;
420  std::vector<double> ErrorNorm;
421  //const int nTimeStepSizes = 7;
422  //double dt = 0.2;
423  //double order = 0.0;
424 
425  // Read params from .xml file
426  RCP<ParameterList> pList =
427  getParametersFromXmlFile("Tempus_ForwardEuler_NumberOfTimeSteps.xml");
428 
429  // Setup the VanDerPolModel
430  RCP<ParameterList> vdpm_pl = sublist(pList, "VanDerPolModel", true);
431  auto model = rcp(new VanDerPolModel<double>(vdpm_pl));
432 
433  // Setup the Integrator and reset initial time step
434  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
435 
436  //dt = pl->sublist("Demo Integrator")
437  // .sublist("Time Step Control")
438  // .get<double>("Initial Time Step");
439  const int numTimeSteps = pl->sublist("Demo Integrator")
440  .sublist("Time Step Control")
441  .get<int>("Number of Time Steps");
442 
444  Tempus::createIntegratorBasic<double>(pl, model);
445 
446  // Integrate to timeMax
447  bool integratorStatus = integrator->advanceTime();
448  TEST_ASSERT(integratorStatus)
449 
450  // check that the number of time steps taken is whats is set
451  // in the parameter list
452  TEST_EQUALITY(numTimeSteps, integrator->getIndex());
453 }
454 
455 
456 // ************************************************************
457 // ************************************************************
458 TEUCHOS_UNIT_TEST(ForwardEuler, Variable_TimeSteps)
459 {
460  // Read params from .xml file
461  RCP<ParameterList> pList =
462  getParametersFromXmlFile("Tempus_ForwardEuler_VanDerPol.xml");
463 
464  // Setup the VanDerPolModel
465  RCP<ParameterList> vdpm_pl = sublist(pList, "VanDerPolModel", true);
466  auto model = rcp(new VanDerPolModel<double>(vdpm_pl));
467 
468  // Setup the Integrator and reset initial time step
469  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
470 
471  // Set parameters for this test.
472  pl->sublist("Demo Integrator")
473  .sublist("Time Step Control").set("Initial Time Step", 0.01);
474 
475  pl->sublist("Demo Integrator")
476  .sublist("Time Step Control")
477  .sublist("Time Step Control Strategy").set("Reduction Factor", 0.9);
478  pl->sublist("Demo Integrator")
479  .sublist("Time Step Control")
480  .sublist("Time Step Control Strategy").set("Amplification Factor", 1.15);
481  pl->sublist("Demo Integrator")
482  .sublist("Time Step Control")
483  .sublist("Time Step Control Strategy").set("Minimum Value Monitoring Function", 0.05);
484  pl->sublist("Demo Integrator")
485  .sublist("Time Step Control")
486  .sublist("Time Step Control Strategy").set("Maximum Value Monitoring Function", 0.1);
487 
488  pl->sublist("Demo Integrator")
489  .sublist("Solution History").set("Storage Type", "Static");
490  pl->sublist("Demo Integrator")
491  .sublist("Solution History").set("Storage Limit", 3);
492 
494  Tempus::createIntegratorBasic<double>(pl, model);
495 
496  // Integrate to timeMax
497  bool integratorStatus = integrator->advanceTime();
498  TEST_ASSERT(integratorStatus)
499 
500  // Check 'Final Time'
501  double time = integrator->getTime();
502  double timeFinal =pl->sublist("Demo Integrator")
503  .sublist("Time Step Control").get<double>("Final Time");
504  TEST_FLOATING_EQUALITY(time, timeFinal, 1.0e-14);
505 
506  // Check TimeStep size
507  auto state = integrator->getCurrentState();
508  double dt = state->getTimeStep();
509  TEST_FLOATING_EQUALITY(dt, 0.008310677297208358, 1.0e-12);
510 
511  // Check number of time steps taken
512  const int numTimeSteps = 60;
513  TEST_EQUALITY(numTimeSteps, integrator->getIndex());
514 
515  // Time-integrated solution and the reference solution
516  RCP<Thyra::VectorBase<double> > x = integrator->getX();
517  RCP<Thyra::VectorBase<double> > x_ref = x->clone_v();
518  {
519  Thyra::DetachedVectorView<double> x_ref_view( *x_ref );
520  x_ref_view[0] = -1.931946840284863;
521  x_ref_view[1] = 0.645346748303107;
522  }
523 
524  // Calculate the error
525  RCP<Thyra::VectorBase<double> > xdiff = x->clone_v();
526  Thyra::V_StVpStV(xdiff.ptr(), 1.0, *x_ref, -1.0, *(x));
527 
528  // Check the solution
529  std::cout << " Stepper = ForwardEuler" << std::endl;
530  std::cout << " =========================" << std::endl;
531  std::cout << " Reference solution: " << get_ele(*(x_ref), 0) << " "
532  << get_ele(*(x_ref), 1) << std::endl;
533  std::cout << " Computed solution : " << get_ele(*(x ), 0) << " "
534  << get_ele(*(x ), 1) << std::endl;
535  std::cout << " Difference : " << get_ele(*(xdiff), 0) << " "
536  << get_ele(*(xdiff), 1) << std::endl;
537  std::cout << " =========================" << std::endl;
538  TEST_FLOATING_EQUALITY(get_ele(*(x), 0), get_ele(*(x_ref), 0), 1.0e-12);
539  TEST_FLOATING_EQUALITY(get_ele(*(x), 1), get_ele(*(x_ref), 1), 1.0e-12);
540 }
541 
542 
543 } // namespace Tempus_Test
Teuchos::RCP< SolutionState< Scalar > > createSolutionStateX(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xdot=Teuchos::null, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xdotdot=Teuchos::null)
Nonmember constructor from non-const solution vectors, x.
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEST_FLOATING_EQUALITY(v1, v2, tol)
#define TEST_ASSERT(v1)
T * get() const
Sine-Cosine model problem from Rythmos. This is a canonical Sine-Cosine differential equation with a...
void writeSolution(const std::string filename, Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > solutionHistory)
void writeOrderError(const std::string filename, Teuchos::RCP< Tempus::Stepper< Scalar > > stepper, std::vector< Scalar > &StepSize, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutions, std::vector< Scalar > &xErrorNorm, Scalar &xSlope, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutionsDot, std::vector< Scalar > &xDotErrorNorm, Scalar &xDotSlope, std::vector< Teuchos::RCP< Thyra::VectorBase< Scalar >>> &solutionsDotDot, std::vector< Scalar > &xDotDotErrorNorm, Scalar &xDotDotSlope)
TEUCHOS_UNIT_TEST(BackwardEuler, SinCos_ASA)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static void summarize(Ptr< const Comm< int > > comm, std::ostream &out=std::cout, const bool alwaysWriteLocal=false, const bool writeGlobalStats=true, const bool writeZeroTimers=true, const ECounterSetOp setOp=Intersection, const std::string &filter="", const bool ignoreZeroTimers=false)
Ptr< T > ptr() const
TimeStepControl manages the time step size. There several mechanisms that effect the time step size a...
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Keep a fix number of states.
van der Pol model problem for nonlinear electrical circuit.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
#define TEST_EQUALITY(v1, v2)
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...