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::getParametersFromXmlFile;
31 using Teuchos::RCP;
32 using Teuchos::rcp;
33 using Teuchos::rcp_const_cast;
34 using Teuchos::sublist;
35 
39 
40 // ************************************************************
41 // ************************************************************
43 {
44  // Read params from .xml file
45  RCP<ParameterList> pList =
46  getParametersFromXmlFile("Tempus_ForwardEuler_SinCos.xml");
47 
48  // Setup the SinCosModel
49  RCP<ParameterList> scm_pl = sublist(pList, "SinCosModel", true);
50  auto model = rcp(new SinCosModel<double>(scm_pl));
51 
52  RCP<ParameterList> tempusPL = sublist(pList, "Tempus", true);
53 
54  // Test constructor IntegratorBasic(tempusPL, model)
55  {
57  Tempus::createIntegratorBasic<double>(tempusPL, model);
58 
59  RCP<ParameterList> stepperPL = sublist(tempusPL, "Demo Stepper", true);
60  RCP<const ParameterList> defaultPL =
61  integrator->getStepper()->getValidParameters();
62 
63  bool pass = haveSameValuesSorted(*stepperPL, *defaultPL, true);
64  if (!pass) {
65  out << std::endl;
66  out << "stepperPL -------------- \n"
67  << *stepperPL << std::endl;
68  out << "defaultPL -------------- \n"
69  << *defaultPL << std::endl;
70  }
71  TEST_ASSERT(pass)
72  }
73 
74  // Test constructor IntegratorBasic(model, stepperType)
75  {
77  Tempus::createIntegratorBasic<double>(model,
78  std::string("Forward Euler"));
79 
80  RCP<ParameterList> stepperPL = sublist(tempusPL, "Demo Stepper", true);
81  RCP<const ParameterList> defaultPL =
82  integrator->getStepper()->getValidParameters();
83 
84  bool pass = haveSameValuesSorted(*stepperPL, *defaultPL, true);
85  if (!pass) {
86  out << std::endl;
87  out << "stepperPL -------------- \n"
88  << *stepperPL << std::endl;
89  out << "defaultPL -------------- \n"
90  << *defaultPL << std::endl;
91  }
92  TEST_ASSERT(pass)
93  }
94 }
95 
96 // ************************************************************
97 // ************************************************************
98 TEUCHOS_UNIT_TEST(ForwardEuler, ConstructingFromDefaults)
99 {
100  double dt = 0.1;
101  std::vector<std::string> options;
102  options.push_back("useFSAL=true");
103  options.push_back("useFSAL=false");
104  options.push_back("ICConsistency and Check");
105 
106  for (const auto& option : options) {
107  // Read params from .xml file
108  RCP<ParameterList> pList =
109  getParametersFromXmlFile("Tempus_ForwardEuler_SinCos.xml");
110  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
111 
112  // Setup the SinCosModel
113  RCP<ParameterList> scm_pl = sublist(pList, "SinCosModel", true);
114  // RCP<SinCosModel<double> > model = sineCosineModel(scm_pl);
115  auto model = rcp(new SinCosModel<double>(scm_pl));
116 
117  // Setup Stepper for field solve ----------------------------
118  auto stepper = rcp(new Tempus::StepperForwardEuler<double>());
119  stepper->setModel(model);
120  if (option == "useFSAL=true")
121  stepper->setUseFSAL(true);
122  else if (option == "useFSAL=false")
123  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 =
133  pl->sublist("Demo Integrator").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 =
143  rcp_const_cast<Thyra::VectorBase<double>>(inArgsIC.get_x());
144  auto icState = Tempus::createSolutionStateX(icSolution);
145  icState->setTime(timeStepControl->getInitTime());
146  icState->setIndex(timeStepControl->getInitIndex());
147  icState->setTimeStep(0.0);
148  icState->setSolutionStatus(Tempus::Status::PASSED); // ICs are passing.
149 
150  // Setup SolutionHistory ------------------------------------
151  auto solutionHistory = rcp(new Tempus::SolutionHistory<double>());
152  solutionHistory->setName("Forward States");
153  solutionHistory->setStorageType(Tempus::STORAGE_TYPE_STATIC);
154  solutionHistory->setStorageLimit(2);
155  solutionHistory->addState(icState);
156 
157  // Ensure ICs are consistent and stepper memory is set (e.g., xDot is set).
158  stepper->setInitialConditions(solutionHistory);
159 
160  // Setup Integrator -----------------------------------------
162  Tempus::createIntegratorBasic<double>();
163  integrator->setStepper(stepper);
164  integrator->setTimeStepControl(timeStepControl);
165  integrator->setSolutionHistory(solutionHistory);
166  // integrator->setObserver(...);
167  integrator->initialize();
168 
169  // Integrate to timeMax
170  bool integratorStatus = integrator->advanceTime();
171  TEST_ASSERT(integratorStatus)
172 
173  // Test if at 'Final Time'
174  double time = integrator->getTime();
175  double timeFinal = pl->sublist("Demo Integrator")
176  .sublist("Time Step Control")
177  .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  out << " Stepper = " << stepper->description() << "\n with "
191  << option << std::endl;
192  out << " =========================" << std::endl;
193  out << " Exact solution : " << get_ele(*(x_exact), 0) << " "
194  << get_ele(*(x_exact), 1) << std::endl;
195  out << " Computed solution: " << get_ele(*(x), 0) << " "
196  << get_ele(*(x), 1) << std::endl;
197  out << " Difference : " << get_ele(*(xdiff), 0) << " "
198  << get_ele(*(xdiff), 1) << std::endl;
199  out << " =========================" << 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 TEUCHOS_UNIT_TEST(ForwardEuler, SinCos)
208 {
210  std::vector<RCP<Thyra::VectorBase<double>>> solutions;
211  std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
212  std::vector<double> StepSize;
213  std::vector<double> xErrorNorm;
214  std::vector<double> xDotErrorNorm;
215  const int nTimeStepSizes = 7;
216  double dt = 0.2;
217  double time = 0.0;
218  for (int n = 0; n < nTimeStepSizes; n++) {
219  // Read params from .xml file
220  RCP<ParameterList> pList =
221  getParametersFromXmlFile("Tempus_ForwardEuler_SinCos.xml");
222 
223  // std::ofstream ftmp("PL.txt");
224  // pList->print(ftmp);
225  // ftmp.close();
226 
227  // Setup the SinCosModel
228  RCP<ParameterList> scm_pl = sublist(pList, "SinCosModel", true);
229  // RCP<SinCosModel<double> > model = sineCosineModel(scm_pl);
230  auto model = rcp(new SinCosModel<double>(scm_pl));
231 
232  dt /= 2;
233 
234  // Setup the Integrator and reset initial time step
235  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
236  pl->sublist("Demo Integrator")
237  .sublist("Time Step Control")
238  .set("Initial Time Step", dt);
239  integrator = Tempus::createIntegratorBasic<double>(pl, model);
240 
241  // Initial Conditions
242  // During the Integrator construction, the initial SolutionState
243  // is set by default to model->getNominalVales().get_x(). However,
244  // the application can set it also by integrator->initializeSolutionHistory.
246  model->getNominalValues().get_x()->clone_v();
247  integrator->initializeSolutionHistory(0.0, x0);
248  integrator->initialize();
249 
250  // Integrate to timeMax
251  bool integratorStatus = integrator->advanceTime();
252  TEST_ASSERT(integratorStatus)
253 
254  // Test PhysicsState
255  RCP<Tempus::PhysicsState<double>> physicsState =
256  integrator->getSolutionHistory()->getCurrentState()->getPhysicsState();
257  TEST_EQUALITY(physicsState->getName(), "Tempus::PhysicsState");
258 
259  // Test if at 'Final Time'
260  time = integrator->getTime();
261  double timeFinal = pl->sublist("Demo Integrator")
262  .sublist("Time Step Control")
263  .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()),
303  solutionExact.ptr());
304  solutions.push_back(solutionExact);
305  auto solutionDotExact = Thyra::createMember(model->get_x_space());
306  Thyra::copy(*(model->getExactSolution(time).get_x_dot()),
307  solutionDotExact.ptr());
308  solutionsDot.push_back(solutionDotExact);
309  }
310  }
311 
312  // Check the order and intercept
313  double xSlope = 0.0;
314  double xDotSlope = 0.0;
315  RCP<Tempus::Stepper<double>> stepper = integrator->getStepper();
316  double order = stepper->getOrder();
317  writeOrderError("Tempus_ForwardEuler_SinCos-Error.dat", stepper, StepSize,
318  solutions, xErrorNorm, xSlope, solutionsDot, xDotErrorNorm,
319  xDotSlope, out);
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 TEUCHOS_UNIT_TEST(ForwardEuler, VanDerPol)
333 {
335  std::vector<RCP<Thyra::VectorBase<double>>> solutions;
336  std::vector<RCP<Thyra::VectorBase<double>>> solutionsDot;
337  std::vector<double> StepSize;
338  std::vector<double> xErrorNorm;
339  std::vector<double> xDotErrorNorm;
340  const int nTimeStepSizes = 7; // 8 for Error plot
341  double dt = 0.2;
342  for (int n = 0; n < nTimeStepSizes; n++) {
343  // Read params from .xml file
344  RCP<ParameterList> pList =
345  getParametersFromXmlFile("Tempus_ForwardEuler_VanDerPol.xml");
346 
347  // Setup the VanDerPolModel
348  RCP<ParameterList> vdpm_pl = sublist(pList, "VanDerPolModel", true);
349  auto model = rcp(new VanDerPolModel<double>(vdpm_pl));
350 
351  // Set the step size
352  dt /= 2;
353  if (n == nTimeStepSizes - 1) dt /= 10.0;
354 
355  // Setup the Integrator and reset initial time step
356  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
357  pl->sublist("Demo Integrator")
358  .sublist("Time Step Control")
359  .set("Initial Time Step", dt);
360  integrator = Tempus::createIntegratorBasic<double>(pl, model);
361 
362  // Integrate to timeMax
363  bool integratorStatus = integrator->advanceTime();
364  TEST_ASSERT(integratorStatus)
365 
366  // Test if at 'Final Time'
367  double time = integrator->getTime();
368  double timeFinal = pl->sublist("Demo Integrator")
369  .sublist("Time Step Control")
370  .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", stepper, StepSize,
400  solutions, xErrorNorm, xSlope, solutionsDot, xDotErrorNorm,
401  xDotSlope, out);
402 
403  TEST_FLOATING_EQUALITY(xSlope, order, 0.10);
404  TEST_FLOATING_EQUALITY(xErrorNorm[0], 0.387476, 1.0e-4);
405  // xDot not yet available for Forward Euler.
406  // TEST_FLOATING_EQUALITY( xDotSlope, 1.74898, 0.10 );
407  // TEST_FLOATING_EQUALITY( xDotErrorNorm[0], 1.0038, 1.0e-4 );
408 
410 }
411 
412 // ************************************************************
413 // ************************************************************
414 TEUCHOS_UNIT_TEST(ForwardEuler, NumberTimeSteps)
415 {
416  std::vector<double> StepSize;
417  std::vector<double> ErrorNorm;
418  // const int nTimeStepSizes = 7;
419  // double dt = 0.2;
420  // double order = 0.0;
421 
422  // Read params from .xml file
423  RCP<ParameterList> pList =
424  getParametersFromXmlFile("Tempus_ForwardEuler_NumberOfTimeSteps.xml");
425 
426  // Setup the VanDerPolModel
427  RCP<ParameterList> vdpm_pl = sublist(pList, "VanDerPolModel", true);
428  auto model = rcp(new VanDerPolModel<double>(vdpm_pl));
429 
430  // Setup the Integrator and reset initial time step
431  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
432 
433  // dt = pl->sublist("Demo Integrator")
434  // .sublist("Time Step Control")
435  // .get<double>("Initial Time Step");
436  const int numTimeSteps = pl->sublist("Demo Integrator")
437  .sublist("Time Step Control")
438  .get<int>("Number of Time Steps");
439 
441  Tempus::createIntegratorBasic<double>(pl, model);
442 
443  // Integrate to timeMax
444  bool integratorStatus = integrator->advanceTime();
445  TEST_ASSERT(integratorStatus)
446 
447  // check that the number of time steps taken is whats is set
448  // in the parameter list
449  TEST_EQUALITY(numTimeSteps, integrator->getIndex());
450 }
451 
452 // ************************************************************
453 // ************************************************************
454 TEUCHOS_UNIT_TEST(ForwardEuler, Variable_TimeSteps)
455 {
456  // Read params from .xml file
457  RCP<ParameterList> pList =
458  getParametersFromXmlFile("Tempus_ForwardEuler_VanDerPol.xml");
459 
460  // Setup the VanDerPolModel
461  RCP<ParameterList> vdpm_pl = sublist(pList, "VanDerPolModel", true);
462  auto model = rcp(new VanDerPolModel<double>(vdpm_pl));
463 
464  // Setup the Integrator and reset initial time step
465  RCP<ParameterList> pl = sublist(pList, "Tempus", true);
466 
467  // Set parameters for this test.
468  pl->sublist("Demo Integrator")
469  .sublist("Time Step Control")
470  .set("Initial Time Step", 0.01);
471 
472  pl->sublist("Demo Integrator")
473  .sublist("Time Step Control")
474  .sublist("Time Step Control Strategy")
475  .set("Reduction Factor", 0.9);
476  pl->sublist("Demo Integrator")
477  .sublist("Time Step Control")
478  .sublist("Time Step Control Strategy")
479  .set("Amplification Factor", 1.15);
480  pl->sublist("Demo Integrator")
481  .sublist("Time Step Control")
482  .sublist("Time Step Control Strategy")
483  .set("Minimum Value Monitoring Function", 0.05);
484  pl->sublist("Demo Integrator")
485  .sublist("Time Step Control")
486  .sublist("Time Step Control Strategy")
487  .set("Maximum Value Monitoring Function", 0.1);
488 
489  pl->sublist("Demo Integrator")
490  .sublist("Solution History")
491  .set("Storage Type", "Static");
492  pl->sublist("Demo Integrator")
493  .sublist("Solution History")
494  .set("Storage Limit", 3);
495 
497  Tempus::createIntegratorBasic<double>(pl, model);
498 
499  // Integrate to timeMax
500  bool integratorStatus = integrator->advanceTime();
501  TEST_ASSERT(integratorStatus)
502 
503  // Check 'Final Time'
504  double time = integrator->getTime();
505  double timeFinal = pl->sublist("Demo Integrator")
506  .sublist("Time Step Control")
507  .get<double>("Final Time");
508  TEST_FLOATING_EQUALITY(time, timeFinal, 1.0e-14);
509 
510  // Check TimeStep size
511  auto state = integrator->getCurrentState();
512  double dt = state->getTimeStep();
513  TEST_FLOATING_EQUALITY(dt, 0.008310677297208358, 1.0e-12);
514 
515  // Check number of time steps taken
516  const int numTimeSteps = 60;
517  TEST_EQUALITY(numTimeSteps, integrator->getIndex());
518 
519  // Time-integrated solution and the reference solution
520  RCP<Thyra::VectorBase<double>> x = integrator->getX();
521  RCP<Thyra::VectorBase<double>> x_ref = x->clone_v();
522  {
523  Thyra::DetachedVectorView<double> x_ref_view(*x_ref);
524  x_ref_view[0] = -1.931946840284863;
525  x_ref_view[1] = 0.645346748303107;
526  }
527 
528  // Calculate the error
529  RCP<Thyra::VectorBase<double>> xdiff = x->clone_v();
530  Thyra::V_StVpStV(xdiff.ptr(), 1.0, *x_ref, -1.0, *(x));
531 
532  // Check the solution
533  out << " Stepper = ForwardEuler" << std::endl;
534  out << " =========================" << std::endl;
535  out << " Reference solution: " << get_ele(*(x_ref), 0) << " "
536  << get_ele(*(x_ref), 1) << std::endl;
537  out << " Computed solution : " << get_ele(*(x), 0) << " "
538  << get_ele(*(x), 1) << std::endl;
539  out << " Difference : " << get_ele(*(xdiff), 0) << " "
540  << get_ele(*(xdiff), 1) << std::endl;
541  out << " =========================" << std::endl;
542  TEST_FLOATING_EQUALITY(get_ele(*(x), 0), get_ele(*(x_ref), 0), 1.0e-12);
543  TEST_FLOATING_EQUALITY(get_ele(*(x), 1), get_ele(*(x_ref), 1), 1.0e-12);
544 }
545 
546 } // 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)
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::FancyOStream &out)
#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)
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.