GRINS-0.6.0
primitive_flow_variables.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 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 // This class
27 
28 // libMesh
29 #include "libmesh/getpot.h"
30 #include "libmesh/fem_system.h"
31 
32 // GRINS
34 
35 namespace GRINS
36 {
38  : _u_var(invalid_var_index),
39  _v_var(invalid_var_index),
40  _w_var(invalid_var_index),
41  _p_var(invalid_var_index),
42  _u_var_name( input("Physics/VariableNames/u_velocity", u_var_name_default ) ),
43  _v_var_name( input("Physics/VariableNames/v_velocity", v_var_name_default ) ),
44  _w_var_name( input("Physics/VariableNames/w_velocity", w_var_name_default ) ),
45  _p_var_name( input("Physics/VariableNames/pressure", p_var_name_default ) )
46  {
47  return;
48  }
49 
51  {
52  return;
53  }
54 
55  void PrimitiveFlowVariables::init( libMesh::FEMSystem* system )
56  {
57  libmesh_assert( system->has_variable( _u_var_name ) );
58  libmesh_assert( system->has_variable( _v_var_name ) );
59  libmesh_assert( system->has_variable( _p_var_name ) );
60 
61  _u_var = system->variable_number( _u_var_name );
62  _v_var = system->variable_number( _v_var_name );
63 
64  if ( system->get_mesh().mesh_dimension() == 3)
65  {
66  libmesh_assert( system->has_variable( _w_var_name ) );
67  _w_var = system->variable_number( _w_var_name );
68  }
69 
70  _p_var = system->variable_number( _p_var_name );
71 
72  return;
73  }
74 
75 } // end namespace GRINS
const std::string p_var_name_default
pressure
const unsigned int invalid_var_index
Invalid varaible index id.
Definition: var_typedefs.h:48
const std::string v_var_name_default
y-velocity
GRINS namespace.
virtual void init(libMesh::FEMSystem *system)
VariableIndex _u_var
Indices for each (owned) variable;.
std::string _u_var_name
Names of each (owned) variable in the system.
const std::string u_var_name_default
Default physics variable names.
const std::string w_var_name_default
z-velocity

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1