Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_StepperNewmarkExplicitAForm_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_StepperNewmarkExplicitAForm_decl_hpp
11 #define Tempus_StepperNewmarkExplicitAForm_decl_hpp
12 
13 #include "Tempus_config.hpp"
14 #include "Tempus_StepperExplicit.hpp"
16 
17 namespace Tempus {
18 
92 template <class Scalar>
94  : virtual public Tempus::StepperExplicit<Scalar> {
95  public:
102 
105  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& appModel,
106  bool useFSAL, std::string ICConsistency, bool ICConsistencyCheck,
107  Scalar gamma,
109  stepperAppAction);
110 
112  getAppAction() const
113  {
115  }
116 
118  virtual void setInitialConditions(
119  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory);
120 
122  virtual void takeStep(
123  const Teuchos::RCP<SolutionHistory<Scalar> >& solutionHistory);
124 
127  virtual Scalar getOrder() const
128  {
129  if (gamma_ == 0.5)
130  return 2.0;
131  else
132  return 1.0;
133  }
134  virtual Scalar getOrderMin() const { return 1.0; }
135  virtual Scalar getOrderMax() const { return 2.0; }
136  virtual Scalar getInitTimeStep(
137  const Teuchos::RCP<SolutionHistory<Scalar> >& /* solutionHistory */) const
138  {
139  return Scalar(1.0e+99);
140  }
141 
142  virtual bool isExplicit() const { return true; }
143  virtual bool isImplicit() const { return false; }
144  virtual bool isExplicitImplicit() const
145  {
146  return isExplicit() && isImplicit();
147  }
148  virtual bool isOneStepMethod() const { return true; }
149  virtual bool isMultiStepMethod() const { return !isOneStepMethod(); }
150  virtual void setUseFSAL(bool a)
151  {
152  this->useFSAL_ = a;
153  this->isInitialized_ = false;
154  }
155  virtual OrderODE getOrderODE() const { return SECOND_ORDER_ODE; }
157 
159 
161 
162  virtual void describe(Teuchos::FancyOStream& out,
163  const Teuchos::EVerbosityLevel verbLevel) const;
165 
166  virtual bool isValidSetup(Teuchos::FancyOStream& out) const;
167 
169  const Thyra::VectorBase<Scalar>& v,
170  const Thyra::VectorBase<Scalar>& a,
171  const Scalar dt) const;
172 
174  const Thyra::VectorBase<Scalar>& d,
175  const Thyra::VectorBase<Scalar>& v,
176  const Thyra::VectorBase<Scalar>& a,
177  const Scalar dt) const;
178 
180  const Thyra::VectorBase<Scalar>& vPred,
181  const Thyra::VectorBase<Scalar>& a,
182  const Scalar dt) const;
183 
184  void setGamma(Scalar gamma)
185  {
186  gamma_ = gamma;
187 
189  (gamma_ > 1.0) || (gamma_ < 0.0), std::logic_error,
190  "Error in 'Newmark Explicit a-Form' stepper: invalid value of Gamma = "
191  << gamma_ << ". Please select 0 <= Gamma <= 1. \n");
192 
193  this->isInitialized_ = false;
194  }
195 
196  virtual void setAppAction(
198 
199  protected:
201  Scalar gamma_;
204 };
205 
207 // ------------------------------------------------------------------------
208 template <class Scalar>
211  const Teuchos::RCP<const Thyra::ModelEvaluator<Scalar> >& model,
213 
214 } // namespace Tempus
215 
216 #endif // Tempus_StepperNewmarkExplicitAForm_decl_hpp
Application Action for StepperNewmarkExplicitAForm.
void predictDisplacement(Thyra::VectorBase< Scalar > &dPred, const Thyra::VectorBase< Scalar > &d, const Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual Teuchos::RCP< Tempus::StepperState< Scalar > > getDefaultStepperState()
Get a default (initial) StepperState.
Teuchos::RCP< StepperNewmarkExplicitAFormAppAction< Scalar > > stepperNewmarkExpAppAction_
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool isInitialized_
True if stepper&#39;s member data is initialized.
virtual void setInitialConditions(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Set the initial conditions and make them consistent.
virtual void takeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &solutionHistory)
Take the specified timestep, dt, and return true if successful.
virtual Scalar getInitTimeStep(const Teuchos::RCP< SolutionHistory< Scalar > > &) const
Stepper integrates second-order ODEs.
bool useFSAL_
Use First-Same-As-Last (FSAL) principle.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
void predictVelocity(Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
virtual Teuchos::RCP< StepperNewmarkExplicitAFormAppAction< Scalar > > getAppAction() const
Teuchos::RCP< StepperNewmarkExplicitAForm< Scalar > > createStepperNewmarkExplicitAForm(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, Teuchos::RCP< Teuchos::ParameterList > pl)
Nonmember constructor - ModelEvaluator and ParameterList.
virtual bool isValidSetup(Teuchos::FancyOStream &out) const
void correctVelocity(Thyra::VectorBase< Scalar > &v, const Thyra::VectorBase< Scalar > &vPred, const Thyra::VectorBase< Scalar > &a, const Scalar dt) const
Thyra Base interface for implicit time steppers.
virtual void setAppAction(Teuchos::RCP< StepperNewmarkExplicitAFormAppAction< Scalar > > appAction)
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const