VertexCFD  0.0-dev
VertexCFD_BCStrategy_StrongDirichletMMS_impl.hpp
1 #ifndef VERTEXCFD_BOUNDARYCONDITION_STORNGDIRICHLETMMS_IMPL_HPP
2 #define VERTEXCFD_BOUNDARYCONDITION_STORNGDIRICHLETMMS_IMPL_HPP
3 
4 #include <Panzer_Copy.hpp>
5 
6 namespace VertexCFD
7 {
8 namespace BoundaryCondition
9 {
10 //---------------------------------------------------------------------------//
11 template<class EvalType>
12 StrongDirichletMMS<EvalType>::StrongDirichletMMS(
13  const panzer::BC& bc, const Teuchos::RCP<panzer::GlobalData>& global_data)
14  : panzer::BCStrategy_Dirichlet_DefaultImpl<EvalType>(bc, global_data)
15 {
16  if (this->m_bc.strategy() != "StrongDirichletMMS")
17  {
18  throw std::runtime_error("StrongDirichletMMS BC name incorrect");
19  }
20 }
21 
22 //---------------------------------------------------------------------------//
23 template<class EvalType>
24 void StrongDirichletMMS<EvalType>::setup(const panzer::PhysicsBlock& side_pb,
25  const Teuchos::ParameterList&)
26 {
27  _dofs = side_pb.getProvidedDOFs();
28  for (auto& dof : _dofs)
29  {
30  this->addDOF(dof.first);
31  this->addTarget("StrongDirichletMMS_" + dof.first, dof.first);
32  }
33 }
34 
35 //---------------------------------------------------------------------------//
36 template<class EvalType>
37 void StrongDirichletMMS<EvalType>::buildAndRegisterEvaluators(
38  PHX::FieldManager<panzer::Traits>& fm,
39  const panzer::PhysicsBlock&,
40  const panzer::ClosureModelFactory_TemplateManager<panzer::Traits>&,
41  const Teuchos::ParameterList&,
42  const Teuchos::ParameterList&) const
43 {
44  for (auto& dof : _dofs)
45  {
46  Teuchos::ParameterList p("BC MMS Strong Dirichlet");
47  p.set("Source Name", dof.first);
48  p.set("Destination Name", "StrongDirichletMMS_" + dof.first);
49  p.set("Data Layout", dof.second->functional);
50  auto op = Teuchos::rcp(new panzer::Copy<EvalType, panzer::Traits>(p));
51  this->template registerEvaluator<EvalType>(fm, op);
52  }
53 }
54 
55 //---------------------------------------------------------------------------//
56 
57 } // end namespace BoundaryCondition
58 } // end namespace VertexCFD
59 
60 #endif // end VERTEXCFD_BOUNDARYCONDITION_STORNGDIRICHLETMMS_IMPL_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23