9 #ifndef Tempus_SolutionState_decl_hpp
10 #define Tempus_SolutionState_decl_hpp
13 #include "Teuchos_VerboseObject.hpp"
14 #include "Teuchos_Describable.hpp"
16 #include "Thyra_VectorBase.hpp"
17 #include "Thyra_ModelEvaluator.hpp"
19 #include "Tempus_config.hpp"
20 #include "Tempus_SolutionStateMetaData.hpp"
22 #include "Tempus_PhysicsState.hpp"
55 template<
class Scalar>
57 public Teuchos::Describable,
58 public Teuchos::VerboseObject<Tempus::SolutionState<Scalar> >
69 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
71 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& x,
72 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xdot = Teuchos::null,
73 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xddot = Teuchos::null,
78 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& x,
79 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& xdot = Teuchos::null,
80 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& xddot= Teuchos::null,
87 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& x,
88 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xdot,
89 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xdotdot,
95 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& x,
96 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& xdot,
97 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& xdotdot,
101 #ifndef TEMPUS_HIDE_DEPRECATED_CODE
103 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
112 virtual Teuchos::RCP<SolutionState<Scalar> >
clone()
const;
126 virtual Teuchos::RCP<const SolutionStateMetaData<Scalar> >
128 virtual Teuchos::RCP<SolutionStateMetaData<Scalar> >
getMetaData()
182 metaData_nc_->setNConsecutiveFailures(nConsecutiveFailures); }
201 if (sStatus.solveStatus == Thyra::SOLVE_STATUS_CONVERGED )
221 virtual Teuchos::RCP<Thyra::VectorBase<Scalar> >
getX()
222 { TEUCHOS_ASSERT(
x_nc_ != Teuchos::null);
224 virtual Teuchos::RCP<const Thyra::VectorBase<Scalar> >
getX()
const
226 virtual Teuchos::RCP<Thyra::VectorBase<Scalar> >
getXDot()
228 virtual Teuchos::RCP<const Thyra::VectorBase<Scalar> >
getXDot()
const
230 virtual Teuchos::RCP<Thyra::VectorBase<Scalar> >
getXDotDot()
232 virtual Teuchos::RCP<const Thyra::VectorBase<Scalar> >
getXDotDot()
const
249 virtual void setX(Teuchos::RCP<Thyra::VectorBase<Scalar> > x)
251 virtual void setX(Teuchos::RCP<
const Thyra::VectorBase<Scalar> > x)
252 {
x_nc_ = Teuchos::null;
x_ = x; }
253 virtual void setXDot(Teuchos::RCP<Thyra::VectorBase<Scalar> > xdot)
255 virtual void setXDot(Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xdot)
257 virtual void setXDotDot(Teuchos::RCP<Thyra::VectorBase<Scalar> > xdotdot)
259 virtual void setXDotDot(Teuchos::RCP<
const Thyra::VectorBase<Scalar> > xdotdot)
277 bool operator< (const SolutionState<Scalar>& ss)
const;
280 bool operator<= (const SolutionState<Scalar>& ss)
const;
310 virtual void describe(Teuchos::FancyOStream &out,
311 const Teuchos::EVerbosityLevel verbLevel)
const;
322 Teuchos::RCP<const SolutionStateMetaData<Scalar> >
metaData_;
326 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
x_;
327 Teuchos::RCP<Thyra::VectorBase<Scalar> >
x_nc_;
330 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xdot_;
334 Teuchos::RCP<const Thyra::VectorBase<Scalar> >
xdotdot_;
349 template<
class Scalar>
350 Teuchos::RCP<SolutionState<Scalar> >
352 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& x,
353 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xdot = Teuchos::null,
354 const Teuchos::RCP<Thyra::VectorBase<Scalar> >& xdotdot = Teuchos::null);
357 template<
class Scalar>
358 Teuchos::RCP<SolutionState<Scalar> >
360 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& x,
361 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& xdot =Teuchos::null,
362 const Teuchos::RCP<
const Thyra::VectorBase<Scalar> >& xdotdot =Teuchos::null);
365 template<
class Scalar>
366 Teuchos::RCP<SolutionState<Scalar> >
368 const Teuchos::RCP<
const Thyra::ModelEvaluator<Scalar> >& model,
376 #endif // Tempus_SolutionState_decl_hpp
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.
PhysicsState is a simple class to hold information about the physics.
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDot() const
virtual void setXNormL2(Scalar xNormL2)
virtual Teuchos::RCP< StepperState< Scalar > > getStepperState()
virtual int getNRunningFailures() const
virtual void setNFailures(int nFailures)
virtual void setStepperState(const Teuchos::RCP< StepperState< Scalar > > &ss)
virtual int getOrder() const
Teuchos::RCP< Thyra::VectorBase< Scalar > > xdot_nc_
virtual bool getOutputScreen() const
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getXDot()
virtual void setDxNormL2Rel(Scalar dxNormL2Rel)
virtual void setXDot(Teuchos::RCP< const Thyra::VectorBase< Scalar > > xdot)
virtual void setErrorAbs(Scalar errorAbs)
virtual Scalar getTolRel() const
Teuchos::RCP< const SolutionStateMetaData< Scalar > > metaData_
Meta Data for the solution state.
virtual void setTolAbs(Scalar tolAbs)
virtual void setStepperState(Teuchos::RCP< StepperState< Scalar > > &ss)
virtual Scalar getTolAbs() const
virtual int getNConsecutiveFailures() const
virtual void setIsSynced(bool isSynced)
virtual void setIsInterpolated(bool isInterpolated)
virtual void setXDot(Teuchos::RCP< Thyra::VectorBase< Scalar > > xdot)
virtual int getIndex() const
Teuchos::RCP< PhysicsState< Scalar > > physicsState_nc_
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getX() const
virtual int getNFailures() const
Teuchos::RCP< const PhysicsState< Scalar > > physicsState_
PhysicsState for this SolutionState.
virtual Scalar getXNormL2() const
virtual void setDxNormL2Abs(Scalar dxNormL2Abs)
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xdotdot_
Second time derivative of the solution.
virtual bool getOutput() const
virtual Teuchos::RCP< PhysicsState< Scalar > > getPhysicsState()
Teuchos::RCP< Thyra::VectorBase< Scalar > > xdotdot_nc_
StepperState is a simple class to hold state information about the stepper.
virtual void setIndex(Scalar index)
virtual Scalar getTime() const
bool operator>(const SolutionState< Scalar > &ss) const
Less than comparison for sorting based on time.
Status
Status for the Integrator, the Stepper and the SolutionState.
Teuchos::RCP< const StepperState< Scalar > > stepperState_
StepperState for this SolutionState.
virtual void setSolutionStatus(const Thyra::SolveStatus< Scalar > sStatus)
virtual void setTimeStep(Scalar dt)
virtual void setErrorRel(Scalar errorRel)
virtual void setNRunningFailures(int nFailures)
virtual void copySolutionData(const Teuchos::RCP< const SolutionState< Scalar > > &s)
Deep copy solution data, but keep metaData untouched.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getXDotDot()
virtual void setSolutionStatus(Status s)
virtual Teuchos::RCP< const PhysicsState< Scalar > > getPhysicsState() const
SolutionState()
Default Constructor – Not meant for immediate adding to SolutionHistory. This constructor does not se...
virtual void setX(Teuchos::RCP< const Thyra::VectorBase< Scalar > > x)
virtual Teuchos::RCP< const StepperState< Scalar > > getStepperState() const
virtual void setNConsecutiveFailures(int nConsecutiveFailures)
virtual bool getIsSynced() const
virtual Scalar getDxNormL2Rel() const
bool operator>=(const SolutionState< Scalar > &ss) const
Less than comparison for sorting based on time.
virtual bool getComputeNorms() const
Teuchos::RCP< SolutionState< Scalar > > createSolutionStateME(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< StepperState< Scalar > > &stepperState=Teuchos::null, const Teuchos::RCP< PhysicsState< Scalar > > &physicsState=Teuchos::null)
Nonmember constructor from Thyra ModelEvaluator.
virtual void setXDotDot(Teuchos::RCP< Thyra::VectorBase< Scalar > > xdotdot)
Teuchos::RCP< const Thyra::VectorBase< Scalar > > x_
Solution.
Teuchos::RCP< Thyra::VectorBase< Scalar > > x_nc_
bool operator==(const SolutionState< Scalar > &ss) const
Equality comparison for matching.
Teuchos::RCP< StepperState< Scalar > > stepperState_nc_
virtual Teuchos::RCP< SolutionStateMetaData< Scalar > > getMetaData()
virtual Scalar getErrorAbs() const
virtual void setAccuracy(bool accuracy)
virtual ~SolutionState()
Destructor.
virtual void setOutputScreen(bool output)
bool operator<=(const SolutionState< Scalar > &ss) const
Less than comparison for sorting based on time.
virtual Teuchos::RCP< SolutionState< Scalar > > clone() const
This is a deep copy constructor.
virtual void computeNorms(const Teuchos::RCP< const SolutionState< Scalar > > &ssIn=Teuchos::null)
Compute the solution norms, and solution change from ssIn, if provided.
virtual Teuchos::RCP< const SolutionStateMetaData< Scalar > > getMetaData() const
bool operator<(const SolutionState< Scalar > &ss) const
Less than comparison for sorting based on time.
virtual Scalar getDxNormL2Abs() const
virtual Scalar getErrorRel() const
virtual bool getIsInterpolated() const
virtual void setOrder(int order)
virtual bool getAccuracy() const
virtual void setX(Teuchos::RCP< Thyra::VectorBase< Scalar > > x)
virtual void setPhysicsState(const Teuchos::RCP< PhysicsState< Scalar > > &ps)
virtual void setXDotDot(Teuchos::RCP< const Thyra::VectorBase< Scalar > > xdotdot)
virtual void setMetaData(Teuchos::RCP< SolutionStateMetaData< Scalar > > md)
virtual Status getSolutionStatus() const
virtual void setMetaData(Teuchos::RCP< const SolutionStateMetaData< Scalar > > md)
virtual Scalar getTimeStep() const
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getX()
virtual void setTime(Scalar time)
virtual void setPhysicsState(Teuchos::RCP< PhysicsState< Scalar > > &ps)
virtual void setComputeNorms(bool computeNorms)
virtual Teuchos::RCP< const Thyra::VectorBase< Scalar > > getXDotDot() const
Teuchos::RCP< const Thyra::VectorBase< Scalar > > xdot_
Time derivative of the solution.
virtual void setOutput(bool output)
virtual std::string description() const
Solution state for integrators and steppers. SolutionState contains the metadata for solutions and th...
virtual void setTolRel(Scalar tolRel)
Teuchos::RCP< SolutionStateMetaData< Scalar > > metaData_nc_
virtual void copy(const Teuchos::RCP< const SolutionState< Scalar > > &ss)
This is a deep copy.