Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_EquationSet_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 
13 #include "Panzer_CellData.hpp"
14 #include "Panzer_GlobalData.hpp"
15 #include <sstream>
16 
17 namespace panzer {
18 
20  m_factories(factories)
21  { }
22 
25  const int& default_integration_rule,
26  const panzer::CellData& cell_data,
27  const Teuchos::RCP<panzer::GlobalData>& global_data,
28  const bool build_transient_support) const
29  {
31 
32 
33  for (std::vector<Teuchos::RCP<panzer::EquationSetFactory> >::const_iterator factory = m_factories.begin();
34  factory != m_factories.end(); ++factory) {
35  eq_set = (*factory)->buildEquationSet(input_plist,default_integration_rule,cell_data,global_data,build_transient_support);
36 
37  if (nonnull(eq_set))
38  break;
39  }
40 
41  std::ostringstream os;
42  os << "The equation set factory failed to build and equation set for the following input parameter list. Please correct the input list:\n";
43  input_plist->print(os);
44  TEUCHOS_TEST_FOR_EXCEPTION(is_null(eq_set), std::logic_error,os.str());
45 
46  return eq_set;
47  }
48 
49 }
50 
bool is_null(const boost::shared_ptr< T > &p)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
std::vector< Teuchos::RCP< panzer::EquationSetFactory > > m_factories
Data for determining cell topology and dimensionality.
EquationSet_FactoryComposite(const std::vector< Teuchos::RCP< panzer::EquationSetFactory > > &factories)
Teuchos::RCP< panzer::EquationSet_TemplateManager< panzer::Traits > > buildEquationSet(const Teuchos::RCP< Teuchos::ParameterList > &input_plist, const int &default_integration_rule, const panzer::CellData &cell_data, const Teuchos::RCP< panzer::GlobalData > &global_data, const bool build_transient_support) const
bool nonnull(const boost::shared_ptr< T > &p)