Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_CheckBCConsistency.cpp
Go to the documentation of this file.
2 #include "Panzer_BC.hpp"
3 
4 namespace panzer {
5 
6  void checkBCConsistency(const std::vector<std::string>& element_block_names,
7  const std::vector<std::string>& sideset_names,
8  const std::vector<panzer::BC>& bcs)
9  {
10  for (const auto& bc : bcs) {
11  const auto eb_search = std::find(element_block_names.begin(),
12  element_block_names.end(),
13  bc.elementBlockID());
14 
15  TEUCHOS_TEST_FOR_EXCEPTION(eb_search == element_block_names.end(),
16  std::runtime_error,
17  "ERROR: the element block \"" << bc.elementBlockID()
18  << "\" for boundary condition \"" << bc.bcID()
19  << "\" does not exist in the mesh.");
20 
21  const auto ss_search = std::find(sideset_names.begin(),
22  sideset_names.end(),
23  bc.sidesetID());
24 
25  TEUCHOS_TEST_FOR_EXCEPTION(ss_search == sideset_names.end(),
26  std::runtime_error,
27  "ERROR: the element block \"" << bc.sidesetID()
28  << "\" for boundary condition \"" << bc.bcID()
29  << "\" does not exist in the mesh.");
30  }
31  }
32 
33 }
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void checkBCConsistency(const std::vector< std::string > &element_block_names, const std::vector< std::string > &sideset_names, const std::vector< panzer::BC > &bcs)