Tempus
Version of the Day
Time Integration
|
Consider the ODE:
where is a constant, is a constant damping parameter, is a constant forcing parameter, and is a constant mass parameter, with initial conditions are:
It is straight-forward to show that the exact solution to this ODE is:
where , and . While it is possible to derive the solution to this ODE for the case when and , we do not consider that case here. When , , and , our ODE simplies to a canonical differential equation model of a ball thrown up in the air, with a parabolic trajectory solution, namely
where . An EpetraExt version of this simplified version of the test is implemented in Piro::MockModelEval_B (see Trilinos/packages/piro/test), where it is used to test the Piro (EpetraExt) Newmark-Beta scheme (see input_Solver_NB.xml input file). When and , this test is equivalent to the SinCos model.. More...
#include <HarmonicOscillatorModel_decl.hpp>
Public Member Functions | |
HarmonicOscillatorModel (Teuchos::RCP< Teuchos::ParameterList > pList=Teuchos::null, const bool use_accel_IC=false) | |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | getExactSolution (double t) const |
Public Member Functions inherited from Thyra::StateFuncModelEvaluatorBase< Scalar > | |
RCP< const VectorSpaceBase < Scalar > > | get_p_space (int l) const |
RCP< const Teuchos::Array < std::string > > | get_p_names (int l) const |
RCP< const VectorSpaceBase < Scalar > > | get_g_space (int j) const |
Teuchos::ArrayView< const std::string > | get_g_names (int j) const |
ModelEvaluatorBase::InArgs < Scalar > | getNominalValues () const |
ModelEvaluatorBase::InArgs < Scalar > | getLowerBounds () const |
ModelEvaluatorBase::InArgs < Scalar > | getUpperBounds () const |
RCP< LinearOpBase< Scalar > > | create_W_op () const |
RCP< PreconditionerBase< Scalar > > | create_W_prec () const |
RCP< const LinearOpWithSolveFactoryBase < Scalar > > | get_W_factory () const |
void | reportFinalPoint (const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved) |
Public Member Functions inherited from Thyra::ModelEvaluator< class > | |
virtual int | Np () const =0 |
virtual int | Ng () const =0 |
virtual RCP< const VectorSpaceBase< Scalar > > | get_f_multiplier_space () const =0 |
virtual RCP< const VectorSpaceBase< Scalar > > | get_g_multiplier_space (int j) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_DfDp_op (int l) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_DgDx_dot_op (int j) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_DgDx_op (int j) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_DgDp_op (int j, int l) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_hess_f_xx () const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_hess_f_xp (int l) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_hess_f_pp (int l1, int l2) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_hess_g_xx (int j) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_hess_g_xp (int j, int l) const =0 |
virtual RCP< LinearOpBase < Scalar > > | create_hess_g_pp (int j, int l1, int l2) const =0 |
virtual ModelEvaluatorBase::OutArgs < Scalar > | createOutArgs () const =0 |
virtual void | evalModel (const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const =0 |
ModelEvaluatorBase () | |
std::string | toString (ModelEvaluatorBase::EInArgsMembers) |
std::string | toString (ModelEvaluatorBase::EOutArgsMembers) |
std::string | toString (ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
ModelEvaluatorBase::EDerivativeMultiVectorOrientation | getOtherDerivativeMultiVectorOrientation (ModelEvaluatorBase::EDerivativeMultiVectorOrientation orientation) |
Public Member Functions inherited from Teuchos::Describable | |
virtual std::string | description () const |
virtual void | describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
virtual | ~Describable () |
LabeledObject () | |
virtual | ~LabeledObject () |
virtual void | setObjectLabel (const std::string &objectLabel) |
virtual std::string | getObjectLabel () const |
DescribableStreamManipulatorState | describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default) |
std::ostream & | operator<< (std::ostream &os, const DescribableStreamManipulatorState &d) |
Public Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase | |
RCP< ParameterList > | getNonconstParameterList () |
RCP< ParameterList > | unsetParameterList () |
RCP< const ParameterList > | getParameterList () const |
Private Member Functions | |
void | setupInOutArgs_ () const |
Private Attributes | |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | x_space_ |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | p_space_ |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | g_space_ |
Teuchos::RCP < Thyra::VectorBase< Scalar > > | x_vec_ |
Teuchos::RCP < Thyra::VectorBase< Scalar > > | x_dot_vec_ |
Teuchos::RCP < Thyra::VectorBase< Scalar > > | x_dot_dot_vec_ |
Teuchos::RCP < Thyra::VectorBase< Scalar > > | p_init_ |
int | vecLength_ |
int | numResponses_ |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | inArgs_ |
Thyra::ModelEvaluatorBase::OutArgs < Scalar > | outArgs_ |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | nominalValues_ |
bool | isInitialized_ |
double | c_ |
double | f_ |
double | k_ |
double | m_ |
Teuchos::RCP < Teuchos::FancyOStream > | out_ |
Public functions overridden from ModelEvaluator. | |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | get_x_space () const |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | get_f_space () const |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | getNominalValues () const |
Teuchos::RCP < Thyra::LinearOpWithSolveBase < Scalar > > | create_W () const |
Teuchos::RCP < Thyra::LinearOpBase< Scalar > > | create_W_op () const |
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase < Scalar > > | get_W_factory () const |
Thyra::ModelEvaluatorBase::InArgs < Scalar > | createInArgs () const |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | get_p_space (int l) const |
Teuchos::RCP< const Teuchos::Array< std::string > > | get_p_names (int l) const |
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | get_g_space (int j) const |
Public functions overridden from ParameterListAcceptor. | |
void | setParameterList (Teuchos::RCP< Teuchos::ParameterList > const ¶mList) |
Teuchos::RCP< const Teuchos::ParameterList > | getValidParameters () const |
Private functions overridden from ModelEvaluatorDefaultBase. | |
Thyra::ModelEvaluatorBase::OutArgs < Scalar > | createOutArgsImpl () const |
void | evalModelImpl (const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs_bar, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs_bar) const |
Additional Inherited Members | |
Public Types inherited from Thyra::ModelEvaluator< class > | |
enum | EInArgsMembers |
enum | EInArgs_p_mp |
enum | EEvalType |
enum | EDerivativeMultiVectorOrientation |
enum | EDerivativeLinearOp |
enum | EDerivativeLinearity |
enum | ERankStatus |
enum | EOutArgsMembers |
enum | EOutArgsDfDp |
enum | EOutArgsDgDx_dot |
enum | EOutArgsDgDx |
enum | EOutArgsDgDp |
enum | EOutArgs_hess_vec_prod_f_xx |
enum | EOutArgs_hess_vec_prod_f_xp |
enum | EOutArgs_hess_vec_prod_f_px |
enum | EOutArgs_hess_vec_prod_f_pp |
enum | EOutArgs_hess_vec_prod_g_xx |
enum | EOutArgs_hess_vec_prod_g_xp |
enum | EOutArgs_hess_vec_prod_g_px |
enum | EOutArgs_hess_vec_prod_g_pp |
enum | EOutArgs_hess_f_xx |
enum | EOutArgs_hess_f_xp |
enum | EOutArgs_hess_f_pp |
enum | EOutArgs_hess_g_xx |
enum | EOutArgs_hess_g_xp |
enum | EOutArgs_hess_g_pp |
enum | EOutArgs_H_xx |
enum | EOutArgs_H_xp |
enum | EOutArgs_H_pp |
enum | EOutArgsDfDp_mp |
enum | EOutArgs_g_mp |
enum | EOutArgsDgDx_dot_mp |
enum | EOutArgsDgDx_mp |
enum | EOutArgsDgDp_mp |
typedef Teuchos::ScalarTraits < Scalar >::magnitudeType | ScalarMag |
Static Public Attributes inherited from Thyra::ModelEvaluator< class > | |
static const int | NUM_E_IN_ARGS_MEMBERS |
static const int | NUM_E_OUT_ARGS_MEMBERS |
Static Public Attributes inherited from Teuchos::Describable | |
static const EVerbosityLevel | verbLevel_default |
Protected Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase | |
void | setMyParamList (const RCP< ParameterList > ¶mList) |
RCP< ParameterList > | getMyNonconstParamList () |
RCP< const ParameterList > | getMyParamList () const |
Consider the ODE:
where is a constant, is a constant damping parameter, is a constant forcing parameter, and is a constant mass parameter, with initial conditions are:
It is straight-forward to show that the exact solution to this ODE is:
where , and . While it is possible to derive the solution to this ODE for the case when and , we do not consider that case here. When , , and , our ODE simplies to a canonical differential equation model of a ball thrown up in the air, with a parabolic trajectory solution, namely
where . An EpetraExt version of this simplified version of the test is implemented in Piro::MockModelEval_B (see Trilinos/packages/piro/test), where it is used to test the Piro (EpetraExt) Newmark-Beta scheme (see input_Solver_NB.xml input file). When and , this test is equivalent to the SinCos model..
Definition at line 52 of file HarmonicOscillatorModel_decl.hpp.
Tempus_Test::HarmonicOscillatorModel< Scalar >::HarmonicOscillatorModel | ( | Teuchos::RCP< Teuchos::ParameterList > | pList = Teuchos::null , |
const bool | use_accel_IC = false |
||
) |
Definition at line 28 of file HarmonicOscillatorModel_impl.hpp.
Thyra::ModelEvaluatorBase::InArgs< Scalar > Tempus_Test::HarmonicOscillatorModel< Scalar >::getExactSolution | ( | double | t | ) | const |
Definition at line 74 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 131 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 140 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 149 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 160 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 177 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 187 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 198 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 309 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 319 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Thyra::ModelEvaluator< class >.
Definition at line 329 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Implements Teuchos::ParameterListAcceptor.
Definition at line 387 of file HarmonicOscillatorModel_impl.hpp.
|
virtual |
Reimplemented from Teuchos::ParameterListAcceptor.
Definition at line 419 of file HarmonicOscillatorModel_impl.hpp.
|
private |
Definition at line 343 of file HarmonicOscillatorModel_impl.hpp.
|
private |
Definition at line 211 of file HarmonicOscillatorModel_impl.hpp.
|
private |
Definition at line 221 of file HarmonicOscillatorModel_impl.hpp.
|
private |
Definition at line 101 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 102 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 103 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 104 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 105 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 106 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 107 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 108 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 109 of file HarmonicOscillatorModel_decl.hpp.
|
mutableprivate |
Definition at line 110 of file HarmonicOscillatorModel_decl.hpp.
|
mutableprivate |
Definition at line 111 of file HarmonicOscillatorModel_decl.hpp.
|
mutableprivate |
Definition at line 112 of file HarmonicOscillatorModel_decl.hpp.
|
mutableprivate |
Definition at line 113 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 114 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 115 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 116 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 117 of file HarmonicOscillatorModel_decl.hpp.
|
private |
Definition at line 118 of file HarmonicOscillatorModel_decl.hpp.