OpenWAM
OpenWAM.cpp
1 /*--------------------------------------------------------------------------------*\
2 |==========================|
3  |\\ /\ /\ // O pen | OpenWAM: The Open Source 1D Gas-Dynamic Code
4  | \\ | X | // W ave |
5  | \\ \/_\/ // A ction | CMT-Motores Termicos / Universidad Politecnica Valencia
6  | \\/ \// M odel |
7  ----------------------------------------------------------------------------------
8  | License
9  |
10  | This file is part of OpenWAM.
11  |
12  | OpenWAM is free software: you can redistribute it and/or modify
13  | it under the terms of the GNU General Public License as published by
14  | the Free Software Foundation, either version 3 of the License, or
15  | (at your option) any later version.
16  |
17  | OpenWAM is distributed in the hope that it will be useful,
18  | but WITHOUT ANY WARRANTY; without even the implied warranty of
19  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  | GNU General Public License for more details.
21  |
22  | You should have received a copy of the GNU General Public License
23  | along with OpenWAM. If not, see <http://www.gnu.org/licenses/>.
24  |
25  \*--------------------------------------------------------------------------------*/
26 
27 // ---------------------------------------------------------------------------
28 #ifdef __BORLANDC__
29 #include <vcl.h>
30 #endif
31 
32 #pragma hdrstop
33 
34 #include "TOpenWAM.h"
35 #include "labels.hpp"
36 
37 // #include <tchar.h>
38 // ---------------------------------------------------------------------------
39 
40 #pragma argsused
41 
42 TOpenWAM* Aplication = NULL;
43 
44 int main(int argc, char *argv[]) {
45 
46  init_labels();
47 
48  Aplication = new TOpenWAM();
49 
50  Aplication->ReadInputData(argv[1]);
51 
52  Aplication->ConnectFlowElements();
53 
54  Aplication->ConnectControlElements();
55 
56  Aplication->InitializeParameters();
57 
58  Aplication->InitializeOutput();
59 
60  Aplication->ProgressBegin();
61 
62  if(Aplication->IsIndependent()) {
63 
64  do {
65 
66  Aplication->Progress();
67 
68  Aplication->DetermineTimeStepIndependent();
69 
70  Aplication->NewEngineCycle();
71 
72  Aplication->CalculateFlowIndependent();
73 
74  Aplication->ManageOutput();
75 
76  } while(!Aplication->CalculationEnd());
77  } else {
78  do {
79 
80  Aplication->Progress();
81 
82  Aplication->DetermineTimeStepCommon();
83 
84  Aplication->NewEngineCycle();
85 
86  Aplication->CalculateFlowCommon();
87 
88  Aplication->ManageOutput();
89 
90  } while(!Aplication->CalculationEnd());
91  }
92 
93  Aplication->GeneralOutput();
94 
95  Aplication->ProgressEnd();
96 
97  delete Aplication;
98 
99  return 0;
100 
101 }
102 // ---------------------------------------------------------------------------
TOpenWAM
Definition: TOpenWAM.h:148
labels.hpp
init_labels
void init_labels()
Initialises the labels.
Definition: labels.cpp:35