Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_WrapperModelEvaluatorPairPartIMEX_StaggeredFSA_impl.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_ModelEvaluatorPairPartIMEX_StaggeredFSA_impl_hpp
11 #define Tempus_ModelEvaluatorPairPartIMEX_StaggeredFSA_impl_hpp
12 
13 #include "Thyra_VectorStdOps.hpp"
14 #include "Thyra_MultiVectorStdOps.hpp"
15 
16 namespace Tempus {
17 
18 template <typename Scalar>
22  Scalar> >& forwardModel,
23  const bool is_pseudotransient,
25  : forwardModel_(forwardModel),
26  use_dfdp_as_tangent_(false),
27  y_tangent_index_(3)
28 {
29  using Teuchos::RCP;
30  using Teuchos::rcp;
31  using Thyra::multiVectorProductVectorSpace;
32 
33  RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
34  if (pList != Teuchos::null) *pl = *pList;
36  use_dfdp_as_tangent_ = pl->get<bool>("Use DfDp as Tangent");
37  y_tangent_index_ = pl->get<int>("Sensitivity Y Tangent Index");
38  pl->remove("Sensitivity Y Tangent Index");
39 
40  appExplicitModel_ = forwardModel_->getExplicitModel();
41  appImplicitModel_ = forwardModel_->getImplicitModel();
43  appExplicitModel_, is_pseudotransient, pl));
45  appImplicitModel_, is_pseudotransient, pl));
46 
47  const int y_param_index = forwardModel_->getParameterIndex();
48  const int sens_param_index = pl->get<int>("Sensitivity Parameter Index");
49  const int num_sens_param =
50  appImplicitModel_->get_p_space(sens_param_index)->dim();
51  RCP<const Thyra::VectorSpaceBase<Scalar> > explicit_y_space =
52  appImplicitModel_->get_p_space(y_param_index);
53  RCP<const Thyra::VectorSpaceBase<Scalar> > implicit_x_space =
54  appImplicitModel_->get_x_space();
56  multiVectorProductVectorSpace(explicit_y_space, num_sens_param);
58  multiVectorProductVectorSpace(implicit_x_space, num_sens_param);
59 
61  forwardModel_->getNumExplicitOnlyBlocks(), y_param_index);
62 }
63 
64 template <typename Scalar>
66 {
67  using Teuchos::RCP;
68  using Teuchos::rcp_dynamic_cast;
69 
70  this->useImplicitModel_ = true;
71  this->wrapperImplicitInArgs_ = this->createInArgs();
72  this->wrapperImplicitOutArgs_ = this->createOutArgs();
73  this->useImplicitModel_ = false;
74 
75  RCP<const Thyra::VectorBase<Scalar> > z =
76  this->explicitModel_->getNominalValues().get_x();
77 
78  // A Thyra::VectorSpace requirement
80  !(getIMEXVector(z)->space()->isCompatible(
81  *(this->implicitModel_->get_x_space()))),
82  std::logic_error,
83  "Error - WrapperModelEvaluatorPairIMEX_StaggeredFSA::initialize()\n"
84  << " Explicit and Implicit vector x spaces are incompatible!\n"
85  << " Explicit vector x space = "
86  << *(getIMEXVector(z)->space())
87  << "\n Implicit vector x space = "
88  << *(this->implicitModel_->get_x_space()) << "\n");
89 
90  // Valid number of blocks?
91  const RCP<const DMVPV> z_dmvpv = rcp_dynamic_cast<const DMVPV>(z, true);
92  const RCP<const Thyra::MultiVectorBase<Scalar> > z_mv =
93  z_dmvpv->getMultiVector();
94  RCP<const PMVB> zPVector = rcp_dynamic_cast<const PMVB>(z_mv);
96  zPVector == Teuchos::null, std::logic_error,
97  "Error - WrapperModelEvaluatorPairPartIMEX_StaggeredFSA::initialize()\n"
98  " was given a VectorBase that could not be cast to a\n"
99  " ProductVectorBase!\n");
100 
101  int numBlocks = zPVector->productSpace()->numBlocks();
102 
103  TEUCHOS_TEST_FOR_EXCEPTION(
104  !(0 <= this->numExplicitOnlyBlocks_ &&
105  this->numExplicitOnlyBlocks_ < numBlocks),
106  std::logic_error,
107  "Error - WrapperModelEvaluatorPairPartIMEX_StaggeredFSA::initialize()\n"
108  << "Invalid number of explicit-only blocks = "
109  << this->numExplicitOnlyBlocks_
110  << "\nShould be in the interval [0, numBlocks) = [0, "
111  << numBlocks << ")\n");
112 }
113 
114 template <typename Scalar>
117 {
118  if (this->useImplicitModel_) {
119  if (i == this->parameterIndex_)
120  return explicit_dydp_prod_space_;
121  else
122  return appImplicitModel_->get_p_space(i);
123  }
124 
125  return appExplicitModel_->get_p_space(i);
126 }
127 
128 template <typename Scalar>
131  const Teuchos::RCP<Thyra::VectorBase<Scalar> >& full) const
132 {
133  using Teuchos::RCP;
134  using Teuchos::rcp_dynamic_cast;
136  using Thyra::multiVectorProductVector;
137  using Thyra::VectorBase;
138 
139  // StaggeredFSA ME stores vectors as DMVPV's. To extract the implicit
140  // part of the vector, cast it to DMVPV, extract the multi-vector,
141  // cast it to a product multi-vector, extract the IMEX block, then
142  // create a DMVPV from it.
143 
144  if (full == Teuchos::null) return Teuchos::null;
145 
146  if (this->numExplicitOnlyBlocks_ == 0) return full;
147 
148  const RCP<DMVPV> full_dmvpv = rcp_dynamic_cast<DMVPV>(full, true);
149  const RCP<MultiVectorBase<Scalar> > full_mv =
150  full_dmvpv->getNonconstMultiVector();
151  const RCP<PMVB> blk_full_mv = rcp_dynamic_cast<PMVB>(full_mv, true);
152 
153  // special case where the implicit terms are not blocked
154  const int numBlocks = blk_full_mv->productSpace()->numBlocks();
155  const int numExplicitBlocks = this->numExplicitOnlyBlocks_;
156  if (numBlocks == numExplicitBlocks + 1) {
157  const RCP<MultiVectorBase<Scalar> > imex_mv =
158  blk_full_mv->getNonconstMultiVectorBlock(numExplicitBlocks);
159  return multiVectorProductVector(imex_dxdp_prod_space_, imex_mv);
160  }
161 
162  // Not supposed to get here, apparently
163  TEUCHOS_ASSERT(false);
164  return Teuchos::null;
165 }
166 
167 template <typename Scalar>
170  const Teuchos::RCP<const Thyra::VectorBase<Scalar> >& full) const
171 {
172  using Teuchos::RCP;
173  using Teuchos::rcp_dynamic_cast;
175  using Thyra::multiVectorProductVector;
176  using Thyra::VectorBase;
177 
178  // StaggeredFSA ME stores vectors as DMVPV's. To extract the implicit
179  // part of the vector, cast it to DMVPV, extract the multi-vector,
180  // cast it to a product multi-vector, extract the IMEX block, then
181  // create a DMVPV from it.
182 
183  if (full == Teuchos::null) return Teuchos::null;
184 
185  if (this->numExplicitOnlyBlocks_ == 0) return full;
186 
187  const RCP<const DMVPV> full_dmvpv = rcp_dynamic_cast<const DMVPV>(full, true);
188  const RCP<const MultiVectorBase<Scalar> > full_mv =
189  full_dmvpv->getMultiVector();
190  const RCP<const PMVB> blk_full_mv =
191  rcp_dynamic_cast<const PMVB>(full_mv, true);
192 
193  // special case where the implicit terms are not blocked
194  const int numBlocks = blk_full_mv->productSpace()->numBlocks();
195  const int numExplicitBlocks = this->numExplicitOnlyBlocks_;
196  if (numBlocks == numExplicitBlocks + 1) {
197  const RCP<const MultiVectorBase<Scalar> > imex_mv =
198  blk_full_mv->getMultiVectorBlock(numExplicitBlocks);
199  return multiVectorProductVector(imex_dxdp_prod_space_, imex_mv);
200  }
201 
202  // Not supposed to get here, apparently
203  TEUCHOS_ASSERT(false);
204  return Teuchos::null;
205 }
206 
207 template <typename Scalar>
210  const Teuchos::RCP<Thyra::VectorBase<Scalar> >& full) const
211 {
212  using Teuchos::RCP;
213  using Teuchos::rcp_dynamic_cast;
215  using Thyra::multiVectorProductVector;
216  using Thyra::multiVectorProductVectorSpace;
217  using Thyra::VectorBase;
218 
219  // StaggeredFSA ME stores vectors as DMVPV's. To extract the explicit
220  // part of the vector, cast it to DMVPV, extract the multi-vector,
221  // cast it to a product multi-vector, extract the explicit block, then
222  // create a DMVPV from it.
223 
224  if (full == Teuchos::null) return Teuchos::null;
225 
226  if (this->numExplicitOnlyBlocks_ == 0) return full;
227 
228  const RCP<DMVPV> full_dmvpv = rcp_dynamic_cast<DMVPV>(full, true);
229  const RCP<MultiVectorBase<Scalar> > full_mv =
230  full_dmvpv->getNonconstMultiVector();
231  const RCP<PMVB> blk_full_mv = rcp_dynamic_cast<PMVB>(full_mv, true);
232 
233  // special case where the explicit terms are not blocked
234  const int numExplicitBlocks = this->numExplicitOnlyBlocks_;
235  if (numExplicitBlocks == 1) {
236  const RCP<MultiVectorBase<Scalar> > explicit_mv =
237  blk_full_mv->getNonconstMultiVectorBlock(0);
238  return multiVectorProductVector(explicit_dydp_prod_space_, explicit_mv);
239  }
240 
241  // Not supposed to get here, apparently
242  TEUCHOS_ASSERT(false);
243  return Teuchos::null;
244 }
245 
246 template <typename Scalar>
249  const Teuchos::RCP<const Thyra::VectorBase<Scalar> >& full) const
250 {
251  using Teuchos::RCP;
252  using Teuchos::rcp_dynamic_cast;
254  using Thyra::multiVectorProductVector;
255  using Thyra::multiVectorProductVectorSpace;
256  using Thyra::VectorBase;
257 
258  // StaggeredFSA ME stores vectors as DMVPV's. To extract the explicit
259  // part of the vector, cast it to DMVPV, extract the multi-vector,
260  // cast it to a product multi-vector, extract the explicit block, then
261  // create a DMVPV from it.
262 
263  if (full == Teuchos::null) return Teuchos::null;
264 
265  if (this->numExplicitOnlyBlocks_ == 0) return full;
266 
267  const RCP<const DMVPV> full_dmvpv = rcp_dynamic_cast<const DMVPV>(full, true);
268  const RCP<const MultiVectorBase<Scalar> > full_mv =
269  full_dmvpv->getMultiVector();
270  const RCP<const PMVB> blk_full_mv =
271  rcp_dynamic_cast<const PMVB>(full_mv, true);
272 
273  // special case where the explicit terms are not blocked
274  const int numExplicitBlocks = this->numExplicitOnlyBlocks_;
275  if (numExplicitBlocks == 1) {
276  const RCP<const MultiVectorBase<Scalar> > explicit_mv =
277  blk_full_mv->getMultiVectorBlock(0);
278  return multiVectorProductVector(explicit_dydp_prod_space_, explicit_mv);
279  }
280 
281  // Not supposed to get here, apparently
282  TEUCHOS_ASSERT(false);
283  return Teuchos::null;
284 }
285 
286 template <typename Scalar>
289 {
290  return forwardModel_;
291 }
292 
293 template <typename Scalar>
297 {
298  sh_ = sh;
300  fsaExplicitModel_->setForwardSolutionHistory(sh);
301  // We handle interpolation for fsaImplicitModel in evalModelImpl()
302 }
303 
304 template <typename Scalar>
308 {
309  sh_ = Teuchos::null;
310  forward_state_ = s;
311  buildIMEXStates();
312  fsaExplicitModel_->setForwardSolutionState(s);
313  fsaImplicitModel_->setForwardSolutionState(implicit_x_state_);
314 }
315 
316 template <typename Scalar>
319  const bool force_W_update)
320 {
321  // Make sure we have the useImplicitModel_ flag set since
322  // force_W_update = true will force a model evaluation
323  bool tf = forwardModel_->getUseImplicitModel();
325  nc_forwardModel = Teuchos::rcp_const_cast<
327  nc_forwardModel->setUseImplicitModel(true);
328  fsaImplicitModel_->setSolver(solver, force_W_update);
329  nc_forwardModel->setUseImplicitModel(tf);
330 }
331 
332 template <typename Scalar>
335 {
336  using Teuchos::RCP;
337  using Teuchos::rcp_dynamic_cast;
338  using Thyra::createMember;
339 
340  Thyra::ModelEvaluatorBase::InArgs<Scalar> inArgs = Base::createInArgs();
341 
342  // Set p to be the correct product vector form for the explicit only vector y
343  if (this->useImplicitModel_ == true) {
344  if (inArgs.get_p(this->parameterIndex_) != Teuchos::null) {
345  RCP<DMVPV> dydp = rcp_dynamic_cast<DMVPV>(
346  createMember(*explicit_dydp_prod_space_), true);
347  Thyra::assign(dydp->getNonconstMultiVector().ptr(), Scalar(0.0));
348  inArgs.set_p(this->parameterIndex_, dydp);
349  }
350  }
351  return inArgs;
352 }
353 
354 template <typename Scalar>
357  const Thyra::ModelEvaluatorBase::OutArgs<Scalar>& outArgs) const
358 {
359  typedef Thyra::ModelEvaluatorBase MEB;
360  using Teuchos::Range1D;
361  using Teuchos::RCP;
362  using Teuchos::rcp_dynamic_cast;
363 
364  // Interpolate forward solution at supplied time, reusing previous
365  // interpolation if possible
366  Scalar forward_t;
367  if (sh_ != Teuchos::null) {
368  forward_t = inArgs.get_t();
369  if (t_interp_ != forward_t) {
370  if (nc_forward_state_ == Teuchos::null)
371  nc_forward_state_ = sh_->interpolateState(forward_t);
372  else
373  sh_->interpolateState(forward_t, nc_forward_state_.get());
374  forward_state_ = nc_forward_state_;
375  t_interp_ = forward_t;
376  buildIMEXStates();
377  fsaImplicitModel_->setForwardSolutionState(implicit_x_state_);
378  }
379  }
380  else {
381  TEUCHOS_ASSERT(forward_state_ != Teuchos::null);
382  forward_t = forward_state_->getTime();
383  }
384 
385  const int p_index = this->parameterIndex_;
386 
387  //
388  // From Base::evalModelImpl()
389  //
390  RCP<const Thyra::VectorBase<Scalar> > x = inArgs.get_x();
391  RCP<Thyra::VectorBase<Scalar> > x_dot =
392  Thyra::createMember(fsaImplicitModel_->get_x_space());
393  this->timeDer_->compute(x, x_dot);
394 
395  MEB::InArgs<Scalar> fsaImplicitInArgs(this->wrapperImplicitInArgs_);
396  MEB::OutArgs<Scalar> fsaImplicitOutArgs(this->wrapperImplicitOutArgs_);
397  if (fsaImplicitInArgs.supports(MEB::IN_ARG_t))
398  fsaImplicitInArgs.set_t(inArgs.get_t());
399  fsaImplicitInArgs.set_x(x);
400  fsaImplicitInArgs.set_x_dot(x_dot);
401  for (int i = 0; i < fsaImplicitModel_->Np(); ++i) {
402  // Copy over parameters except for the parameter for explicit-only vector!
403  if ((inArgs.get_p(i) != Teuchos::null) && (i != p_index))
404  fsaImplicitInArgs.set_p(i, inArgs.get_p(i));
405  }
406 
407  // p-vector for index parameterIndex_ is part of the IMEX solution vector,
408  // and therefore is an n column multi-vector where n is the number of
409  // sensitivity parameters. Pull out the sensitivity components before
410  // passing along to the ME, then use them for adding in dg/dy*dy/dp term.
411  TEUCHOS_ASSERT(explicit_y_state_ != Teuchos::null);
412  RCP<const Thyra::VectorBase<Scalar> > y = explicit_y_state_->getX();
413  RCP<const Thyra::MultiVectorBase<Scalar> > dydp;
414  if (fsaImplicitInArgs.get_p(p_index) != Teuchos::null) {
415  RCP<const Thyra::VectorBase<Scalar> > p = fsaImplicitInArgs.get_p(p_index);
416  dydp = rcp_dynamic_cast<const DMVPV>(p, true)->getMultiVector();
417  fsaImplicitInArgs.set_p(p_index, y);
418  }
419  if (use_dfdp_as_tangent_) {
420  RCP<const Thyra::VectorBase<Scalar> > dydp_vec =
421  Thyra::multiVectorProductVector(explicit_dydp_prod_space_, dydp);
422  fsaImplicitInArgs.set_p(y_tangent_index_, dydp_vec);
423  }
424 
425  fsaImplicitOutArgs.set_f(outArgs.get_f());
426  fsaImplicitOutArgs.set_W_op(outArgs.get_W_op());
427 
428  fsaImplicitModel_->evalModel(fsaImplicitInArgs, fsaImplicitOutArgs);
429 
430  // Compute derivative of implicit residual with respect to explicit only
431  // vector y, which is passed as a parameter
432  if (!use_dfdp_as_tangent_ && outArgs.get_f() != Teuchos::null) {
433  MEB::InArgs<Scalar> appImplicitInArgs =
434  appImplicitModel_->getNominalValues();
435  TEUCHOS_ASSERT(forward_state_ != Teuchos::null);
436  RCP<const Thyra::VectorBase<Scalar> > app_x = implicit_x_state_->getX();
437  RCP<const Thyra::VectorBase<Scalar> > app_x_dot =
438  implicit_x_state_->getXDot();
439  appImplicitInArgs.set_x(app_x);
440  appImplicitInArgs.set_x_dot(app_x_dot);
441  for (int i = 0; i < appImplicitModel_->Np(); ++i) {
442  if (i != p_index) appImplicitInArgs.set_p(i, inArgs.get_p(i));
443  }
444  appImplicitInArgs.set_p(p_index, y);
445  if (appImplicitInArgs.supports(MEB::IN_ARG_t))
446  appImplicitInArgs.set_t(forward_t);
447  MEB::OutArgs<Scalar> appImplicitOutArgs =
448  appImplicitModel_->createOutArgs();
449  MEB::DerivativeSupport dfdp_support =
450  appImplicitOutArgs.supports(MEB::OUT_ARG_DfDp, p_index);
452  if (dfdp_support.supports(MEB::DERIV_LINEAR_OP)) {
453  if (my_dfdp_op_ == Teuchos::null)
454  my_dfdp_op_ = appImplicitModel_->create_DfDp_op(p_index);
455  appImplicitOutArgs.set_DfDp(p_index,
456  MEB::Derivative<Scalar>(my_dfdp_op_));
457  trans = Thyra::NOTRANS;
458  }
459  else if (dfdp_support.supports(MEB::DERIV_MV_JACOBIAN_FORM)) {
460  if (my_dfdp_mv_ == Teuchos::null)
461  my_dfdp_mv_ = Thyra::createMembers(
462  appImplicitModel_->get_f_space(),
463  appImplicitModel_->get_p_space(p_index)->dim());
464  appImplicitOutArgs.set_DfDp(
465  p_index,
466  MEB::Derivative<Scalar>(my_dfdp_mv_, MEB::DERIV_MV_JACOBIAN_FORM));
467  my_dfdp_op_ = my_dfdp_mv_;
468  trans = Thyra::NOTRANS;
469  }
470  else if (dfdp_support.supports(MEB::DERIV_MV_GRADIENT_FORM)) {
471  if (my_dfdp_mv_ == Teuchos::null)
472  my_dfdp_mv_ =
473  Thyra::createMembers(appImplicitModel_->get_p_space(p_index),
474  appImplicitModel_->get_f_space()->dim());
475  appImplicitOutArgs.set_DfDp(
476  p_index,
477  MEB::Derivative<Scalar>(my_dfdp_mv_, MEB::DERIV_MV_GRADIENT_FORM));
478  my_dfdp_op_ = my_dfdp_mv_;
479  trans = Thyra::TRANS;
480  }
481  else
482  TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error,
483  "Invalid df/dp support");
484 
485  appImplicitModel_->evalModel(appImplicitInArgs, appImplicitOutArgs);
486 
487  // Add df/dy*dy/dp term to residual
488  RCP<Thyra::MultiVectorBase<Scalar> > dfdp =
489  rcp_dynamic_cast<DMVPV>(outArgs.get_f(), true)
490  ->getNonconstMultiVector();
491  my_dfdp_op_->apply(trans, *dydp, dfdp.ptr(), Scalar(1.0), Scalar(1.0));
492  }
493 }
494 
495 template <typename Scalar>
498  const
499 {
502  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList(*fsa_pl);
503  pl->set<int>("Sensitivity Y Tangent Index", 3);
504  return pl;
505 }
506 
507 template <typename Scalar>
509  const
510 {
511  explicit_y_state_ = Teuchos::rcp(new SolutionState<Scalar>(
512  forward_state_->getMetaData(),
513  forwardModel_->getExplicitOnlyVector(forward_state_->getX()),
514  forwardModel_->getExplicitOnlyVector(forward_state_->getXDot()),
515  forwardModel_->getExplicitOnlyVector(forward_state_->getXDotDot()),
516  forward_state_->getStepperState(), Teuchos::null));
517  implicit_x_state_ = Teuchos::rcp(new SolutionState<Scalar>(
518  forward_state_->getMetaData(),
519  forwardModel_->getIMEXVector(forward_state_->getX()),
520  forwardModel_->getIMEXVector(forward_state_->getXDot()),
521  forwardModel_->getIMEXVector(forward_state_->getXDotDot()),
522  forward_state_->getStepperState(), Teuchos::null));
523 }
524 
525 } // namespace Tempus
526 
527 #endif // Tempus_ModelEvaluatorPairPartIMEX_StaggeredFSA_impl_hpp
EOpTransp
virtual Teuchos::RCP< const ProductVectorSpaceBase< Scalar > > productSpace() const =0
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
virtual Teuchos::RCP< MultiVectorBase< Scalar > > getNonconstMultiVectorBlock(const int k)=0
Evaluation< VectorBase< Scalar > > get_f() const
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
virtual Teuchos::RCP< const MultiVectorBase< Scalar > > getMultiVectorBlock(const int k) const =0
static magnitudeType rmax()
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getExplicitOnlyVector(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &full) const
Extract explicit-only vector from a full solution vector.
virtual Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > getForwardModel() const
Get the underlying forward model.
virtual Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int i) const
Get the p space.
virtual void setSolver(const Teuchos::RCP< Thyra::NonlinearSolverBase< Scalar > > &solver, const bool force_W_update)
Set the solver of the underlying model if you want to reuse it.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
ModelEvaluator pair for implicit and explicit (IMEX) evaulations.
WrapperModelEvaluatorPairPartIMEX_StaggeredFSA(const Teuchos::RCP< const WrapperModelEvaluatorPairPartIMEX_Basic< Scalar > > &forwardModel, const bool is_pseudotransient, const Teuchos::RCP< const Teuchos::ParameterList > &pList=Teuchos::null)
Constructor.
virtual void setForwardSolutionHistory(const Teuchos::RCP< const Tempus::SolutionHistory< Scalar > > &sh)
Set solution history from forward state evaluation (for interpolation)
RCP< const MultiVectorBase< Scalar > > getMultiVector() const
void validateParametersAndSetDefaults(ParameterList const &validParamList, int const depth=1000)
void setup(const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &explicitModel, const Teuchos::RCP< const Thyra::ModelEvaluator< Scalar > > &implicitModel, int numExplicitOnlyBlocks=0, int parameterIndex=-1)
Setup ME when using default constructor – for derived classes.
virtual void setForwardSolutionState(const Teuchos::RCP< const Tempus::SolutionState< Scalar > > &s)
Set solution state from forward state evaluation (for frozen state)
SolutionHistory is basically a container of SolutionStates. SolutionHistory maintains a collection of...
virtual Teuchos::RCP< Thyra::VectorBase< Scalar > > getIMEXVector(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &full) const
Extract IMEX vector from a full solution vector.
void buildIMEXStates() const
Build implicit x and end explicit y states from forward_state_.
Teuchos::RCP< const WrapperModelEvaluatorPairPartIMEX_Basic< Scalar > > forwardModel_
void set_p(int l, const RCP< const VectorBase< Scalar > > &p_l)
RCP< MultiVectorBase< Scalar > > getNonconstMultiVector()
#define TEUCHOS_ASSERT(assertion_test)
RCP< LinearOpBase< Scalar > > get_W_op() const
RCP< const VectorBase< Scalar > > get_x() const
Solution state for integrators and steppers.
RCP< const VectorBase< Scalar > > get_p(int l) const
Teuchos::Range1D Range1D