44 #include "Teuchos_Assert.hpp" 45 #include "Teuchos_ParameterList.hpp" 50 panzer::buildBCs(std::vector<panzer::BC>& bcs,
const Teuchos::ParameterList& p,
const Teuchos::RCP<panzer::GlobalData>
global_data)
52 using Teuchos::ParameterList;
57 TEUCHOS_TEST_FOR_EXCEPTION(p.isParameter(
"Number of Boundary Conditions"),
59 "Error - the parameter \"Number of Boundary Conditions\" is no longer valid for the boundary condition sublist. Please remove this from your input file!");
61 std::size_t bc_index = 0;
62 for (ParameterList::ConstIterator bc_pl=p.begin(); bc_pl != p.end(); ++bc_pl,++bc_index) {
63 TEUCHOS_TEST_FOR_EXCEPTION( !(bc_pl->second.isList()), std::logic_error,
64 "Error - All objects in the boundary condition sublist must be BC sublists!" );
65 ParameterList& sublist = bc_pl->second.getValue(&sublist);
77 std::string sideset_id,
78 std::string element_block_id,
79 std::string eq_set_name,
80 std::string strategy) :
83 m_sideset_id(sideset_id),
84 m_element_block_id(element_block_id),
85 m_equation_set_name(eq_set_name),
94 std::string sideset_id,
95 std::string element_block_id,
96 std::string eq_set_name,
98 const Teuchos::ParameterList& p) :
101 m_sideset_id(sideset_id),
102 m_element_block_id(element_block_id),
103 m_equation_set_name(eq_set_name),
106 m_params = Teuchos::rcp(
new Teuchos::ParameterList(
""));
114 Teuchos::RCP<Teuchos::ParameterList> params = Teuchos::parameterList();
117 this->validateParameters(*params);
120 std::string type = params->get<std::string>(
"Type");
121 if (type ==
"Dirichlet")
123 else if (type ==
"Neumann")
125 else if (type ==
"Interface")
128 m_sideset_id = params->get<std::string>(
"Sideset ID");
129 m_element_block_id = params->get<std::string>(
"Element Block ID");
130 m_equation_set_name = params->get<std::string>(
"Equation Set Name");
131 m_strategy = params->get<std::string>(
"Strategy");
132 m_params = Teuchos::sublist(params,
"Data");
133 if (type ==
"Interface") {
134 m_element_block_id2 = params->get<std::string>(
"Element Block ID2");
135 m_equation_set_name2 = params->get<std::string>(
"Equation Set Name2");
141 panzer::BC::BC(std::size_t bc_id,
const Teuchos::ParameterList& p,
const Teuchos::RCP<panzer::GlobalData> gd)
143 Teuchos::RCP<Teuchos::ParameterList> params = Teuchos::parameterList();
148 this->validateParameters(*params);
151 std::string type = params->get<std::string>(
"Type");
152 if (type ==
"Dirichlet")
154 else if (type ==
"Neumann")
156 else if (type ==
"Interface")
159 m_sideset_id = params->get<std::string>(
"Sideset ID");
160 m_element_block_id = params->get<std::string>(
"Element Block ID");
161 m_equation_set_name = params->get<std::string>(
"Equation Set Name");
162 m_strategy = params->get<std::string>(
"Strategy");
163 m_params = Teuchos::sublist(params,
"Data");
164 if (type ==
"Interface") {
165 m_element_block_id2 = params->get<std::string>(
"Element Block ID2");
166 m_equation_set_name2 = params->get<std::string>(
"Equation Set Name2");
200 return m_element_block_id;
207 return m_element_block_id2;
214 return m_equation_set_name;
221 return m_equation_set_name2;
247 Teuchos::RCP<Teuchos::ParameterList>
257 std::ostringstream os;
258 os <<
"BC(" << bcID() <<
")";
268 os <<
"panzer::BC" << endl;
270 os <<
" BC ID =" << m_bc_id << endl;
282 os <<
" Type = " << type << endl;
283 os <<
" Side Set ID = " << m_sideset_id << endl;
284 os <<
" Element Block ID = " << m_element_block_id << endl;
286 os <<
" Second Element Block ID = " << m_element_block_id2 << endl;
287 os <<
" Strategy = " << m_strategy << endl;
288 os <<
" Variable Name(s) = " << m_equation_set_name << endl;
290 os <<
" Second Variable Name(s) = " << m_equation_set_name2 << endl;
291 os <<
" Strategy Name = " << m_strategy;
293 if (!Teuchos::is_null(m_params))
294 os << endl << m_params;
302 Teuchos::ParameterList valid_params;
304 valid_params.set<std::string>(
"Type",
"Dirichlet");
305 valid_params.set<std::string>(
"Sideset ID",
"???");
306 valid_params.set<std::string>(
"Element Block ID",
"???");
307 valid_params.set<std::string>(
"Element Block ID2",
"???");
308 valid_params.set<std::string>(
"Equation Set Name",
"???");
309 valid_params.set<std::string>(
"Equation Set Name2",
"???");
310 valid_params.set<std::string>(
"Strategy",
"???");
311 valid_params.sublist(
"Data").disableRecursiveValidation();
313 p.validateParametersAndSetDefaults(valid_params);
void validateParameters(Teuchos::ParameterList &p) const
BCType
Type of boundary condition.
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.
Teuchos::RCP< Teuchos::ParameterList > m_params
std::string elementBlockID2() const
Returns the second element block id associated with this sideset.
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 bcType() const
Returns the boundary condition type (Dirichlet or Neumann or Interface).
Teuchos::RCP< panzer::GlobalData > global_data() const
Returns the RCP to the global data.
Teuchos::RCP< panzer::GlobalData > global_data
std::string identifier() const
A unique string identifier for this boundary condition.
Teuchos::RCP< const Teuchos::ParameterList > params() const
Returns a parameter list with user defined parameters for bc.
std::string strategy() const
Returns the keyword used to construct a bc strategy.
std::string equationSetName() const
Returns the unknown name/keyword.
std::size_t bcID() const
Returns a unique identifier for this bc - needed for unique parameter setting in LOCA and for map key...
std::string elementBlockID() const
Returns the element block id associated with this sideset.
std::ostream & operator<<(std::ostream &os, const AssemblyEngineInArgs &in)
std::string equationSetName2() const
Returns the second unknown name/keyword.
Stores input information for a boundary condition.
std::string sidesetID() const
Returns the set id.
void print(std::ostream &os) const
Print object using an ostream.