Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> >
  BCFactoryComposite::
  buildBCStrategy(const panzer::BC& bc, 
		  const Teuchos::RCP<panzer::GlobalData>& global_data) const
  {    
    Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> > bcs_tm;
    
    bool found = false;

    for (std::vector<Teuchos::RCP<panzer::BCStrategyFactory> >::const_iterator factory = m_bc_strategy_factories.begin(); 
         factory != m_bc_strategy_factories.end(); ++factory) {

      bcs_tm = (*factory)->buildBCStrategy(bc,global_data);
      
      if (nonnull(bcs_tm)) {
        found = true;
        break;
      }

    }
        
    TEUCHOS_TEST_FOR_EXCEPTION(!found, std::logic_error, 
			       "Error - the BC Strategy called \"" << bc.strategy() <<
			       "\" is not a valid identifier in the BCStrategyFactory.  Either add " <<
                               "a valid implementation to the factory or fix the input file.  The " <<
                               "relevant boundary condition is:\n\n" << bc << std::endl);
    
    return bcs_tm;
    
  }
   Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> >
   buildBCStrategy(const panzer::BC& bc,const Teuchos::RCP<panzer::GlobalData>& global_data) const
   {

      Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> > bcs_tm = 
	Teuchos::rcp(new panzer::BCStrategy_TemplateManager<panzer::Traits>);
      
      bool found = false;

      PANZER_BUILD_BCSTRATEGY_OBJECTS("Constant", 
				      Example::BCStrategy_Dirichlet_Constant,
				      BCStrategy_Dirichlet_Constant)

      PANZER_BUILD_BCSTRATEGY_OBJECTS("Neumann Constant",
                                      Example::BCStrategy_Neumann_Constant,
                                      BCStrategy_Neumann_Constant)

      PANZER_BUILD_BCSTRATEGY_OBJECTS("Weak Dirichlet Match Interface",
                                      Example::BCStrategy_Interface_WeakDirichletMatch,
                                      BCStrategy_Interface_WeakDirichletMatch)

      PANZER_BUILD_BCSTRATEGY_OBJECTS("Neumann Match Interface",
                                      Example::BCStrategy_Interface_NeumannMatch,
                                      BCStrategy_Interface_NeumannMatch)

      TEUCHOS_TEST_FOR_EXCEPTION(!found, std::logic_error, 
			 "Error - the BC Strategy called \"" << bc.strategy() <<
			 "\" is not a valid identifier in the BCStrategyFactory.  Either add a "
                         "valid implementation to your factory or fix your input file.  The "
                         "relevant boundary condition is:\n\n" << bc << std::endl);
      
      return bcs_tm;
   }
    Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> >
    buildBCStrategy(const panzer::BC& bc, const Teuchos::RCP<panzer::GlobalData>& global_data) const
    {

      Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> > bcs_tm = 
	Teuchos::rcp(new panzer::BCStrategy_TemplateManager<panzer::Traits>);
      
      bool found = false;

      PANZER_BUILD_BCSTRATEGY_OBJECTS("Constant 1",
        BCStrategy_Dirichlet_Constant);

      if (m_throw_on_failure)
	TEUCHOS_TEST_FOR_EXCEPTION(!found, std::logic_error, 
				   "Error - the BC Strategy Physics1 called \"" << bc.strategy() <<
				   "\" is not a valid identifier in the BCStrategyFactory.  Either add a valid implementation to your factory or fix your input file.  The relevant boundary condition is:\n\n" << bc << std::endl);
      
      if (!found)
	return Teuchos::null;
      
      return bcs_tm;
    }