Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_StepperExplicit_decl.hpp
Go to the documentation of this file.
1 //@HEADER
2 // *****************************************************************************
3 // Tempus: Time Integration and Sensitivity Analysis Package
4 //
5 // Copyright 2017 NTESS and the Tempus contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 //@HEADER
9 
10 #ifndef Tempus_StepperExplicit_decl_hpp
11 #define Tempus_StepperExplicit_decl_hpp
12 
13 // Tempus
14 #include "Tempus_config.hpp"
15 #include "Tempus_Stepper.hpp"
16 
17 template <class Scalar>
19  public:
22 
24  ExplicitODEParameters(Scalar timeStepSize, int stageNumber = 0)
25  : timeStepSize_(timeStepSize), stageNumber_(stageNumber)
26  {
27  }
28 
29  Scalar timeStepSize_;
31 };
32 
33 namespace Tempus {
34 
38 template <class Scalar>
39 class StepperExplicit : virtual public Tempus::Stepper<Scalar> {
40  public:
42 
43  virtual void setModel(
45  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel);
46 
49  {
50  return appModel_;
51  }
52 
53  virtual Scalar getInitTimeStep(
54  const Teuchos::RCP<SolutionHistory<Scalar> >& /* solutionHistory */) const
55  {
56  return std::numeric_limits<Scalar>::max();
57  }
58 
60  virtual void setInitialConditions(
61  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory);
62 
63  virtual void setSolver(
65 
67  {
68  return Teuchos::null;
69  }
70 
72  // thus a no-op for explicit steppers.
73  virtual void setInitialGuess(
74  Teuchos::RCP<const Thyra::VectorBase<Scalar> > /* initial_guess */)
75  {
76  }
77 
78  virtual bool isExplicit() const { return true; }
79  virtual bool isImplicit() const { return false; }
80  virtual bool isExplicitImplicit() const
81  {
82  return isExplicit() && isImplicit();
83  }
84  virtual bool isOneStepMethod() const { return true; }
85  virtual bool isMultiStepMethod() const { return !isOneStepMethod(); }
86 
88  virtual void evaluateExplicitODE(
90  Teuchos::RCP<const Thyra::VectorBase<Scalar> > x, const Scalar time,
92 
94  virtual void evaluateExplicitODE(
97  Teuchos::RCP<const Thyra::VectorBase<Scalar> > xDot, const Scalar time,
100 
102 
103  virtual void describe(Teuchos::FancyOStream& out,
104  const Teuchos::EVerbosityLevel verbLevel) const;
106 
107  virtual bool isValidSetup(Teuchos::FancyOStream& out) const;
108 
111 
112  protected:
115 
118 };
119 
120 } // namespace Tempus
121 #endif // Tempus_StepperExplicit_decl_hpp
virtual bool isValidSetup(Teuchos::FancyOStream &out) const
Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > appModel_
Explicit ODE ModelEvaluator.
virtual void setSolver(Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver)
Set solver.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > outArgs_
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getModel() const
Return the application ModelEvaluator.
Thyra Base interface for time steppers.
ExplicitODEParameters(Scalar timeStepSize, int stageNumber=0)
Constructor.
virtual Scalar getInitTimeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &) const
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions, make them consistent, and set needed memory.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
Set model.
virtual Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > getSolver() const
Get solver.
virtual void setInitialGuess(Teuchos::RCP< const Thyra::VectorBase< Scalar > >)
Pass initial guess to Newton solver (only relevant for implicit solvers)
virtual void evaluateExplicitODE(Teuchos::RCP< Thyra::VectorBase< Scalar > > xDot, Teuchos::RCP< const Thyra::VectorBase< Scalar > > x, const Scalar time, const Teuchos::RCP< ExplicitODEParameters< Scalar > > &p)
Evaluate xDot = f(x,t).
virtual bool isExplicitImplicit() const
virtual bool isMultiStepMethod() const
Thyra::ModelEvaluatorBase::InArgs< Scalar > inArgs_
void setStepperExplicitValues(Teuchos::RCP< Teuchos::ParameterList > pl)
Set StepperExplicit member data from the ParameterList.
Thyra Base interface for implicit time steppers.