GRINS-0.8.0
dirichlet_bc_factory_function_old_style_base.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef GRINS_DIRICHLET_BC_FACTORY_FUNCTION_OLD_STYLE_BASE_H
26 #define GRINS_DIRICHLET_BC_FACTORY_FUNCTION_OLD_STYLE_BASE_H
27 
28 // GRINS
30 
31 namespace GRINS
32 {
33  template<typename FunctionType>
35  {
36  public:
37 
38  DirichletBCFactoryFunctionOldStyleBase( const std::string& bc_type_name )
39  : DirichletBCFactoryFunctionBase<FunctionType>(bc_type_name)
40  {}
41 
43 
45 
46  static void set_value_var_old_style( const std::string& value_var )
47  { _value_var_old_style = value_var; }
48 
50 
51  static void set_value_index_old_style( unsigned int idx )
52  { _value_idx_old_style = idx; }
53 
54  static void set_var_names_old_style( const std::vector<std::string>& var_names )
55  { _var_names_old_style = &var_names; }
56 
57  protected:
58 
60  virtual void check_state() const;
61 
63  virtual void reset_state();
64 
65  virtual const std::vector<std::string>& get_var_names() const
66  { return *(this->_var_names_old_style); }
67 
68  static std::string _value_var_old_style;
69 
70  static unsigned int _value_idx_old_style;
71 
72  static const std::vector<std::string>* _var_names_old_style;
73 
74  };
75 
76  template<typename FunctionType>
77  inline
79  {
81 
82  if( this->_value_var_old_style == std::string("DIE!") )
83  libmesh_error_msg("ERROR: must call set_value_var_old_style() before building boundary condition!");
84 
85  if( this->_value_idx_old_style == libMesh::invalid_uint )
86  libmesh_error_msg("ERROR: must call set_value_index_old_style() before building boundary condition!");
87 
88  if( !this->_var_names_old_style )
89  libmesh_error_msg("ERROR: must call set_var_names_old_style() before building boundary condition!");
90  }
91 
92  template<typename FunctionType>
93  inline
95  {
97  this->_value_var_old_style = std::string("DIE!");
98  this->_value_idx_old_style = libMesh::invalid_uint;
99  this->_var_names_old_style = NULL;
100  }
101 
102 } // end namespace GRINS
103 
104 #endif // GRINS_DIRICHLET_BC_FACTORY_FUNCTION_OLD_STYLE_BASE_H
virtual void reset_state()
Helper function to redue code duplication.
static void set_var_names_old_style(const std::vector< std::string > &var_names)
static void set_value_var_old_style(const std::string &value_var)
Input variable for parsing old style.
virtual const std::vector< std::string > & get_var_names() const
Helper function that can be overridded in subclasses.
GRINS namespace.
static void set_value_index_old_style(unsigned int idx)
Input variable index for parsing old style.
virtual void check_state() const
Helper function to reduce code duplication.

Generated on Tue Dec 19 2017 12:47:27 for GRINS-0.8.0 by  doxygen 1.8.9.1