MAST
conservative_fluid_system_initialization.cpp
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 
21 // MAST includes
23 #include "base/nonlinear_system.h"
24 
25 
28  const std::string& prefix,
29  const libMesh::FEType& fe_type,
30  const unsigned int dim):
31 MAST::SystemInitialization(sys, prefix),
32 _dim(dim) {
33 
34  _vars.resize(dim+2);
35 
36  std::string nm = prefix + "_rho";
37  _vars[0] = sys.add_variable(nm, fe_type);
38 
39  nm = prefix + "_rhoux";
40  _vars[1] = sys.add_variable(nm, fe_type);
41 
42  if (dim > 1) {
43  nm = prefix + "_rhouy";
44  _vars[2] = sys.add_variable(nm, fe_type);
45  }
46 
47  if (dim > 2) {
48  nm = prefix + "_rhouz";
49  _vars[3] = sys.add_variable(nm, fe_type);
50  }
51 
52 
53  nm = prefix + "_rhoe";
54  _vars[dim+1] = sys.add_variable(nm, fe_type);
55 }
56 
57 
58 
61 
62 }
63 
64 
65 
66 
std::vector< unsigned int > _vars
This class implements a system for solution of nonlinear systems.
ConservativeFluidSystemInitialization(MAST::NonlinearSystem &sys, const std::string &prefix, const libMesh::FEType &fe_type, const unsigned int dim)