GRINS-0.8.0
multicomponent_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_VARIABLE_H
26 #define GRINS_MULTICOMPONENT_VARIABLE_H
27 
28 // GRINS
30 
31 namespace GRINS
32 {
34 
36  {
37  public:
38 
39  MulticomponentVariable( const std::vector<std::string>& var_names,
40  const std::vector<VariableIndex>& var_indices,
41  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
42  : FEVariablesBase(var_names,var_indices,subdomain_ids)
43  {}
44 
46 
48  unsigned int dim() const
49  { return _vars.size(); }
50 
51  VariableIndex idx_from_component( unsigned int component ) const
52  { libmesh_assert_less( component, _vars.size() );
53  return _vars[component]; }
54 
55  private:
56 
58  };
59 
61  {
62  public:
63 
64  SpeciesMassFractionsVariable( const std::vector<std::string>& var_names,
65  const std::vector<VariableIndex>& var_indices,
66  const std::string& prefix,
67  const std::string& material,
68  const std::set<libMesh::subdomain_id_type>& subdomain_ids )
69  : MulticomponentVariable(var_names,var_indices,subdomain_ids),
70  _prefix(prefix),
71  _material(material)
72  {}
73 
75 
76  unsigned int n_species() const
77  { return this->dim(); }
78 
79  VariableIndex species( unsigned int species ) const
80  { return this->idx_from_component(species); }
81 
82  const std::string& material() const
83  { return _material; }
84 
85  const std::string& prefix() const
86  { return _prefix; }
87 
88  private:
89 
91 
92  std::string _prefix;
93 
94  std::string _material;
95 
96  };
97 
98 } // end namespace GRINS
99 
100 #endif // GRINS_MULTICOMPONENT_VARIABLE_H
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
VariableIndex species(unsigned int species) const
VariableIndex idx_from_component(unsigned int component) const
Variables that may components, but are not intended to be vectors.
GRINS namespace.
SpeciesMassFractionsVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::string &prefix, const std::string &material, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
const std::set< libMesh::subdomain_id_type > & subdomain_ids() const
unsigned int dim() const
Number of components.
MulticomponentVariable(const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
std::vector< VariableIndex > _vars
const std::string & material() const
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