43 #ifndef PANZER_BCSTRATEGY_WEAKDIRICHLET_DEFAULT_IMPL_IMPL_HPP
44 #define PANZER_BCSTRATEGY_WEAKDIRICHLET_DEFAULT_IMPL_IMPL_HPP
48 #include "Teuchos_Assert.hpp"
49 #include "Phalanx_DataLayout_MDALayout.hpp"
50 #include "Phalanx_FieldManager.hpp"
55 #include "Phalanx_MDField.hpp"
56 #include "Phalanx_DataLayout.hpp"
57 #include "Phalanx_DataLayout_MDALayout.hpp"
62 #include "Panzer_WeakDirichlet_Residual.hpp"
63 #include "Panzer_GatherSolution_Epetra.hpp"
64 #include "Panzer_ScatterResidual_Epetra.hpp"
65 #include "Panzer_Normals.hpp"
68 template <
typename EvalT>
79 template <
typename EvalT>
87 template <
typename EvalT>
94 buildAndRegisterGatherAndOrientationEvaluators(fm,pb,lof,user_data);
95 buildAndRegisterScatterEvaluators(fm,pb,lof,user_data);
99 template <
typename EvalT>
119 m_residual_contributions.begin(); eq != m_residual_contributions.end(); ++eq) {
121 const string& residual_name = std::get<0>(*eq);
122 const string& dof_name = std::get<1>(*eq);
123 const string& flux_name = std::get<2>(*eq);
132 ParameterList p(s.str());
133 p.set<std::string>(
"Name",
"Side Normal");
136 p.set<
bool>(
"Normalize",
true);
140 this->
template registerEvaluator<EvalT>(fm, op);
145 ParameterList p(
"Neumann Residual: " + residual_name +
" to DOF: " + dof_name);
146 p.set(
"Residual Name", residual_name);
147 p.set(
"DOF Name",dof_name);
148 p.set(
"Flux Name", flux_name);
149 p.set(
"Normal Name",
"Side Normal");
150 p.set(
"Basis", basis);
156 this->
template registerEvaluator<EvalT>(fm, op);
163 template <
typename EvalT>
180 m_residual_contributions.begin(); eq != m_residual_contributions.end(); ++eq) {
182 const string& residual_name = std::get<0>(*eq);
183 const string& dof_name = std::get<1>(*eq);
189 ParameterList p(
"Scatter: "+ residual_name +
" to " + dof_name);
192 string scatter_field_name =
"Dummy Scatter: " + this->m_bc.identifier() + residual_name;
193 p.set(
"Scatter Name", scatter_field_name);
194 p.set(
"Basis", basis);
197 residual_names->push_back(residual_name);
198 p.set(
"Dependent Names", residual_names);
201 names_map->insert(std::pair<string,string>(residual_name,dof_name));
202 p.set(
"Dependent Map", names_map);
206 this->
template registerEvaluator<EvalT>(fm, op);
211 PHX::Tag<typename EvalT::ScalarT> tag(scatter_field_name,
212 rcp(
new PHX::MDALayout<Dummy>(0)));
213 fm.template requireField<EvalT>(tag);
222 template <
typename EvalT>
226 m_required_dof_names.push_back(required_dof_name);
230 template <
typename EvalT>
233 const std::string dof_name,
234 const std::string flux_name,
235 const int integration_order,
242 m_residual_contributions.push_back(std::make_tuple(residual_name,
251 template <
typename EvalT>
255 return m_residual_contributions;
259 template <
typename EvalT>
264 const std::vector<std::pair<std::string,Teuchos::RCP<panzer::PureBasis> > >& dofBasisPair = side_pb.
getProvidedDOFs();
267 dofBasisPair.begin(); it != dofBasisPair.end(); ++it) {
268 if (it->first == dof_name)
273 "Error the name \"" << dof_name
274 <<
"\" is not a valid DOF for the boundary condition:\n"
275 << this->m_bc <<
"\n");
281 template <
typename EvalT>
292 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