43 #ifndef PANZER_PHYSICS_BLOCK_HPP
44 #define PANZER_PHYSICS_BLOCK_HPP
51 #include "Phalanx_FieldManager.hpp"
71 class IntegrationRule;
72 struct EquationSetFactory;
83 void buildPhysicsBlocks(
const std::map<std::string,std::string>& block_ids_to_physics_ids,
86 const int default_integration_order,
87 const std::size_t workset_size,
90 const bool build_transient_support,
92 const std::vector<std::string>& tangent_param_names = std::vector<std::string>());
100 void readPhysicsBlocks(
const std::map<std::string,std::string>& block_ids_to_physics_ids,
113 bool throw_on_failure =
true);
123 { std::cout <<
"WARNING: Default constructor for panzer::PhysicsBlock is for testing purposes only!" << std::endl; }
128 const std::string & element_block_id,
129 const int default_integration_order,
133 const bool build_transient_support,
134 const std::vector<std::string>& tangent_param_names = std::vector<std::string>());
142 const std::string & element_block_id);
152 const std::string & physics_block_id,
153 const int integration_order,
161 void initialize(
const int default_integration_order,
162 const bool build_transient_support,
166 const std::vector<std::string>& tangent_param_names = std::vector<std::string>());
196 const std::string& model_name,
203 const std::string& model_name,
207 template<
typename EvalT>
211 template<
typename EvalT>
216 template<
typename EvalT>
221 template<
typename EvalT>
226 template<
typename EvalT>
232 template<
typename EvalT>
235 const std::string& model_name,
240 const std::vector<std::string>&
getDOFNames()
const;
253 const std::map<std::string,Teuchos::RCP<panzer::PureBasis> >&
getBases()
const;
285 const int& default_integration_order,
286 const std::string & element_block_id,
288 const bool build_transient_support,
289 const std::vector<std::string>& tangent_param_names = std::vector<std::string>());
306 std::map<std::string,Teuchos::RCP<panzer::PureBasis> >
m_bases;
310 std::vector< Teuchos::RCP<panzer::EquationSet_TemplateManager<panzer::Traits> > >
m_equation_sets;
324 template<
typename EvalT>
333 vector< RCP<EquationSet_TemplateManager<panzer::Traits> > >::const_iterator
347 template<
typename EvalT>
357 vector< RCP<EquationSet_TemplateManager<panzer::Traits> > >::const_iterator
358 eq_set = m_equation_sets.begin();
360 for (;eq_set != m_equation_sets.end(); ++eq_set,++idx) {
361 if (m_active_evaluation_types[idx]) {
365 const int di = eqstm.getAsObject<EvalT>()->setDetailsIndex(this->getDetailsIndex());
366 eqstm.getAsObject<EvalT>()->buildAndRegisterGatherAndOrientationEvaluators(fm,*m_field_lib,lof,user_data);
367 eqstm.getAsObject<EvalT>()->setDetailsIndex(di);
372 template<
typename EvalT>
382 vector< RCP<EquationSet_TemplateManager<panzer::Traits> > >::const_iterator
383 eq_set = m_equation_sets.begin();
384 for (;eq_set != m_equation_sets.end(); ++eq_set) {
389 ir_iter != m_integration_rules.end(); ++ ir_iter) {
393 const int di = eqstm.getAsObject<EvalT>()->setDetailsIndex(this->getDetailsIndex());
394 eqstm.getAsObject<EvalT>()->buildAndRegisterDOFProjectionsToIPEvaluators(fm,*m_field_lib->buildFieldLayoutLibrary(*ir),ir,lof,user_data);
395 eqstm.getAsObject<EvalT>()->setDetailsIndex(di);
401 template<
typename EvalT>
411 vector< RCP<EquationSet_TemplateManager<panzer::Traits> > >::const_iterator
412 eq_set = m_equation_sets.begin();
413 for (;eq_set != m_equation_sets.end(); ++eq_set) {
417 const int di = eqstm.getAsObject<EvalT>()->setDetailsIndex(this->getDetailsIndex());
418 eqstm.getAsObject<EvalT>()->buildAndRegisterScatterEvaluators(fm,*m_field_lib,lof,user_data);
419 eqstm.getAsObject<EvalT>()->setDetailsIndex(di);
423 template<
typename EvalT>
434 vector< RCP<EquationSet_TemplateManager<panzer::Traits> > >::const_iterator
435 eq_set = m_equation_sets.begin();
436 for (;eq_set != m_equation_sets.end(); ++eq_set) {
442 ir_iter != m_integration_rules.end(); ++ ir_iter) {
446 const int di = eqstm.getAsObject<EvalT>()->setDetailsIndex(this->getDetailsIndex());
447 eqstm.getAsObject<EvalT>()->buildAndRegisterClosureModelEvaluators(fm,*m_field_lib->buildFieldLayoutLibrary(*ir),ir,factory,models,user_data);
448 eqstm.getAsObject<EvalT>()->setDetailsIndex(di);
454 template<
typename EvalT>
457 const std::string& model_name,
467 vector< RCP<EquationSet_TemplateManager<panzer::Traits> > >::const_iterator
468 eq_set = m_equation_sets.begin();
469 for (;eq_set != m_equation_sets.end(); ++eq_set) {
470 std::vector<StrBasisPair> providedDOFs;
474 const int di = eqstm.getAsObject<EvalT>()->setDetailsIndex(this->getDetailsIndex());
475 eqstm.getAsObject<EvalT>()->buildAndRegisterInitialConditionEvaluators(fm, *m_field_lib, factory, model_name, models, lof, user_data);
476 eqstm.getAsObject<EvalT>()->setDetailsIndex(di);
Teuchos::RCP< PhysicsBlock > copyWithCellData(const panzer::CellData &cell_data) const
const std::vector< std::string > & getDOFNames() const
std::vector< StrPureBasisPair > m_provided_dofs
Teuchos::RCP< panzer::GlobalData > m_global_data
Object that contains information on the physics and discretization of a block of elements with the SA...
const std::map< std::string, Teuchos::RCP< panzer::PureBasis > > & getBases() const
Returns the unique set of bases, key is the unique panzer::PureBasis::name() of the basis...
int setDetailsIndex(const int details_index)
Teuchos::RCP< const panzer::EquationSetFactory > m_eqset_factory
const panzer::CellData & cellData() const
void buildAndRegisterClosureModelEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const Teuchos::ParameterList &models, const Teuchos::ParameterList &user_data) const
void buildAndRegisterScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
int getDetailsIndex() const
Get the WorksetDetails index.
void buildAndRegisterClosureModelEvaluatorsForType(PHX::FieldManager< panzer::Traits > &fm, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const Teuchos::ParameterList &models, const Teuchos::ParameterList &user_data) const
std::string physicsBlockID() const
void buildAndRegisterInitialConditionEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const std::string &model_name, const Teuchos::ParameterList &models, const panzer::LinearObjFactory< panzer::Traits > &lof, 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
Teuchos::RCP< panzer::GlobalData > globalData() const
int m_default_integration_order
void setActiveEvaluationTypes(const std::vector< bool > &aet)
Used to save memory by disabling unneeded evaluation types.
std::vector< Teuchos::RCP< panzer::EquationSet_TemplateManager< panzer::Traits > > > m_equation_sets
void buildAndRegisterDOFProjectionsToIPEvaluators(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::Ptr< const panzer::LinearObjFactory< panzer::Traits > > &lof, const Teuchos::ParameterList &user_data) const
std::vector< std::vector< std::string > > m_coordinate_dofs
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
Data for determining cell topology and dimensionality.
panzer::CellData m_cell_data
std::string elementBlockID() const
const std::vector< std::vector< std::string > > & getCoordinateDOFs() const
std::map< std::string, Teuchos::RCP< panzer::PureBasis > > m_bases
map of unique bases, key is the panzer::PureBasis::name() corresponding to its value ...
void buildAndRegisterGatherAndOrientationEvaluatorsForType(PHX::FieldManager< panzer::Traits > &fm, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
Teuchos::RCP< Teuchos::ParameterList > m_input_parameters
store the input parameter list for copy ctors
void buildAndRegisterEquationSetEvaluatorsForType(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::ParameterList &user_data) const
std::map< int, Teuchos::RCP< panzer::IntegrationRule > > m_integration_rules
map of unique integration rules, key is panzer::IntegrationRule::order() corresponding to its value ...
void buildAndRegisterInitialConditionEvaluatorsForType(PHX::FieldManager< panzer::Traits > &fm, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const std::string &model_name, const Teuchos::ParameterList &models, const panzer::LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
const shards::CellTopology getBaseCellTopology() const
const std::vector< StrPureBasisPair > & getTangentFields() const
Returns list of tangent fields from DOFs and tangent param names.
Teuchos::RCP< const FieldLibrary > getFieldLibrary() const
WorksetNeeds getWorksetNeeds() const
Teuchos::RCP< const FieldLibraryBase > getFieldLibraryBase() const
void activateAllEvaluationTypes()
Used to reactivate all evaluation types if some were temporarily disabled with a call to setActiveEva...
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 initialize(const int default_integration_order, const bool build_transient_support, const panzer::CellData &cell_data, const Teuchos::RCP< const panzer::EquationSetFactory > &factory, const Teuchos::RCP< panzer::GlobalData > &global_data, const std::vector< std::string > &tangent_param_names=std::vector< std::string >())
bool m_build_transient_support
Teuchos::RCP< FieldLibrary > m_field_lib
std::vector< bool > m_active_evaluation_types
Returns true for evaluation types that are active.
std::string m_element_block_id
std::vector< std::string > m_dof_names
void buildAndRegisterDOFProjectionsToIPEvaluatorsForType(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::Ptr< const panzer::LinearObjFactory< panzer::Traits > > &lof, const Teuchos::ParameterList &user_data) const
void buildAndRegisterScatterEvaluatorsForType(PHX::FieldManager< panzer::Traits > &fm, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
std::vector< StrPureBasisPair > m_tangent_fields
void buildAndRegisterEquationSetEvaluators(PHX::FieldManager< panzer::Traits > &fm, const Teuchos::ParameterList &user_data) const
const std::vector< StrPureBasisPair > & getProvidedDOFs() const