11#ifndef __Panzer_ResponseFactory_BCStrategyAdapter_hpp__
12#define __Panzer_ResponseFactory_BCStrategyAdapter_hpp__
18#include "Teuchos_RCP.hpp"
20#include "Panzer_BCStrategy.hpp"
24#include "Panzer_Normals.hpp"
27#include "Phalanx_Evaluator_WithBaseImpl.hpp"
28#include "Phalanx_FieldManager.hpp"
29#include "Phalanx_MDField.hpp"
43namespace response_bc_adapters {
49 template <
typename EvalT>
53 std::vector<std::pair<std::string,Teuchos::RCP<ResponseEvaluatorFactory_TemplateManager<panzer::Traits> > > >
refVec_;
80 const Teuchos::ParameterList& models,
81 const Teuchos::ParameterList& user_data)
const
86 for(std::size_t i=0;i<
refVec_.size();i++) {
87 Teuchos::RCP<const ResponseEvaluatorFactoryBase> respEvalFact =
refVec_[i].second->template getAsBase<EvalT>();
90 if(respEvalFact!=Teuchos::null && respEvalFact->typeSupported())
91 respEvalFact->buildAndRegisterEvaluators(
refVec_[i].first,fm,side_pb,user_data);
100 const Teuchos::ParameterList& )
const {}
113 const Teuchos::ParameterList& user_data)
const
122 const std::map<int,Teuchos::RCP<panzer::IntegrationRule> > & int_rules = side_pb.
getIntegrationRules();
123 for(std::map<
int,Teuchos::RCP<panzer::IntegrationRule> >::const_iterator itr=int_rules.begin();
124 itr!=int_rules.end();++itr) {
128 Teuchos::ParameterList p(s.str());
129 p.set<std::string>(
"Name",
"Side Normal");
131 p.set< Teuchos::RCP<panzer::IntegrationRule> >(
"IR", Teuchos::rcp_const_cast<panzer::IntegrationRule>(itr->second));
132 p.set<
bool>(
"Normalize",
true);
136 fm.template registerEvaluator<EvalT>(op);
153 typedef std::vector<std::pair<std::string,Teuchos::RCP<ResponseEvaluatorFactory_TemplateManager<panzer::Traits> > > >
RespFact_TM_Vector;
162 template <
typename EvalT>
163 Teuchos::RCP<BCStrategyBase>
build()
const
176 typedef std::vector<std::pair<std::string,Teuchos::RCP<ResponseEvaluatorFactory_TemplateManager<panzer::Traits> > > >
RespFact_TM_Vector;
184 Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> >
187 Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> > bcstrategy_tm
190 BCHashMap::const_iterator itr =
hashMap_.find(bc);
191 TEUCHOS_ASSERT(itr!=
hashMap_.end());
194 bcstrategy_tm->buildObjects(builder);
196 return bcstrategy_tm;
Stores input information for a boundary condition.
A PHX::TemplateManager holding one panzer::BCStrategy<EvalT> per evaluation type in Traits::EvalTypes...
A PHX::TemplateManager holding one panzer::ClosureModelFactory<EvalT> per evaluation type in Traits::...
Object that contains information on the physics and discretization of a block of elements with the SA...
const std::map< int, Teuchos::RCP< panzer::IntegrationRule > > & getIntegrationRules() const
Returns the unique set of point rules, key is the unique panzer::PointRule::name()
void buildAndRegisterEquationSetEvaluators(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::ParameterList &user_data) const
void buildAndRegisterGatherAndOrientationEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
void buildAndRegisterClosureModelEvaluatorsForType(PHX::FieldManager< panzer::Traits > &fm, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const Teuchos::ParameterList &models, const Teuchos::ParameterList &user_data) const
const panzer::CellData & cellData() const
void buildAndRegisterDOFProjectionsToIPEvaluators(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::Ptr< const panzer::LinearObjFactory< panzer::Traits > > &lof, const Teuchos::ParameterList &user_data) const
A PHX::TemplateManager holding one panzer::ResponseEvaluatorFactory<EvalT> per evaluation type in Tra...
BCStrategyFactory that produces a BCStrategy_TemplateManager wrapping the responses registered for ea...
Teuchos::RCP< panzer::BCStrategy_TemplateManager< panzer::Traits > > buildBCStrategy(const panzer::BC &bc, const Teuchos::RCP< panzer::GlobalData > &) const
Looks up bc in the hash map and builds a BCStrategy_TemplateManager adapting its response factories.
BCHashMap hashMap_
Map from boundary condition to the responses registered on it.
std::vector< std::pair< std::string, Teuchos::RCP< ResponseEvaluatorFactory_TemplateManager< panzer::Traits > > > > RespFact_TM_Vector
BCFactoryResponse(const BCHashMap &hashMap)
Construct from the full map of boundary condition to its (response name, factory) pairs.
std::unordered_map< BC, Teuchos::RCP< RespFact_TM_Vector >, BC::BCHash, BC::BCEquality > BCHashMap
Builder functor used with BCStrategy_TemplateManager::buildObjects() to construct a ResponseFactory_B...
BCStrategy_TM_ResponseAdapterBuilder(const BC &bc, const RespFact_TM_Vector &vec)
Construct from the boundary condition and the (response name, factory) pairs to adapt.
Teuchos::RCP< BCStrategyBase > build() const
Builds a ResponseFactory_BCStrategyAdapter<EvalT> for the given evaluation type.
const RespFact_TM_Vector & vec_
std::vector< std::pair< std::string, Teuchos::RCP< ResponseEvaluatorFactory_TemplateManager< panzer::Traits > > > > RespFact_TM_Vector
Adapts a set of named ResponseEvaluatorFactory objects into a single BCStrategy, so responses can be ...
virtual void buildAndRegisterScatterEvaluators(PHX::FieldManager< panzer::Traits > &, const panzer::PhysicsBlock &, const LinearObjFactory< panzer::Traits > &, const Teuchos::ParameterList &) const
No-op: response adapters do not scatter residual/Jacobian contributions.
virtual void setup(const panzer::PhysicsBlock &, const Teuchos::ParameterList &)
No-op: this adapter requires no additional setup.
ResponseFactory_BCStrategyAdapter(const panzer::BC &bc, const std::vector< std::pair< std::string, Teuchos::RCP< ResponseEvaluatorFactory_TemplateManager< panzer::Traits > > > > &refVec)
Construct from the boundary condition being adapted and the responses to build on it.
virtual void buildAndRegisterGatherAndOrientationEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &side_pb, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
Registers gather/orientation/DOF-projection evaluators for the side, plus a side-normal evaluator for...
virtual void buildAndRegisterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &side_pb, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const Teuchos::ParameterList &models, const Teuchos::ParameterList &user_data) const
Registers the side physics block's equation-set/closure-model evaluators, then delegates to each wrap...
std::vector< std::pair< std::string, Teuchos::RCP< ResponseEvaluatorFactory_TemplateManager< panzer::Traits > > > > refVec_
(response name, factory) pairs to register evaluators for.
virtual ~ResponseFactory_BCStrategyAdapter()
Interface for constructing a BCStrategy_TemplateManager.