11 #ifndef PANZER_BCSTRATEGY_WEAKDIRICHLET_DEFAULT_IMPL_IMPL_HPP
12 #define PANZER_BCSTRATEGY_WEAKDIRICHLET_DEFAULT_IMPL_IMPL_HPP
16 #include "Teuchos_Assert.hpp"
17 #include "Phalanx_DataLayout_MDALayout.hpp"
18 #include "Phalanx_FieldManager.hpp"
23 #include "Phalanx_MDField.hpp"
24 #include "Phalanx_DataLayout.hpp"
25 #include "Phalanx_DataLayout_MDALayout.hpp"
30 #include "Panzer_WeakDirichlet_Residual.hpp"
32 #ifdef PANZER_HAVE_EPETRA_STACK
33 #include "Panzer_GatherSolution_Epetra.hpp"
34 #include "Panzer_ScatterResidual_Epetra.hpp"
37 #include "Panzer_Normals.hpp"
40 template <
typename EvalT>
51 template <
typename EvalT>
59 template <
typename EvalT>
66 buildAndRegisterGatherAndOrientationEvaluators(fm,pb,lof,user_data);
67 buildAndRegisterScatterEvaluators(fm,pb,lof,user_data);
71 template <
typename EvalT>
91 m_residual_contributions.begin(); eq != m_residual_contributions.end(); ++eq) {
93 const string& residual_name = std::get<0>(*eq);
94 const string& dof_name = std::get<1>(*eq);
95 const string& flux_name = std::get<2>(*eq);
104 ParameterList p(s.str());
105 p.set<std::string>(
"Name",
"Side Normal");
108 p.set<
bool>(
"Normalize",
true);
112 this->
template registerEvaluator<EvalT>(fm, op);
117 ParameterList p(
"Neumann Residual: " + residual_name +
" to DOF: " + dof_name);
118 p.set(
"Residual Name", residual_name);
119 p.set(
"DOF Name",dof_name);
120 p.set(
"Flux Name", flux_name);
121 p.set(
"Normal Name",
"Side Normal");
122 p.set(
"Basis", basis);
128 this->
template registerEvaluator<EvalT>(fm, op);
135 template <
typename EvalT>
152 m_residual_contributions.begin(); eq != m_residual_contributions.end(); ++eq) {
154 const string& residual_name = std::get<0>(*eq);
155 const string& dof_name = std::get<1>(*eq);
161 ParameterList p(
"Scatter: "+ residual_name +
" to " + dof_name);
164 string scatter_field_name =
"Dummy Scatter: " + this->m_bc.identifier() + residual_name;
165 p.set(
"Scatter Name", scatter_field_name);
166 p.set(
"Basis", basis);
169 residual_names->push_back(residual_name);
170 p.set(
"Dependent Names", residual_names);
173 names_map->insert(std::pair<string,string>(residual_name,dof_name));
174 p.set(
"Dependent Map", names_map);
178 this->
template registerEvaluator<EvalT>(fm, op);
185 fm.template requireField<EvalT>(tag);
194 template <
typename EvalT>
198 m_required_dof_names.push_back(required_dof_name);
202 template <
typename EvalT>
205 const std::string dof_name,
206 const std::string flux_name,
207 const int integration_order,
214 m_residual_contributions.push_back(std::make_tuple(residual_name,
223 template <
typename EvalT>
227 return m_residual_contributions;
231 template <
typename EvalT>
236 const std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > >& dofBasisPair = side_pb.
getProvidedDOFs();
239 dofBasisPair.begin(); it != dofBasisPair.end(); ++it) {
240 if (it->first == dof_name)
245 "Error the name \"" << dof_name
246 <<
"\" is not a valid DOF for the boundary condition:\n"
247 << this->m_bc <<
"\n");
253 template <
typename EvalT>
264 template <
typename EvalT>
virtual void requireDOFGather(const std::string required_dof_name)
Requires that a gather evaluator for the DOF be constructed.
bool is_null(const boost::shared_ptr< T > &p)
Object that contains information on the physics and discretization of a block of elements with the SA...
Default implementation for accessing the GlobalData object.
const panzer::CellData & cellData() const
const panzer::BC bc() const
Returns the boundary condition data for this object.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
virtual void addResidualContribution(const std::string residual_name, const std::string dof_name, const std::string flux_name, const int integration_order, const panzer::PhysicsBlock &side_pb)
Adds a residual contribution for a neumann condition to a particular equation.
virtual void buildAndRegisterGatherScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &side_pb, 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::IntegrationRule > buildIntegrationRule(const int integration_order, const panzer::PhysicsBlock &side_pb) const
Allocates and returns the integration rule associated with an integration order and side physics bloc...
const std::vector< std::tuple< std::string, std::string, std::string, int, Teuchos::RCP< panzer::PureBasis >, Teuchos::RCP< panzer::IntegrationRule > > > getResidualContributionData() const
Returns information for the residual contribution integrations associated with this Neumann BC...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< panzer::PureBasis > getBasis(const std::string dof_name, const panzer::PhysicsBlock &side_pb) const
Finds the basis for the corresponding dof_name in the physics block.
BCStrategy_WeakDirichlet_DefaultImpl(const panzer::BC &bc, const Teuchos::RCP< panzer::GlobalData > &global_data)
virtual ~BCStrategy_WeakDirichlet_DefaultImpl()
virtual void buildAndRegisterGatherAndOrientationEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &side_pb, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
virtual void buildAndRegisterScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &side_pb, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
Stores input information for a boundary condition.
Teuchos::RCP< PHX::Evaluator< Traits > > buildScatter(const Teuchos::ParameterList &pl) const
Use preconstructed scatter evaluators.
#define TEUCHOS_ASSERT(assertion_test)
Evaluates a Weak Dirichlet BC residual contribution.
const std::vector< StrPureBasisPair > & getProvidedDOFs() const