Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_BCStrategy_Factory_Composite.cpp
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
12#include "Panzer_BC.hpp"
13
14namespace panzer {
15
16 BCFactoryComposite::BCFactoryComposite(const std::vector<Teuchos::RCP<panzer::BCStrategyFactory> >& factories) :
17 m_bc_strategy_factories(factories)
18 {
19
20 }
21
22 Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> >
25 const Teuchos::RCP<panzer::GlobalData>& global_data) const
26 {
27 Teuchos::RCP<panzer::BCStrategy_TemplateManager<panzer::Traits> > bcs_tm;
28
29 bool found = false;
30
31 for (std::vector<Teuchos::RCP<panzer::BCStrategyFactory> >::const_iterator factory = m_bc_strategy_factories.begin();
32 factory != m_bc_strategy_factories.end(); ++factory) {
33
34 bcs_tm = (*factory)->buildBCStrategy(bc,global_data);
35
36 if (nonnull(bcs_tm)) {
37 found = true;
38 break;
39 }
40
41 }
42
43 TEUCHOS_TEST_FOR_EXCEPTION(!found, std::logic_error,
44 "Error - the BC Strategy called \"" << bc.strategy() <<
45 "\" is not a valid identifier in the BCStrategyFactory. Either add " <<
46 "a valid implementation to the factory or fix the input file. The " <<
47 "relevant boundary condition is:\n\n" << bc << std::endl);
48
49 return bcs_tm;
50
51 }
52
53}
Stores input information for a boundary condition.
Definition Panzer_BC.hpp:48
std::string strategy() const
Returns the keyword used to construct a bc strategy.
BCFactoryComposite(const std::vector< Teuchos::RCP< panzer::BCStrategyFactory > > &factories)
Teuchos::RCP< panzer::BCStrategy_TemplateManager< panzer::Traits > > buildBCStrategy(const panzer::BC &bc, const Teuchos::RCP< panzer::GlobalData > &global_data) const
std::vector< Teuchos::RCP< panzer::BCStrategyFactory > > m_bc_strategy_factories