10 #ifndef Tempus_WrapStaggeredFSAModelEvaluator_hpp
11 #define Tempus_WrapStaggeredFSAModelEvaluator_hpp
13 #include "Tempus_config.hpp"
15 #include "Tempus_StaggeredForwardSensitivityModelEvaluator.hpp"
16 #include "Tempus_WrapperModelEvaluatorPairIMEX_Basic.hpp"
18 #include "Tempus_WrapperModelEvaluatorPairPartIMEX_StaggeredFSA.hpp"
27 template <
typename Scalar>
34 const bool is_pseudotransient,
38 using Teuchos::rcp_dynamic_cast;
40 RCP<SensitivityModelEvaluatorBase<Scalar> > wrapped_model;
43 RCP<const WrapperModelEvaluatorPairIMEX_Basic<Scalar> > modelPairIMEX =
46 RCP<const WrapperModelEvaluatorPairPartIMEX_Basic<Scalar> >
47 modelPairPartIMEX = rcp_dynamic_cast<
52 if ((modelPairIMEX != Teuchos::null || modelPairPartIMEX != Teuchos::null) &&
53 (model.ptr() != sens_residual_model.ptr()) &&
54 (model.ptr() != sens_solve_model.ptr()))
56 true, std::logic_error,
57 "Unique model evaluators for state, sensitivity residual, and "
58 "sensitivity solve is not supported for IMEX");
60 if (modelPairIMEX != Teuchos::null) {
62 modelPairIMEX, is_pseudotransient, pList));
64 else if (modelPairPartIMEX != Teuchos::null) {
67 modelPairPartIMEX, is_pseudotransient, pList));
71 model, sens_residual_model, sens_solve_model, is_pseudotransient,
78 template <
typename Scalar>
84 const bool is_pseudotransient,
93 csens_solve_model, is_pseudotransient,
Teuchos::RCP< SensitivityModelEvaluatorBase< Scalar > > wrapStaggeredFSAModelEvaluator(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &model, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &sens_residual_model, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &sens_solve_model, const bool is_pseudotransient, const Teuchos::RCP< const Teuchos::ParameterList > &pList=Teuchos::null)
ModelEvaluator pair for implicit and explicit (IMEX) evaulations.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Specialization of IMEX ME for "staggered" FSA method.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
ModelEvaluator pair for implicit and explicit (IMEX) evaulations.
Transform a ModelEvaluator's sensitivity equations to its residual.
Specialization of IMEX-Part ME for "combined" FSA method.