Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_BCStrategy_Factory_Defines.hpp
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 
11 #include <iostream>
12 #include "Teuchos_RCP.hpp"
13 #include "Panzer_BC.hpp"
15 
16 #undef PANZER_DECLARE_BCSTRATEGY_TEMPLATE_BUILDER
17 #define PANZER_DECLARE_BCSTRATEGY_TEMPLATE_BUILDER(fClass, fType) \
18  \
19  struct fType ## _TemplateBuilder \
20  { \
21  const panzer::BC& m_bc; \
22  const Teuchos::RCP<panzer::GlobalData> m_global_data; \
23  fType ## _TemplateBuilder( \
24  const panzer::BC& bc, \
25  const Teuchos::RCP<panzer::GlobalData>& global_data) \
26  : \
27  m_bc(bc), \
28  m_global_data(global_data) \
29  { \
30  } \
31  \
32  template<typename EvalT> \
33  Teuchos::RCP<panzer::BCStrategyBase> build() const \
34  { \
35  fClass<EvalT>* ptr = new fClass<EvalT>(m_bc, m_global_data); \
36  return Teuchos::rcp(ptr); \
37  } \
38  \
39  };
40 
41 #define PANZER_DECLARE_BCSTRATEGY_TEMPLATE_BUILDER_EXTRA(fClass, fType, \
42  extraSteps) \
43  \
44  struct fType ## _TemplateBuilder \
45  { \
46  const panzer::BC& m_bc; \
47  const Teuchos::RCP<panzer::GlobalData> m_global_data; \
48  fType ## _TemplateBuilder( \
49  const panzer::BC& bc, \
50  const Teuchos::RCP<panzer::GlobalData>& global_data) \
51  : \
52  m_bc(bc), \
53  m_global_data(global_data) \
54  { \
55  } \
56  \
57  template<typename EvalT> \
58  Teuchos::RCP<panzer::BCStrategyBase> build() const \
59  { \
60  fClass<EvalT>* ptr = new fClass<EvalT>(m_bc, m_global_data); \
61  { \
62  extraSteps \
63  } \
64  return Teuchos::rcp(ptr); \
65  } \
66  \
67  };
68 
69 #undef PANZER_BUILD_BCSTRATEGY_OBJECTS
70 #define PANZER_BUILD_BCSTRATEGY_OBJECTS(key, fType) \
71  if (bc.strategy() == key) \
72  { \
73  fType ## _TemplateBuilder builder(bc, global_data); \
74  bcs_tm->buildObjects(builder); \
75  found = true; \
76  }