Panzer Version of the Day
Loading...
Searching...
No Matches
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
26namespace Teuchos {
27 class ParameterList;
28}
29
30namespace 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
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,
88 const Teuchos::RCP<panzer::GlobalData> gd);
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
118 Teuchos::RCP<const Teuchos::ParameterList> params() const;
119
121 Teuchos::RCP<panzer::GlobalData> global_data() const;
122
124 Teuchos::RCP<Teuchos::ParameterList> nonconstParams() const;
125
127 std::string identifier() const;
128
130 void print(std::ostream& os) const;
131
132 private:
133
134 void validateParameters(Teuchos::ParameterList& p) const;
135
136 private:
137
138 std::size_t m_bc_id;
139
141
142 std::string m_sideset_id;
143
145
147
149
151
152 std::string m_strategy;
153
154 Teuchos::RCP<Teuchos::ParameterList> m_params;
155
156 Teuchos::RCP<panzer::GlobalData> m_gd;
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
Stores input information for a boundary condition.
Definition Panzer_BC.hpp:48
std::string m_strategy
Teuchos::RCP< panzer::GlobalData > m_gd
void buildBCs(std::vector< panzer::BC > &bcs, const Teuchos::ParameterList &p, const Teuchos::RCP< panzer::GlobalData > global_data)
Nonmember constructor to build BC objects from a ParameterList.
Teuchos::RCP< Teuchos::ParameterList > nonconstParams() const
Returns a nonconst parameter list with user defined parameters for bc. Nonconst is meant to be used f...
BCType m_bc_type
std::string m_equation_set_name
std::string sidesetID() const
Returns the set id.
std::string m_element_block_id2
std::size_t bcID() const
Returns a unique identifier for this bc - needed for unique parameter setting in LOCA and for map key...
Teuchos::RCP< const Teuchos::ParameterList > params() const
Returns a parameter list with user defined parameters for bc.
void print(std::ostream &os) const
Print object using an ostream.
BCType bcType() const
Returns the boundary condition type (Dirichlet or Neumann or Interface).
std::string m_sideset_id
std::string m_element_block_id
std::string elementBlockID() const
Returns the element block id associated with this sideset.
std::string m_equation_set_name2
Teuchos::RCP< panzer::GlobalData > global_data() const
Returns the RCP to the global data.
std::string elementBlockID2() const
Returns the second element block id associated with this sideset.
std::string equationSetName2() const
Returns the second unknown name/keyword.
std::string identifier() const
A unique string identifier for this boundary condition.
std::size_t m_bc_id
void validateParameters(Teuchos::ParameterList &p) const
Teuchos::RCP< Teuchos::ParameterList > m_params
std::string strategy() const
Returns the keyword used to construct a bc strategy.
std::string equationSetName() const
Returns the unknown name/keyword.
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
WorksetDescriptor bcDescriptor(const panzer::BC &bc)
BCType
Type of boundary condition.
Definition Panzer_BC.hpp:41
@ BCT_Dirichlet
Definition Panzer_BC.hpp:42
@ BCT_Neumann
Definition Panzer_BC.hpp:43
@ BCT_Interface
Definition Panzer_BC.hpp:44
bool operator()(const BC &bc1, const BC &bc2) const
Definition Panzer_BC.hpp:58
std::hash< std::string > hash
Definition Panzer_BC.hpp:52
std::size_t operator()(const BC &bc) const
Definition Panzer_BC.hpp:53
bool operator()(const panzer::BC &left, const panzer::BC &right) const