Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_ModelEvaluator.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef PANZER_MODEL_EVALUATOR_DECL_HPP
12 #define PANZER_MODEL_EVALUATOR_DECL_HPP
13 
14 #include "PanzerDiscFE_config.hpp"
15 
16 #include "Panzer_Traits.hpp"
23 
24 #include "Teuchos_RCP.hpp"
25 #include "Teuchos_AbstractFactory.hpp"
26 
27 #include "Thyra_VectorBase.hpp"
28 #include "Thyra_VectorSpaceBase.hpp"
29 #include "Thyra_StateFuncModelEvaluatorBase.hpp"
30 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
31 
32 #include <Panzer_NodeType.hpp>
33 
34 namespace panzer {
35 
36 class FieldManagerBuilder;
37 template<typename> class LinearObjFactory;
38 struct GlobalData;
39 
40 template<typename Scalar>
42  : public Thyra::StateFuncModelEvaluatorBase<Scalar>
43 {
44 public:
45 
46 public:
47 
50 
54  const std::vector<Teuchos::RCP<Teuchos::Array<std::string> > >& p_names,
55  const std::vector<Teuchos::RCP<Teuchos::Array<double> > >& p_values,
56  const Teuchos::RCP<const Thyra::LinearOpWithSolveFactoryBase<Scalar> > & solverFactory,
57  const Teuchos::RCP<panzer::GlobalData>& global_data,
58  bool build_transient_support,double t_init);
59 
61  const Teuchos::RCP<const Thyra::LinearOpWithSolveFactoryBase<Scalar> > & solverFactory,
62  const Teuchos::RCP<panzer::GlobalData>& global_data,
63  bool build_transient_support,double t_init);
64 
67 
69 
72 
75 
78 
81 
84 
87 
89  const std::string & get_g_name(int i) const;
90 
93 
96 
99 
102 
104  Thyra::ModelEvaluatorBase::InArgs<Scalar> createInArgs() const override;
105 
106  Thyra::ModelEvaluatorBase::InArgs<Scalar> getNominalValues() const override;
107 
109 
114  template<typename EvalT>
116  {
117  ae_tm_.template disableType<EvalT>();
118  auto idx = Sacado::mpl::find<panzer::Traits::EvalTypes,EvalT>::value;
119  active_evaluation_types_[idx] = false;
120  }
121 
126  void buildVolumeFieldManagers(const bool value);
127 
132  void buildBCFieldManagers(const bool value);
133 
135  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
136  const std::vector<panzer::BC> & bcs,
137  const panzer::EquationSetFactory & eqset_factory,
138  const panzer::BCStrategyFactory& bc_factory,
141  const Teuchos::ParameterList& closure_models,
142  const Teuchos::ParameterList& user_data,
143  bool writeGraph=false,const std::string & graphPrefix="",
144  const Teuchos::ParameterList& me_params = Teuchos::ParameterList());
145 
157  int addParameter(const std::string & name,const Scalar & initial);
158 
169  int addParameter(const Teuchos::Array<std::string> & names,
170  const Teuchos::Array<Scalar> & initialValues);
171 
188  int addDistributedParameter(const std::string & name,
189  const Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > & vs,
191  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & initial,
192  const Teuchos::RCP<const GlobalIndexer> & ugi=Teuchos::null);
193 
202  void addNonParameterGlobalEvaluationData(const std::string & name,
204 
221  int addFlexibleResponse(const std::string & responseName,
222  const std::vector<WorksetDescriptor> & wkst_desc,
224 
240  template <typename ResponseEvaluatorFactory_BuilderT>
241  int addResponse(const std::string & responseName,
242  const std::vector<WorksetDescriptor> & wkst_desc,
243  const ResponseEvaluatorFactory_BuilderT & builder);
244 
249  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
250  const panzer::EquationSetFactory & eqset_factory,
252  const Teuchos::ParameterList& closure_models,
253  const Teuchos::ParameterList& user_data,
254  const bool write_graphviz_file=false,
255  const std::string& graphviz_file_prefix="")
256  { responseLibrary_->buildResponseEvaluators(physicsBlocks,eqset_factory,cm_factory,closure_models,user_data,write_graphviz_file,graphviz_file_prefix);
259  this->resetDefaultBase();
260 
261  typedef Thyra::ModelEvaluatorBase MEB;
262  MEB::OutArgsSetup<Scalar> outArgs;
263  outArgs.setModelEvalDescription(this->description());
264  outArgs.set_Np_Ng(num_me_parameters_, responses_.size());
265  outArgs.setSupports(MEB::OUT_ARG_f);
266  outArgs.setSupports(MEB::OUT_ARG_W_op);
267  prototypeOutArgs_ = outArgs; }
268 
273  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
275  const Teuchos::ParameterList& closure_models,
276  const Teuchos::ParameterList& user_data,
277  const bool write_graphviz_file=false,
278  const std::string& graphviz_file_prefix="")
279  { responseLibrary_->buildResponseEvaluators(physicsBlocks,cm_factory,closure_models,user_data,write_graphviz_file,graphviz_file_prefix);
282  this->resetDefaultBase();
283 
284  typedef Thyra::ModelEvaluatorBase MEB;
285  MEB::OutArgsSetup<Scalar> outArgs;
286  outArgs.setModelEvalDescription(this->description());
287  outArgs.set_Np_Ng(num_me_parameters_, responses_.size());
288  outArgs.setSupports(MEB::OUT_ARG_f);
289  outArgs.setSupports(MEB::OUT_ARG_W_op);
290  prototypeOutArgs_ = outArgs; }
291 
299  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
300  const std::vector<panzer::BC> & bcs,
301  const panzer::EquationSetFactory & eqset_factory,
302  const panzer::BCStrategyFactory& bc_factory,
304  const Teuchos::ParameterList& closure_models,
305  const Teuchos::ParameterList& user_data,
306  const bool write_graphviz_file=false,
307  const std::string& graphviz_file_prefix="");
308 
317  const std::vector<Teuchos::RCP<panzer::PhysicsBlock> >& physicsBlocks,
318  const std::vector<panzer::BC> & bcs,
319  const panzer::EquationSetFactory & eqset_factory,
320  const panzer::BCStrategyFactory& bc_factory,
322  const Teuchos::ParameterList& closure_models,
323  const Teuchos::ParameterList& user_data,
324  const bool write_graphviz_file=false,
325  const std::string& graphviz_file_prefix="");
326 
334  void setOneTimeDirichletBeta(const Scalar & beta) const;
335 
340  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & f) const;
341 
347  void setupAssemblyInArgs(const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
348  panzer::AssemblyEngineInArgs & ae_inargs) const;
349 
350 
356  return ae_tm_;
357  }
358 
360  { return responseLibrary_; }
361 
364  int getXTangentVectorIndex(const int index) const {
365  int v_index = 0;
366  for (int i=0; i<index; i++) {
367  if (!parameters_[i]->is_distributed)
368  ++v_index;
369  }
370  return v_index + parameters_.size();
371  }
372 
375  int getXDotTangentVectorIndex(const int index) const {
376  int v_index = 0;
377  for (int i=0; i<index; i++) {
378  if (!parameters_[i]->is_distributed)
379  ++v_index;
380  }
381  return v_index + parameters_.size() + tangent_space_.size();
382  }
383 
387  return parameters_[index]->initial_value;
388  }
389 
397  void evalModel_D2gDx2(int rIndex,
398  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
399  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_x,
400  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & D2gDx2) const;
401 
410  void evalModel_D2gDp2(int rIndex,
411  int pIndex,
412  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
413  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_x,
414  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & D2gDp2) const;
415 
424  void evalModel_D2gDpDx(int rIndex,
425  int pIndex,
426  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
427  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_x,
428  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & D2gDpDx) const;
429 
438  void evalModel_D2gDxDp(int rIndex,
439  int pIndex,
440  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
441  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_p,
442  const Teuchos::RCP<Thyra::VectorBase<Scalar> > & D2gDxDp) const;
443 
451  void evalModel_D2fDx2(const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
452  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_x,
453  const Teuchos::RCP<Thyra::LinearOpBase<Scalar> > & D2fDx2) const;
454 
463  void evalModel_D2fDp2(int pIndex,
464  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
465  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_x,
466  const Teuchos::RCP<Thyra::LinearOpBase<Scalar> > & D2fDp2) const;
467 
476  void evalModel_D2fDpDx(int pIndex,
477  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
478  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_x,
479  const Teuchos::RCP<Thyra::LinearOpBase<Scalar> > & D2fDpDx) const;
480 
489  void evalModel_D2fDxDp(int pIndex,
490  const Thyra::ModelEvaluatorBase::InArgs<Scalar> & inArgs,
491  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & delta_p,
492  const Teuchos::RCP<Thyra::LinearOpBase<Scalar> > & D2fDxDp) const;
493 
494 protected:
495 
498 
500  Thyra::ModelEvaluatorBase::OutArgs<Scalar> createOutArgsImpl() const override;
501 
503  virtual void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
504  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const override;
505 
507 
509  virtual void evalModelImpl_basic(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
510  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
511 
513  virtual void evalModelImpl_basic_g(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
514  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
515 
521  virtual void evalModelImpl_basic_dgdx(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
522  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
523 
529  virtual void evalModelImpl_basic_dgdp_scalar(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
530  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
531 
537  virtual void evalModelImpl_basic_dgdp_distro(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
538  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
539 
545  virtual void evalModelImpl_basic_dfdp_scalar(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
546  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
547 
553  virtual void evalModelImpl_basic_dfdp_scalar_fd(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
554  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
555 
561  virtual void evalModelImpl_basic_dfdp_distro(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs,
562  const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
563 
565  bool required_basic_g(const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
566 
568  bool required_basic_dgdx(const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
569 
571  bool required_basic_dgdp_scalar(const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
572 
574  bool required_basic_dgdp_distro(const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
575 
577  bool required_basic_dfdp_scalar(const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
578 
580  bool required_basic_dfdp_distro(const Thyra::ModelEvaluatorBase::OutArgs<Scalar> &outArgs) const;
581 
583  void initializeNominalValues() const;
584 
585  // Set parameters in model supplied by inArgs
586  void setParameters(const Thyra::ModelEvaluatorBase::InArgs<Scalar> &inArgs) const;
587 
588  // Reset parameters back to nominal values
589  void resetParameters() const;
590 
591 private: // data members
592 
594  bool is_distributed; // or (is scalar?)
598 
599  // for distributed parameters
602  // for residual sensitivities with respect to a distributed parameter
604  // for response sensitivities with respect to a distributed parameter
605 
606  // for scalar parameters
608  };
609 
610  struct ResponseObject {
611  std::string name;
613 
614  // for distributed parameter sensitivities
616  // used for delayed construction of dgdp (distributed parameter) responses
617  std::vector<WorksetDescriptor> wkst_desc;
618  // used for delayed construction of dgdp (distributed parameter) responses
619 
620  struct SearchName {
621  std::string name;
622  SearchName(const std::string & n) : name(n) {}
623  bool operator()(const Teuchos::RCP<ResponseObject> & ro) { return name==ro->name; }
624  };
625  };
626 
628  const Teuchos::Array<Scalar> & in_values) const;
630  const Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > & vs,
631  const Teuchos::RCP<const Thyra::VectorBase<Scalar> > & initial,
632  const Teuchos::RCP<const GlobalIndexer> & ugi) const;
633 
634  double t_init_;
635 
638 
639  mutable Thyra::ModelEvaluatorBase::InArgs<Scalar> prototypeInArgs_;
640  mutable Thyra::ModelEvaluatorBase::OutArgs<Scalar> prototypeOutArgs_;
641 
642  mutable Thyra::ModelEvaluatorBase::InArgs<Scalar> nominalValues_;
643 
644  mutable panzer::AssemblyEngine_TemplateManager<panzer::Traits> ae_tm_; // they control and provide access to evaluate
645 
646  std::vector<Teuchos::RCP<ParameterObject> > parameters_;
647  std::vector<Teuchos::RCP<Thyra::VectorSpaceBase<double> > > tangent_space_;
651 
654 
655  // responses
657  std::vector<Teuchos::RCP<ResponseObject> > responses_;
658 
661 
662  // basic specific linear object objects
667 
668 
670 
673 
675  mutable Scalar oneTimeDirichletBeta_;
676 
679  std::vector<bool> active_evaluation_types_;
680 
681  mutable unsigned long long write_matrix_count_;
682 };
683 
684 // Inline definition of the add response (its template on the builder type)
685 template<typename Scalar>
686 template <typename ResponseEvaluatorFactory_BuilderT>
688 addResponse(const std::string & responseName,
689  const std::vector<WorksetDescriptor> & wkst_desc,
690  const ResponseEvaluatorFactory_BuilderT & builder)
691 {
692  using Teuchos::RCP;
693  using Teuchos::rcp;
694 
695  // see if the response evaluators have been constucted yet
696  TEUCHOS_TEST_FOR_EXCEPTION(responseLibrary_->responseEvaluatorsBuilt(),std::logic_error,
697  "panzer::ModelEvaluator::addResponse: Response with name \"" << responseName << "\" "
698  "cannot be added to the model evaluator because evalModel has already been called!");
699 
700  // add the response
701  responseLibrary_->addResponse(responseName,wkst_desc,builder);
702 
703  // check that the response can be found
704  TEUCHOS_TEST_FOR_EXCEPTION(std::find_if(responses_.begin(),responses_.end(),typename ResponseObject::SearchName(responseName))!=responses_.end(),
705  std::logic_error,
706  "panzer::ModelEvaluator::addResponse: Response with name \"" << responseName << "\" "
707  "has already been added to the model evaluator!");
708 
709  // allocate response object
710  RCP<ResponseObject> respObject = rcp(new ResponseObject);
711 
712  // handle panzer::Traits::Residual
713  {
714  // check that at least there is a response value
715  Teuchos::RCP<panzer::ResponseBase> respBase = responseLibrary_->getResponse<panzer::Traits::Residual>(responseName);
716  TEUCHOS_TEST_FOR_EXCEPTION(respBase==Teuchos::null,std::logic_error,
717  "panzer::ModelEvaluator::addResponse: Response with name \"" << responseName << "\" "
718  "has no residual type! Not sure what is going on!");
719 
720  // check that the response supports interactions with the model evaluator
722  Teuchos::rcp_dynamic_cast<panzer::ResponseMESupportBase<panzer::Traits::Residual> >(respBase);
723  TEUCHOS_TEST_FOR_EXCEPTION(resp==Teuchos::null,std::logic_error,
724  "panzer::ModelEvaluator::addResponse: Response with name \"" << responseName << "\" "
725  "resulted in bad cast to panzer::ResponseMESupportBase, the type of the response is incompatible!");
726 
727  // set the response in the model evaluator
728  Teuchos::RCP<const Thyra::VectorSpaceBase<double> > vs = resp->getVectorSpace();
729  respObject->space = vs;
730 
731  // lets be cautious and set a vector on the response
732  resp->setVector(Thyra::createMember(vs));
733  }
734 
735  // handle panzer::Traits::Jacobian (do a quick safety check, response is null or appropriate for jacobian)
736  Teuchos::RCP<panzer::ResponseBase> respJacBase = responseLibrary_->getResponse<panzer::Traits::Jacobian>(responseName);
737  if(respJacBase!=Teuchos::null) {
738  typedef panzer::Traits::Jacobian RespEvalT;
739 
740  // check that the response supports interactions with the model evaluator
742  Teuchos::rcp_dynamic_cast<panzer::ResponseMESupportBase<RespEvalT> >(respJacBase);
743  TEUCHOS_TEST_FOR_EXCEPTION(resp==Teuchos::null,std::logic_error,
744  "panzer::ModelEvaluator::addResponse: Response with name \"" << responseName <<
745  "\" resulted in bad cast to panzer::ResponseMESupportBase<Jacobian>, the type "
746  "of the response is incompatible!");
747 
748  // setup the vector (register response as epetra)
749  if(resp->supportsDerivative())
750  resp->setDerivative(resp->buildDerivative());
751  }
752 
753 #ifdef Panzer_BUILD_HESSIAN_SUPPORT
754  // handle panzer::Traits::Hessian (do a quick safety check, response is null or appropriate for jacobian)
755  Teuchos::RCP<panzer::ResponseBase> respHesBase = responseLibrary_->getResponse<panzer::Traits::Hessian>(responseName);
756  if(respHesBase!=Teuchos::null) {
757  typedef panzer::Traits::Hessian RespEvalT;
758 
759  // check that the response supports interactions with the model evaluator
761  Teuchos::rcp_dynamic_cast<panzer::ResponseMESupportBase<RespEvalT> >(respHesBase);
762  TEUCHOS_TEST_FOR_EXCEPTION(resp==Teuchos::null,std::logic_error,
763  "panzer::ModelEvaluator::addResponse: Response with name \"" << responseName <<
764  "\" resulted in bad cast to panzer::ResponseMESupportBase<Hessian>, the type "
765  "of the response is incompatible!");
766 
767  // setup the vector (register response as epetra)
768  if(resp->supportsDerivative())
769  resp->setDerivative(resp->buildDerivative());
770  }
771 #endif
772 
773  respObject->name = responseName;
774  respObject->wkst_desc = wkst_desc;
775 
776  responses_.push_back(respObject);
777 
778  require_in_args_refresh_ = true;
779  require_out_args_refresh_ = true;
780  this->resetDefaultBase();
781 
782  return responses_.size()-1;
783 }
784 
785 
786 }
787 
788 // #include "Panzer_ModelEvaluator_impl.hpp"
789 
790 #endif
panzer::AssemblyEngine_TemplateManager< panzer::Traits > getAssemblyEngineTemplateManager() const
return a copy of the model evaluators template manager, this is shallow class so pass by value ...
Interface for constructing a BCStrategy_TemplateManager.
std::vector< WorksetDescriptor > wkst_desc
Allocates and initializes an equation set template manager.
virtual void evalModelImpl_basic_dgdp_distro(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Teuchos::RCP< const Thyra::VectorBase< Scalar > > get_parameter_vector(int index) const
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int i) const override
Teuchos::RCP< panzer::ResponseLibrary< panzer::Traits > > dfdp_rl
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_x_space() const override
Teuchos::RCP< const GlobalIndexer > global_indexer
std::vector< Teuchos::RCP< ParameterObject > > parameters_
void evalModel_D2gDp2(int rIndex, int pIndex, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &D2gDp2) const
void initializeNominalValues() const
Initialize the nominal values with good starting conditions.
int addDistributedParameter(const std::string &name, const Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > &vs, const Teuchos::RCP< GlobalEvaluationData > &ged, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &initial, const Teuchos::RCP< const GlobalIndexer > &ugi=Teuchos::null)
GlobalEvaluationDataContainer nonParamGlobalEvaluationData_
int addFlexibleResponse(const std::string &responseName, const std::vector< WorksetDescriptor > &wkst_desc, const Teuchos::RCP< ResponseMESupportBuilderBase > &builder)
Teuchos::RCP< const Thyra::VectorBase< Scalar > > initial_value
void evalModel_D2gDx2(int rIndex, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &D2gDx2) const
void evalModel_D2fDp2(int pIndex, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_x, const Teuchos::RCP< Thyra::LinearOpBase< Scalar > > &D2fDp2) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_f_space() const override
Thyra::ModelEvaluatorBase::InArgs< Scalar > prototypeInArgs_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > space
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< ParameterObject > createScalarParameter(const Teuchos::Array< std::string > &names, const Teuchos::Array< Scalar > &in_values) const
panzer::AssemblyEngine_TemplateManager< panzer::Traits > ae_tm_
void buildDistroParamDgDp_RL(const Teuchos::RCP< panzer::WorksetContainer > &wc, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const std::vector< panzer::BC > &bcs, const panzer::EquationSetFactory &eqset_factory, const panzer::BCStrategyFactory &bc_factory, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &cm_factory, const Teuchos::ParameterList &closure_models, const Teuchos::ParameterList &user_data, const bool write_graphviz_file=false, const std::string &graphviz_file_prefix="")
std::vector< Teuchos::RCP< ResponseObject > > responses_
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_DfDp_op(int i) const override
void evalModel_D2fDxDp(int pIndex, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_p, const Teuchos::RCP< Thyra::LinearOpBase< Scalar > > &D2fDxDp) const
void setupAssemblyInArgs(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, panzer::AssemblyEngineInArgs &ae_inargs) const
void buildVolumeFieldManagers(const bool value)
Teuchos::RCP< Teuchos::Array< std::string > > names
Thyra::ModelEvaluatorBase::InArgs< Scalar > createInArgs() const override
Teuchos::RCP< panzer::GlobalData > global_data_
void evalModel_D2gDpDx(int rIndex, int pIndex, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &D2gDpDx) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_g_space(int i) const override
void setOneTimeDirichletBeta(const Scalar &beta) const
virtual void evalModelImpl_basic(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Evaluate a simple model, meaning a residual and a jacobian, no fancy stochastic galerkin or multipoin...
std::vector< bool > active_evaluation_types_
void evalModel_D2fDx2(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_x, const Teuchos::RCP< Thyra::LinearOpBase< Scalar > > &D2fDx2) const
bool required_basic_g(const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Does this set of out args require a simple response?
Sacado::ScalarParameterVector< panzer::EvaluationTraits > ParamVec
virtual void evalModelImpl_basic_dgdx(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
bool required_basic_dgdp_distro(const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Are their required responses in the out args? DgDp.
Teuchos::RCP< panzer::ResponseLibrary< panzer::Traits > > dgdp_rl
const std::string & get_g_name(int i) const
bool operator()(const Teuchos::RCP< ResponseObject > &ro)
Teuchos::RCP< Thyra::LinearOpBase< Scalar > > create_W_op() const override
int addResponse(const std::string &responseName, const std::vector< WorksetDescriptor > &wkst_desc, const ResponseEvaluatorFactory_BuilderT &builder)
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > x_space_
void setParameters(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs) const
int getXTangentVectorIndex(const int index) const
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > f_space_
Teuchos::ArrayView< const std::string > get_g_names(int i) const override
Thyra::ModelEvaluatorBase::OutArgs< Scalar > createOutArgsImpl() const override
Teuchos::RCP< panzer::ResponseLibrary< panzer::Traits > > getResponseLibrary() const
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > get_W_factory() const override
virtual void evalModelImpl_basic_g(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Construct a simple response dicatated by this set of out args.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< ParameterObject > createDistributedParameter(const std::string &key, const Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > &vs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &initial, const Teuchos::RCP< const GlobalIndexer > &ugi) const
GlobalEvaluationDataContainer distrParamGlobalEvaluationData_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > space
Teuchos::RCP< const panzer::LinearObjFactory< panzer::Traits > > lof_
Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > get_p_space(int i) const override
void buildResponses(const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &cm_factory, const Teuchos::ParameterList &closure_models, const Teuchos::ParameterList &user_data, const bool write_graphviz_file=false, const std::string &graphviz_file_prefix="")
bool required_basic_dgdp_scalar(const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Are their required responses in the out args? DgDp.
Thyra::ModelEvaluatorBase::OutArgs< Scalar > prototypeOutArgs_
std::vector< Teuchos::RCP< Thyra::VectorSpaceBase< double > > > tangent_space_
Teuchos::RCP< const Thyra::LinearOpWithSolveFactoryBase< Scalar > > solverFactory_
bool required_basic_dgdx(const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Are their required responses in the out args? DgDx.
virtual void evalModelImpl(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const override
virtual void evalModelImpl_basic_dfdp_distro(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
virtual void evalModelImpl_basic_dfdp_scalar(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
void buildDistroParamDfDp_RL(const Teuchos::RCP< panzer::WorksetContainer > &wc, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const std::vector< panzer::BC > &bcs, const panzer::EquationSetFactory &eqset_factory, const panzer::BCStrategyFactory &bc_factory, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &cm_factory, const Teuchos::ParameterList &closure_models, const Teuchos::ParameterList &user_data, const bool write_graphviz_file=false, const std::string &graphviz_file_prefix="")
void setupModel(const Teuchos::RCP< panzer::WorksetContainer > &wc, const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const std::vector< panzer::BC > &bcs, const panzer::EquationSetFactory &eqset_factory, const panzer::BCStrategyFactory &bc_factory, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &volume_cm_factory, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &bc_cm_factory, const Teuchos::ParameterList &closure_models, const Teuchos::ParameterList &user_data, bool writeGraph=false, const std::string &graphPrefix="", const Teuchos::ParameterList &me_params=Teuchos::ParameterList())
virtual void evalModelImpl_basic_dfdp_scalar_fd(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Thyra::ModelEvaluatorBase::InArgs< Scalar > getNominalValues() const override
Teuchos::RCP< ResponseMESupportBuilderBase > builder
Teuchos::RCP< panzer::LinearObjContainer > ghostedContainer_
void buildResponses(const std::vector< Teuchos::RCP< panzer::PhysicsBlock > > &physicsBlocks, const panzer::EquationSetFactory &eqset_factory, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &cm_factory, const Teuchos::ParameterList &closure_models, const Teuchos::ParameterList &user_data, const bool write_graphviz_file=false, const std::string &graphviz_file_prefix="")
Teuchos::RCP< panzer::ResponseLibrary< panzer::Traits > > responseLibrary_
void addNonParameterGlobalEvaluationData(const std::string &name, const Teuchos::RCP< GlobalEvaluationData > &ged)
bool required_basic_dfdp_scalar(const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Are derivatives of the residual with respect to the scalar parameters in the out args? DfDp.
Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > xdotContainer_
void evalModel_D2fDpDx(int pIndex, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_x, const Teuchos::RCP< Thyra::LinearOpBase< Scalar > > &D2fDpDx) const
void evalModel_D2gDxDp(int rIndex, int pIndex, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Teuchos::RCP< const Thyra::VectorBase< Scalar > > &delta_p, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &D2gDxDp) const
Thyra::ModelEvaluatorBase::InArgs< Scalar > nominalValues_
void applyDirichletBCs(const Teuchos::RCP< Thyra::VectorBase< Scalar > > &x, const Teuchos::RCP< Thyra::VectorBase< Scalar > > &f) const
bool required_basic_dfdp_distro(const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Are derivatives of the residual with respect to the distributed parameters in the out args...
int getXDotTangentVectorIndex(const int index) const
virtual void evalModelImpl_basic_dgdp_scalar(const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const Thyra::ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
Teuchos::RCP< ReadOnlyVector_GlobalEvaluationData > xContainer_
void buildBCFieldManagers(const bool value)
int addParameter(const std::string &name, const Scalar &initial)
unsigned long long write_matrix_count_