GRINS-0.8.0
single_variable.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_SINGLE_VARIABLE_H
26 #define GRINS_SINGLE_VARIABLE_H
27 
28 // GRINS
30 
31 namespace GRINS
32 {
34 
38  {
39  public:
40 
41  SingleVariable( const std::vector<std::string>& var_names,
42  const std::vector<VariableIndex>& var_indices,
43  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
44  : FEVariablesBase(var_names,var_indices, subdomain_ids )
45  {
46  if( var_names.size() != 1 )
47  libmesh_error_msg("ERROR: SingleVariable must only have a single name!");
48 
49  if(var_indices.size() != 1)
50  libmesh_error_msg("ERROR: SingleVariable must only have a single index!");
51  }
52 
54 
56  { libmesh_assert_equal_to( _vars.size(), 1 );
57  return this->_vars[0]; }
58 
59  private:
60 
62  };
63 
65  {
66  public:
67  PrimitiveTempFEVariables( const std::vector<std::string>& var_names,
68  const std::vector<VariableIndex>& var_indices,
69  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
70  : SingleVariable(var_names,var_indices,subdomain_ids)
71  {}
72 
74 
75  VariableIndex T() const
76  { return this->var(); }
77 
78  private:
79 
81  };
82 
84  {
85  public:
86  TurbulenceFEVariables( const std::vector<std::string>& var_names,
87  const std::vector<VariableIndex>& var_indices,
88  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
89  : SingleVariable(var_names,var_indices,subdomain_ids)
90  {}
91 
93 
94  VariableIndex nu() const
95  { return this->var(); }
96 
97  private:
98 
100  };
101 
103  {
104  public:
105  PressureFEVariable( const std::vector<std::string>& var_names,
106  const std::vector<VariableIndex>& var_indices,
107  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
108  : SingleVariable(var_names,var_indices,subdomain_ids)
109  {}
110 
112 
113  VariableIndex p() const
114  { return this->var(); }
115 
116  private:
117 
119  };
120 
122 
124  {
125  public:
126  ScalarVariable( const std::vector<std::string>& var_names,
127  const std::vector<VariableIndex>& var_indices,
128  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
129  : SingleVariable(var_names,var_indices,subdomain_ids)
130  {}
131 
133 
134  private:
135 
136  ScalarVariable();
137  };
138 
140  {
141  public:
142  ThermoPressureVariable( const std::vector<std::string>& var_names,
143  const std::vector<VariableIndex>& var_indices,
144  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
145  : ScalarVariable(var_names,var_indices,subdomain_ids)
146  {}
147 
149 
151  { return this->var(); }
152 
153  private:
154 
156  };
157 } // end namespace GRINS
158 
159 #endif // GRINS_SINGLE_VARIABLE_H
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
ScalarVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
ThermoPressureVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
VariableIndex T() const
PressureFEVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
Variables with a single component.
VariableIndex nu() const
VariableIndex var() const
GRINS namespace.
PrimitiveTempFEVariables(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
VariableIndex p() const
const std::set< libMesh::subdomain_id_type > & subdomain_ids() const
SingleVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
VariableIndex p0() const
Variables with a single SCALAR component.
std::vector< VariableIndex > _vars
TurbulenceFEVariables(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
const std::vector< VariableIndex > & var_indices() const

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