Unstruct2D  1.0
Solution of 2-D Euler- and Navier-Stokes Equations on Unstructured Triangular Grids
 All Classes Files Functions Variables Typedefs Enumerations Macros
output.h
Go to the documentation of this file.
1 //*****************************************************************************
7 //
8 // (c) J. Blazek, CFD Consulting & Analysis, www.cfd-ca.de
9 // Created February 15, 2014
10 // Last modification: July 5, 2014
11 //
12 //=============================================================================
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 //
28 //*****************************************************************************
29 
30 #ifndef OUTPUT_H_INCLUDED
31 #define OUTPUT_H_INCLUDED
32 
33 #include <fstream>
34 #include <iostream>
35 #include <string>
36 #include "defs.h"
37 #include "bndConds.h"
38 #include "spaceDiscr.h"
39 
45 class Output
46 {
47 public:
48 
49  static const int MXQUANT =13,
50  MXQFIELD=11;
53  // variables
54 
55  std::string title,
56  fnameFlow,
57  fnameSurf,
58  fnameConv;
59  bool varOn[MXQUANT];
61  // functions
62 
63  Output();
64  void Flowfield( const Geometry &geometry, const FluidProps &fluidProps,
65  const BndConds &bndConds, int iter ) const;
66  void Surfaces( const Geometry &geometry, const FluidProps &fluidProps,
67  const BndConds &bndConds, const SpaceDiscr &spaceDiscr, int iter ) const;
68  void OpenConvergence();
69  void WriteConvergence( int iter, REAL drho, REAL drmax, int idrmax,
70  REAL cl, REAL cd, REAL cm, REAL mflow, REAL mfratio );
71  void CloseConvergence();
72 
77  std::string GetVarName( int index ) const { return varName[MAX(0,MIN(index,MXQUANT-1))]; }
78 
83  void StoreFlowType( FlowType flowType )
84  { external = (flowType==FlowType::External); }
85 
86 private:
87 
88  bool external;
89  std::string varName[MXQUANT];
90  std::ofstream convStream;
92  // functions
93 
94  Output( const Output &output ); // override default copy constructor
95  Output & operator = (const Output &output); // and assignment operator
96 };
97 
98 #endif // OUTPUT_H_INCLUDED
static const int MXQFIELD
Definition: output.h:50
void Surfaces(const Geometry &geometry, const FluidProps &fluidProps, const BndConds &bndConds, const SpaceDiscr &spaceDiscr, int iter) const
Definition: outputSurfaces.cpp:45
Definition: spaceDiscr.h:42
Definition: fluidProps.h:39
void WriteConvergence(int iter, REAL drho, REAL drmax, int idrmax, REAL cl, REAL cd, REAL cm, REAL mflow, REAL mfratio)
Definition: outputConvergence.cpp:94
Output()
Definition: output.cpp:33
void StoreFlowType(FlowType flowType)
Definition: output.h:83
bool varOn[MXQUANT]
Definition: output.h:59
std::string title
Definition: output.h:55
Definition: bndConds.h:42
Definition: output.h:45
void CloseConvergence()
Definition: outputConvergence.cpp:122
std::string fnameConv
Definition: output.h:55
Definition: geometry.h:41
FlowType
Types of fluid flow.
Definition: defs.h:36
void Flowfield(const Geometry &geometry, const FluidProps &fluidProps, const BndConds &bndConds, int iter) const
Definition: outputFlowfield.cpp:44
void OpenConvergence()
Definition: outputConvergence.cpp:38
std::string fnameFlow
Definition: output.h:55
double REAL
Definition: defs.h:58
std::string GetVarName(int index) const
Definition: output.h:77
static const int MXQUANT
Definition: output.h:49
std::string fnameSurf
Definition: output.h:55