Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_BCStrategy_Dirichlet_DefaultImpl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef PANZER_BCSTRATEGY_DIRICHLET_DEFAULT_IMPL_DECL_HPP
12 #define PANZER_BCSTRATEGY_DIRICHLET_DEFAULT_IMPL_DECL_HPP
13 
14 #include <vector>
15 #include <string>
16 #include <map>
17 
18 #include "Teuchos_RCP.hpp"
19 
20 #include "Panzer_BCStrategy.hpp"
22 #include "Panzer_Traits.hpp"
23 
24 #include "Phalanx_FieldManager.hpp"
25 
26 namespace panzer {
27 
28  template <typename EvalT>
31 
32  public:
33 
35  const bool check_apply_bc = false);
36 
38 
39  virtual void setup(const panzer::PhysicsBlock& side_pb, const Teuchos::ParameterList& user_data) = 0;
40 
42  const panzer::PhysicsBlock& pb,
44  const Teuchos::ParameterList& models,
45  const Teuchos::ParameterList& user_data) const = 0;
46 
47  void
49  const panzer::PhysicsBlock& pb,
51  const Teuchos::ParameterList& user_data) const;
52 
53  virtual void
55  const panzer::PhysicsBlock& side_pb,
57  const Teuchos::ParameterList& user_data) const;
58 
59  virtual void
61  const panzer::PhysicsBlock& side_pb,
63  const Teuchos::ParameterList& user_data) const;
64 
65  protected:
66 
67  struct DOFDescriptor {
69  : dofName("")
70  , coefficientResidual(false)
71  , residualName(std::make_pair(false,""))
72  , scatterName(std::make_pair(false,""))
73  , targetName(std::make_pair(false,""))
74  , timeDerivative(std::make_pair(false,"")) {}
75 
76  std::string dofName;
77  bool coefficientResidual; // don't use evaluation to compute the residual
78  // use the coefficient instead. Note this is useful
79  // for vector basis functions
80  std::pair<bool,std::string> residualName;
81  std::pair<bool,std::string> scatterName;
82  std::pair<bool,std::string> targetName;
83  std::pair<bool,std::string> timeDerivative;
84 
85  void print(std::ostream & os) const {
86  os << "BC DOF Desc = \"" << dofName << "\": "
87  << "Coeffieint Residual = " << (coefficientResidual ? "true" : "false") << ", "
88  << "Res = (" << residualName.first << ", \"" << residualName.second << ")\"), "
89  << "Scatter = (" << scatterName.first << ", \"" << scatterName.second << "\"), "
90  << "Scatter = (" << targetName.first << ", \"" << targetName.second << "\"), "
91  << "Time = (" << timeDerivative.first << ", \"" << timeDerivative.second << "\")";
92  }
93  };
94 
98  void buildDescriptorMapFromVectors() const;
99 
101  typedef typename std::map<std::string,DOFDescriptor>::const_iterator DescriptorIterator;
102 
103  void addDOF(const std::string & dofName);
104 
119  void addCoefficientTarget(const std::string & targetName,
120  const std::string & dofName,
121  const std::string & residualName = "");
122 
137  void addTarget(const std::string & targetName,
138  const std::string & dofName,
139  const std::string & residualName = "");
140 
155  void addDotTarget(const std::string & targetName,
156  const std::string & dofName,
157  const std::string & dotName="",
158  const std::string & residualName = "");
159 
160  std::map<std::string,DOFDescriptor> m_provided_dofs_desc;
161 
162  std::vector<std::string> required_dof_names;
163  std::map<std::string,std::string> residual_to_dof_names_map;
164  std::map<std::string,std::string> residual_to_target_field_map;
166  mutable bool descriptor_map_built; // this is set in a const method
167  };
168 
169 }
170 
171 #endif
virtual void buildAndRegisterGatherScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &pb, const panzer::LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
virtual void setup(const panzer::PhysicsBlock &side_pb, const Teuchos::ParameterList &user_data)=0
virtual void buildAndRegisterGatherAndOrientationEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &side_pb, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
Object that contains information on the physics and discretization of a block of elements with the SA...
Default implementation for accessing the GlobalData object.
BCStrategy_Dirichlet_DefaultImpl(const panzer::BC &bc, const Teuchos::RCP< panzer::GlobalData > &global_data, const bool check_apply_bc=false)
std::map< std::string, DOFDescriptor >::const_iterator DescriptorIterator
For convenience, declare the DOFDescriptor iterator.
virtual void buildAndRegisterScatterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &side_pb, const LinearObjFactory< panzer::Traits > &lof, const Teuchos::ParameterList &user_data) const
virtual void buildAndRegisterEvaluators(PHX::FieldManager< panzer::Traits > &fm, const panzer::PhysicsBlock &pb, const panzer::ClosureModelFactory_TemplateManager< panzer::Traits > &factory, const Teuchos::ParameterList &models, const Teuchos::ParameterList &user_data) const =0
void addTarget(const std::string &targetName, const std::string &dofName, const std::string &residualName="")
void addDotTarget(const std::string &targetName, const std::string &dofName, const std::string &dotName="", const std::string &residualName="")
void addCoefficientTarget(const std::string &targetName, const std::string &dofName, const std::string &residualName="")
Stores input information for a boundary condition.
Definition: Panzer_BC.hpp:48