9 #ifndef Tempus_StepperImplicit_decl_hpp
10 #define Tempus_StepperImplicit_decl_hpp
13 #include "Tempus_Stepper.hpp"
14 #include "Tempus_WrapperModelEvaluatorBasic.hpp"
20 template<
class Scalar>
31 Scalar timeStepSize, Scalar alpha, Scalar beta,
37 Teuchos::RCP<TimeDerivative<Scalar> >
timeDer_;
48 template<
class Scalar>
56 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& appModel);
58 const Teuchos::RCP<Thyra::ModelEvaluator<Scalar> >& appModel);
59 virtual Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >
61 virtual Teuchos::RCP<const WrapperModelEvaluator<Scalar> >
65 virtual void setSolver(std::string solverName);
68 Teuchos::RCP<Teuchos::ParameterList> solverPL=Teuchos::null);
71 Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> > solver);
72 virtual Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >
getSolver()
const
76 {
return stepperPL_->get<std::string>(
"Stepper Type"); }
83 virtual Scalar
getAlpha(
const Scalar dt)
const = 0;
85 virtual Scalar
getBeta (
const Scalar dt)
const = 0;
89 const Teuchos::RCP<Thyra::VectorBase<Scalar> > & x);
93 const Teuchos::RCP<Thyra::VectorBase<Scalar> > & x,
94 const Teuchos::RCP<Thyra::VectorBase<Scalar> > & xDot,
100 Teuchos::RCP<Thyra::VectorBase<Scalar> > & f,
101 const Teuchos::RCP<Thyra::VectorBase<Scalar> > & x,
102 const Teuchos::RCP<Thyra::VectorBase<Scalar> > & xDot,
108 Teuchos::RCP<
const Thyra::VectorBase<Scalar> > initial_guess)
113 {
stepperPL_->set<
bool>(
"Zero Initial Guess", zIG); }
115 {
return stepperPL_->get<
bool>(
"Zero Initial Guess",
false); }
118 {
return Scalar(1.0e+99);}
121 {
return stepperPL_->get<
bool>(
"Use Embedded",
false); }
126 bool defaultUseFSAL =
128 return stepperPL_->get<
bool>(
"Use FSAL", defaultUseFSAL);
132 {
stepperPL_->set<std::string>(
"Initial Condition Consistency", s);}
136 template get<std::string>(
"Initial Condition Consistency");
137 return stepperPL_->get<std::string>(
"Initial Condition Consistency",
138 defaultICConsistency);
142 {
stepperPL_->set<
bool>(
"Initial Condition Consistency Check", c);}
146 template get<bool>(
"Initial Condition Consistency Check");
147 return stepperPL_->get<
bool>(
"Initial Condition Consistency Check",
148 defaultICConsistencyCheck);
168 Teuchos::RCP<Thyra::NonlinearSolverBase<Scalar> >
solver_;
179 #endif // Tempus_StepperImplicit_decl_hpp
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions and make them consistent.
virtual std::string getICConsistency() const
const Thyra::SolveStatus< Scalar > solveImplicitODE(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x)
Solve problem using x in-place. (Needs to be deprecated!)
EVALUATION_TYPE
EVALUATION_TYPE indicates the evaluation to apply to the implicit ODE.
virtual bool getUseFSAL() const
virtual bool getICConsistencyCheck() const
Teuchos::RCP< WrapperModelEvaluator< Scalar > > wrapperModel_
virtual void setICConsistencyCheck(bool c)
Teuchos::RCP< Thyra::VectorBase< Scalar > > stepperXDot_
ImplicitODEParameters()
Constructor.
ImplicitODEParameters(Teuchos::RCP< TimeDerivative< Scalar > > timeDer, Scalar timeStepSize, Scalar alpha, Scalar beta, EVALUATION_TYPE evaluationType=SOLVE_FOR_X)
Constructor.
Teuchos::RCP< Thyra::VectorBase< Scalar > > stepperXDotDot_
virtual void setModel(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &appModel)
virtual Teuchos::RCP< const WrapperModelEvaluator< Scalar > > getWrapperModel()
virtual Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > getSolver() const
Get solver.
Teuchos::RCP< Teuchos::ParameterList > stepperPL_
virtual Scalar getBeta(const Scalar dt) const =0
Return beta = d(x)/dx.
virtual void setStepperXDot(Teuchos::RCP< Thyra::VectorBase< Scalar > > xDot)
Set xDot for Stepper storage.
Teuchos::RCP< TimeDerivative< Scalar > > timeDer_
Thyra Base interface for time steppers.
void evaluateImplicitODE(Teuchos::RCP< Thyra::VectorBase< Scalar > > &f, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &xDot, const Scalar time, const Teuchos::RCP< ImplicitODEParameters< Scalar > > &p)
Evaluate implicit ODE, f(x, xDot, t, p), residual.
Thyra Base interface for implicit time steppers.
virtual Scalar getInitTimeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &) const
virtual void setNonConstModel(const Teuchos::RCP< Thyra::ModelEvaluator< Scalar > > &appModel)
Teuchos::RCP< StepperObserver< Scalar > > stepperObserver_
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getStepperXDot(Teuchos::RCP< SolutionState< Scalar > > state)
Get xDot from SolutionState or Stepper storage.
virtual void setSolver(std::string solverName)
Set solver via ParameterList solver name.
Teuchos::RCP< SolutionHistory< Scalar > > solutionHistory(Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null)
Nonmember constructor.
virtual void setZeroInitialGuess(bool zIG)
Set parameter so that the initial guess is set to zero (=True) or use last timestep (=False)...
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual void setUseFSAL(bool a)
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getModel()
virtual void setInitialGuess(Teuchos::RCP< const Thyra::VectorBase< Scalar > > initial_guess)
Pass initial guess to Newton solver (only relevant for implicit solvers)
This interface defines the time derivative connection between an implicit Stepper and WrapperModelEva...
virtual void setICConsistency(std::string s)
virtual Teuchos::RCP< Teuchos::ParameterList > getDefaultParameters() const =0
virtual std::string getStepperType() const
Teuchos::RCP< const Thyra::VectorBase< Scalar > > initial_guess_
virtual Scalar getAlpha(const Scalar dt) const =0
Return alpha = d(xDot)/dx.
EVALUATION_TYPE evaluationType_
Solve for x and determine xDot from x.
Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > solver_
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...
virtual bool getZeroInitialGuess() const
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getStepperXDotDot(Teuchos::RCP< SolutionState< Scalar > > state)
Get xDotDot from SolutionState or Stepper storage.
virtual bool getEmbedded() const