GRINS-0.7.0
displacement_fe_variables.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 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 
26 #ifndef GRINS_DISPLACEMENT_FE_VARIABLES_H
27 #define GRINS_DISPLACEMENT_FE_VARIABLES_H
28 
29 // GRINS
32 
33 namespace GRINS
34 {
36  {
37  public:
38 
40 
43  DisplacementFEVariables( const GetPot& input,
44  const std::string& physics_name,
45  bool is_2D, bool is_3D,
46  bool is_constraint_var = false );
47 
49 
51  virtual void init( libMesh::FEMSystem* system );
52 
53  bool have_v() const;
54  bool have_w() const;
55 
56  VariableIndex u() const;
57  VariableIndex v() const;
58  VariableIndex w() const;
59 
60  const std::string& u_name() const;
61  const std::string& v_name() const;
62  const std::string& w_name() const;
63 
64  private:
65 
66  std::string subsection() const
68 
69  std::vector<std::string> old_var_names()
70  {
71  std::vector<std::string> var_names(3);
72  var_names[0] = "u_displacment";
73  var_names[1] = "v_displacment";
74  var_names[2] = "w_displacment";
75  return var_names;
76  }
77 
78  std::vector<std::string> default_names()
79  {
80  std::vector<std::string> var_names(3);
81  var_names[0] = "u";
82  var_names[1] = "v";
83  var_names[2] = "w";
84  return var_names;
85  }
86 
88 
89  bool _have_v;
90  bool _have_w;
91 
92  unsigned int _u_idx, _v_idx, _w_idx;
93 
95  bool _is_2D;
96 
98  bool _is_3D;
99 
100  };
101 
102  inline
104  {
105  return this->_vars[_u_idx];
106  }
107 
108  inline
110  {
111  libmesh_assert(_have_v);
112  return this->_vars[_v_idx];
113  }
114 
115  inline
117  {
118  libmesh_assert(_have_w);
119  return this->_vars[_w_idx];
120  }
121 
122  inline
124  {
125  return _have_v;
126  }
127 
128  inline
130  {
131  return _have_w;
132  }
133 
134  inline
135  const std::string& DisplacementFEVariables::u_name() const
136  {
137  return this->_var_names[_u_idx];
138  }
139 
140  inline
141  const std::string& DisplacementFEVariables::v_name() const
142  {
143  return this->_var_names[_v_idx];
144  }
145 
146  inline
147  const std::string& DisplacementFEVariables::w_name() const
148  {
149  return this->_var_names[_w_idx];
150  }
151 
152 } // end namespace GRINS
153 
154 #endif // GRINS_DISPLACEMENT_FE_VARIABLES_H
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
std::vector< std::string > old_var_names()
static std::string displacement_section()
Base class for variables with multiple components that all have the same FEType.
bool _is_2D
Tracks whether this is a 2D problem.
GRINS namespace.
const std::string & w_name() const
bool _is_3D
Tracks whether this is a 3D problem.
std::vector< std::string > default_names()
const std::string & v_name() const
virtual void init(libMesh::FEMSystem *system)
Initialize System variables.
const std::string & u_name() const
std::vector< std::string > _var_names
bool is_constraint_var() const
std::vector< VariableIndex > _vars

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10