GRINS-0.8.0
multi_component_vector_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_MULTICOMPONENT_VECTOR_VARIABLE_H
26 #define GRINS_MULTICOMPONENT_VECTOR_VARIABLE_H
27 
28 // GRINS
30 
31 namespace GRINS
32 {
34 
38  {
39  public:
40 
41  MultcomponentVectorVariable( 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  _u_idx(0),
46  _v_idx(1),
47  _w_idx(2)
48  {}
49 
51 
53  unsigned int dim() const
54  { return _vars.size(); }
55 
56  VariableIndex u() const
57  { return this->_vars[_u_idx]; }
58 
59  VariableIndex v() const
60  { return this->_vars[_v_idx]; }
61 
62  VariableIndex w() const
63  { return this->_vars[_w_idx]; }
64 
65  protected:
66 
67  unsigned int _u_idx, _v_idx, _w_idx;
68 
69  private:
70 
72  };
73 
75  {
76  public:
77 
78  DisplacementVariable( const std::vector<std::string>& var_names,
79  const std::vector<VariableIndex>& var_indices,
80  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
81  : MultcomponentVectorVariable(var_names,var_indices,subdomain_ids)
82  {}
83 
85  };
86 
88  {
89  public:
90 
91  VelocityVariable( const std::vector<std::string>& var_names,
92  const std::vector<VariableIndex>& var_indices,
93  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
94  : MultcomponentVectorVariable(var_names,var_indices,subdomain_ids)
95  {}
96 
98  };
99 
100 } // end namespace GRINS
101 
102 #endif // GRINS_MULTICOMPONENT_VECTOR_VARIABLE_H
VelocityVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
GRINS namespace.
DisplacementVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
const std::set< libMesh::subdomain_id_type > & subdomain_ids() const
MultcomponentVectorVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
unsigned int dim() const
Number of components.
Variables that are effectively vectors.
std::vector< VariableIndex > _vars
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