Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_StepperSubcycling_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_StepperSubcycling_decl_hpp
11 #define Tempus_StepperSubcycling_decl_hpp
12 
13 #include "Tempus_config.hpp"
14 #include "Tempus_StepperExplicit.hpp"
16 #include "Tempus_IntegratorBasic.hpp"
17 
18 namespace Tempus {
19 
52 template <class Scalar>
53 class StepperSubcycling : virtual public Tempus::Stepper<Scalar> {
54  public:
61 
64  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel,
65  const Teuchos::RCP<IntegratorBasic<Scalar> >& integrator, bool useFSAL,
66  std::string ICConsistency, bool ICConsistencyCheck,
68  stepperSCAppAction);
69 
71 
72  virtual void setModel(
73  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel);
74 
75  virtual void setNonConstModel(
77 
79  {
80  return scIntegrator_->getStepper()->getModel();
81  }
82 
84  appAction = Teuchos::null);
85 
87  {
88  return stepperSCAppAction_;
89  }
90 
92  virtual void initialize();
93 
94  virtual Scalar getInitTimeStep(
95  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory) const;
96 
98  virtual void setInitialConditions(
99  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory);
100 
102  // thus a no-op for explicit steppers.
103  virtual void setInitialGuess(
104  Teuchos::RCP<const Thyra::VectorBase<Scalar> > initial_guess);
105 
106  virtual void setSolver(
107  Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> > solver = Teuchos::null);
108 
110 
112  virtual void takeStep(
113  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory);
114 
117 
118  virtual bool isExplicit() const;
119  virtual bool isImplicit() const;
120  virtual bool isExplicitImplicit() const;
121  virtual bool isOneStepMethod() const;
122  virtual bool isMultiStepMethod() const;
123 
124  virtual Scalar getOrder() const;
125  virtual Scalar getOrderMin() const;
126  virtual Scalar getOrderMax() const;
127  virtual OrderODE getOrderODE() const;
129 
131 
133 
134  virtual void describe(Teuchos::FancyOStream& out,
135  const Teuchos::EVerbosityLevel verbLevel) const;
137 
139 
140  virtual void setSubcyclingStepper(Teuchos::RCP<Stepper<Scalar> > stepper);
141  virtual void setSubcyclingMinTimeStep(Scalar MinTimeStep);
142  virtual void setSubcyclingInitTimeStep(Scalar InitTimeStep);
143  virtual void setSubcyclingMaxTimeStep(Scalar MaxTimeStep);
144  virtual void setSubcyclingMaxFailures(int MaxFailures);
145  virtual void setSubcyclingMaxConsecFailures(int MaxConsecFailures);
146  virtual void setSubcyclingScreenOutputIndexInterval(int i);
147  virtual void setSubcyclingScreenOutputIndexList(std::string s);
150  virtual void setSubcyclingIntegratorObserver(
152  virtual void setSubcyclingPrintDtChanges(bool printDtChanges);
154 
156 
158  virtual Scalar getSubcyclingMinTimeStep() const;
159  virtual Scalar getSubcyclingInitTimeStep() const;
160  virtual Scalar getSubcyclingMaxTimeStep() const;
161  virtual std::string getSubcyclingStepType() const;
162  virtual int getSubcyclingMaxFailures() const;
163  virtual int getSubcyclingMaxConsecFailures() const;
164  virtual int getSubcyclingScreenOutputIndexInterval() const;
165  virtual std::string getSubcyclingScreenOutputIndexList() const;
170  virtual bool getSubcyclingPrintDtChanges() const;
172 
173  protected:
176 };
177 
179 // ------------------------------------------------------------------------
180 template <class Scalar>
182  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& model,
184 
185 } // namespace Tempus
186 
187 #endif // Tempus_StepperSubcycling_decl_hpp
virtual int getSubcyclingMaxConsecFailures() const
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
virtual void setSubcyclingStepper(Teuchos::RCP< Stepper< Scalar > > stepper)
virtual void initialize()
Initialize during construction and after changing input parameters.
virtual void setSubcyclingMinTimeStep(Scalar MinTimeStep)
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
virtual void setSubcyclingScreenOutputIndexInterval(int i)
virtual void setSubcyclingMaxTimeStep(Scalar MaxTimeStep)
Teuchos::RCP< IntegratorBasic< Scalar > > scIntegrator_
virtual Scalar getSubcyclingMaxTimeStep() const
Teuchos::RCP< StepperSubcycling< Scalar > > createStepperSubcycling(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > pl)
Nonmember constructor - ModelEvaluator and ParameterList.
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Get a default (initial) StepperState.
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
virtual void setSolver(Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver=Teuchos::null)
Set solver.
virtual void setSubcyclingMaxConsecFailures(int MaxConsecFailures)
virtual void setSubcyclingTimeStepControlStrategy(Teuchos::RCP< TimeStepControlStrategy< Scalar > > tscs)
Application Action for StepperSubcycling.
Thyra Base interface for time steppers.
virtual Teuchos::RCP< IntegratorObserver< Scalar > > getSubcyclingIntegratorObserver() const
virtual int getSubcyclingScreenOutputIndexInterval() const
virtual void setSubcyclingIntegratorObserver(Teuchos::RCP< IntegratorObserver< Scalar > > obs)
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getModel() const
IntegratorObserver class for time integrators.
virtual Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > getSolver() const
Get solver.
virtual void setSubcyclingScreenOutputIndexList(std::string s)
virtual std::string getSubcyclingStepType() const
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
Teuchos::RCP< StepperSubcyclingAppAction< Scalar > > stepperSCAppAction_
virtual Scalar getInitTimeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory) const
virtual void setSubcyclingInitTimeStep(Scalar InitTimeStep)
virtual void setInitialGuess(Teuchos::RCP< const Thyra::VectorBase< Scalar > > initial_guess)
Pass initial guess to Newton solver (only relevant for implicit solvers)
virtual Teuchos::RCP< const Stepper< Scalar > > getSubcyclingStepper() const
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
virtual void setSubcyclingPrintDtChanges(bool printDtChanges)
virtual Teuchos::RCP< StepperSubcyclingAppAction< Scalar > > getAppAction() const
virtual std::string getSubcyclingScreenOutputIndexList() const
virtual Scalar getSubcyclingMinTimeStep() const
virtual bool getSubcyclingPrintDtChanges() const
TimeStepControlStrategy class for TimeStepControl.
virtual Teuchos::RCP< TimeStepControlStrategy< Scalar > > getSubcyclingTimeStepControlStrategy() const
virtual Scalar getSubcyclingInitTimeStep() const
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions, make them consistent, and set needed memory.
virtual void setNonConstModel(const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &appModel)
virtual void setAppAction(Teuchos::RCP< StepperSubcyclingAppAction< Scalar > > appAction=Teuchos::null)
virtual void setSubcyclingMaxFailures(int MaxFailures)