Unstruct2D  1.0
Solution of 2-D Euler- and Navier-Stokes Equations on Unstructured Triangular Grids
 All Classes Files Functions Variables Typedefs Enumerations Macros
userInput.h
Go to the documentation of this file.
1 //*****************************************************************************
6 //
7 // (c) J. Blazek, CFD Consulting & Analysis, www.cfd-ca.de
8 // Created February 15, 2014
9 // Last modification: June 30, 2014
10 //
11 //=============================================================================
12 //
13 // This program is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU General Public License
15 // as published by the Free Software Foundation; either version 2
16 // of the License, or (at your option) any later version.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 //
27 //*****************************************************************************
28 
29 #ifndef USERINPUT_H_INCLUDED
30 #define USERINPUT_H_INCLUDED
31 
32 #include <fstream>
33 #include <iostream>
34 #include <iomanip>
35 #include <string>
36 #include "defs.h"
37 #include "solver.h"
38 #include "output.h"
39 
40 using std::cout;
41 using std::endl;
42 using std::left;
43 using std::scientific;
44 using std::setprecision;
45 using std::setfill;
46 using std::setw;
47 using std::ifstream;
48 using std::string;
49 
53 class UserInput
54 {
55 public:
56 
57  static void Read( const char *fileName, Solver &solver, Output &output );
58  static void Print( const Solver &solver, const Output &output );
59 
60 private:
61 
62  static void ReadVector( ifstream &stream, int nVals, bool vect[] );
63  static void ReadVector( ifstream &stream, int nVals, REAL vect[] );
64 
70  static void PrintValue( int val, const char *txt )
71  {
72  cout << left << " " << setw(13) << setfill(' ')
73  << val << "# " << txt << endl;
74  }
75  static void PrintValue( REAL val, const char *txt )
76  {
77  cout << left << scientific << setprecision(4) << setw(14) << setfill(' ')
78  << val << "# " << txt << endl;
79  }
80  static void PrintValue( string val, const char *txt )
81  {
82  cout << left << setw(14) << setfill(' ')
83  << val << "# " << txt << endl;
84  }
85 };
86 
87 #endif // USERINPUT_H_INCLUDED
static void Print(const Solver &solver, const Output &output)
Definition: userInput.cpp:203
Definition: output.h:45
static void Read(const char *fileName, Solver &solver, Output &output)
Definition: userInput.cpp:44
Definition: userInput.h:53
Definition: solver.h:46
double REAL
Definition: defs.h:58