Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_BC.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_BC_HPP
12 #define PANZER_BC_HPP
13 
14 #include <string>
15 #include <iostream>
16 #include <functional>
17 #include <cstddef>
18 #include <vector>
19 
20 #include <unordered_map>
21 
22 #include "Teuchos_RCP.hpp"
23 
24 #include "Panzer_GlobalData.hpp"
25 
26 namespace Teuchos {
27  class ParameterList;
28 }
29 
30 namespace panzer {
31 
32  class BC;
33  class WorksetDescriptor;
34 
38  void buildBCs(std::vector<panzer::BC>& bcs, const Teuchos::ParameterList& p, const Teuchos::RCP<panzer::GlobalData> global_data);
39 
41  enum BCType {
45  };
46 
48  class BC {
49  public:
50  // types supporting hashing
51  struct BCHash {
52  std::hash<std::string> hash;
53  std::size_t operator()(const BC & bc) const
54  { return this->hash(bc.elementBlockID() + "_" + bc.sidesetID());}
55  };
56 
57  struct BCEquality {
58  bool operator()(const BC & bc1,const BC & bc2) const
59  { return bc1.elementBlockID()==bc2.elementBlockID() && bc1.sidesetID()==bc2.sidesetID(); }
60  };
61 
62  public:
63 
65  BC(std::size_t bc_id,
66  BCType bc_type,
67  std::string sideset_id,
68  std::string element_block_id,
69  std::string equation_set_name,
70  std::string strategy);
71 
73  BC(std::size_t bc_id,
74  BCType bc_type,
75  std::string sideset_id,
76  std::string element_block_id,
77  std::string equation_set_name,
78  std::string strategy,
79  const Teuchos::ParameterList& p);
80 
82  BC(std::size_t bc_id,
83  const Teuchos::ParameterList& p);
84 
86  BC(std::size_t bc_id,
87  const Teuchos::ParameterList& p,
89 
91  ~BC();
92 
94  std::size_t bcID() const;
95 
97  BCType bcType() const;
98 
100  std::string sidesetID() const;
101 
103  std::string elementBlockID() const;
104 
106  std::string elementBlockID2() const;
107 
109  std::string equationSetName() const;
110 
112  std::string equationSetName2() const;
113 
115  std::string strategy() const;
116 
119 
122 
125 
127  std::string identifier() const;
128 
130  void print(std::ostream& os) const;
131 
132  private:
133 
135 
136  private:
137 
138  std::size_t m_bc_id;
139 
141 
142  std::string m_sideset_id;
143 
144  std::string m_element_block_id;
145 
146  std::string m_element_block_id2;
147 
148  std::string m_equation_set_name;
149 
150  std::string m_equation_set_name2;
151 
152  std::string m_strategy;
153 
155 
157  };
158 
159  std::ostream&
160  operator<<(std::ostream & os, const panzer::BC& bc);
161 
162  struct LessBC {
163 
164  bool operator()(const panzer::BC& left,
165  const panzer::BC& right) const
166  {
167  return left.bcID() < right.bcID();
168  }
169  };
170 
171  WorksetDescriptor bcDescriptor(const panzer::BC & bc);
172 
173 }
174 
175 #endif
bool operator()(const panzer::BC &left, const panzer::BC &right) const
Definition: Panzer_BC.hpp:164
std::string m_element_block_id
Definition: Panzer_BC.hpp:144
std::string m_strategy
Definition: Panzer_BC.hpp:152
BCType
Type of boundary condition.
Definition: Panzer_BC.hpp:41
~BC()
Dtor.
Definition: Panzer_BC.cpp:142
std::string elementBlockID() const
Returns the element block id associated with this sideset.
Definition: Panzer_BC.cpp:168
BCType m_bc_type
Definition: Panzer_BC.hpp:140
BC(std::size_t bc_id, BCType bc_type, std::string sideset_id, std::string element_block_id, std::string equation_set_name, std::string strategy)
Ctor.
Definition: Panzer_BC.cpp:45
Teuchos::RCP< Teuchos::ParameterList > m_params
Definition: Panzer_BC.hpp:154
Teuchos::RCP< panzer::GlobalData > m_gd
Definition: Panzer_BC.hpp:156
void validateParameters(Teuchos::ParameterList &p) const
Definition: Panzer_BC.cpp:271
std::string m_element_block_id2
Definition: Panzer_BC.hpp:146
std::string identifier() const
A unique string identifier for this boundary condition.
Definition: Panzer_BC.cpp:225
std::string m_equation_set_name
Definition: Panzer_BC.hpp:148
std::string m_equation_set_name2
Definition: Panzer_BC.hpp:150
std::string equationSetName2() const
Returns the second unknown name/keyword.
Definition: Panzer_BC.cpp:189
std::string strategy() const
Returns the keyword used to construct a bc strategy.
Definition: Panzer_BC.cpp:196
std::size_t m_bc_id
Definition: Panzer_BC.hpp:138
BCType bcType() const
Returns the boundary condition type (Dirichlet or Neumann or Interface).
Definition: Panzer_BC.cpp:154
std::string elementBlockID2() const
Returns the second element block id associated with this sideset.
Definition: Panzer_BC.cpp:175
void print(std::ostream &os) const
Print object using an ostream.
Definition: Panzer_BC.cpp:234
std::size_t operator()(const BC &bc) const
Definition: Panzer_BC.hpp:53
std::string equationSetName() const
Returns the unknown name/keyword.
Definition: Panzer_BC.cpp:182
std::size_t bcID() const
Returns a unique identifier for this bc - needed for unique parameter setting in LOCA and for map key...
Definition: Panzer_BC.cpp:147
Teuchos::RCP< const Teuchos::ParameterList > params() const
Returns a parameter list with user defined parameters for bc.
Definition: Panzer_BC.cpp:203
std::string sidesetID() const
Returns the set id.
Definition: Panzer_BC.cpp:161
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
std::string m_sideset_id
Definition: Panzer_BC.hpp:142
WorksetDescriptor bcDescriptor(const panzer::BC &bc)
Definition: Panzer_BC.cpp:300
Stores input information for a boundary condition.
Definition: Panzer_BC.hpp:48
Teuchos::RCP< Teuchos::ParameterList > nonconstParams() const
Returns a nonconst parameter list with user defined parameters for bc. Nonconst is meant to be used f...
Definition: Panzer_BC.cpp:218
bool operator()(const BC &bc1, const BC &bc2) const
Definition: Panzer_BC.hpp:58
std::hash< std::string > hash
Definition: Panzer_BC.hpp:52
Teuchos::RCP< panzer::GlobalData > global_data() const
Returns the RCP to the global data.
Definition: Panzer_BC.cpp:210