OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
simulation_selector.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-2015 by Energy Systems Design Laboratory, University of Alberta
6 //
7 // This software is distributed under the MIT license
8 // For more information, see the README file in /doc/LICENSE
9 //
10 // - Class: simulation_selector.h
11 // - Description: This class selects an openFCST application which will run
12 // - Developers: P. Dobson,
13 // M. Secanell,
14 // A. Koupaei,
15 // V. Zingan,
16 // M. Bhaiya
17 // - Id: $Id$
18 //
19 // ----------------------------------------------------------------------------
20 
21 #ifndef _SIMULATION_SELECTOR_H_
22 #define _SIMULATION_SELECTOR_H_
23 
24 #include <string>
25 #include <iostream>
26 
27 #include <boost/shared_ptr.hpp>
28 
30 #include "adaptive_refinement.h"
31 
32 #include "newton_basic.h"
33 #include "newton_w_line_search.h"
34 #include "newton_w_3pp.h"
35 
37 // FUEL CELL APPLICATIONS WITH DIFFUSION-FICKS-BASED TRANSPORT //
39 
40 #include "app_cathode.h"
41 #include "app_pemfc.h"
43 #include "app_thermal_test.h"
44 #include "app_test.h"
45 #include "app_diffusion.h"
46 #include "app_ohmic.h"
47 
49 // OTHER APPLICATIONS //
51 
52 #include "app_read_mesh.h"
53 
54 using namespace boost;
55 
67 template<int dim>
69 {
70 public:
71 
76 
81 
85  void declare_parameters(ParameterHandler& param) const;
86 
90  void initialize(ParameterHandler& param);
91 
106  boost::shared_ptr< FuelCell::ApplicationCore::OptimizationBlockMatrixApplication<dim> > select_application();
107 
111  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationWrapper > select_solver(FuelCell::ApplicationCore::OptimizationBlockMatrixApplication<dim>* app_lin);
112 
117  boost::shared_ptr< FuelCell::ApplicationCore::AdaptiveRefinement<dim> > select_solver_method(FuelCell::ApplicationCore::OptimizationBlockMatrixApplication<dim>* app_lin,
120 
121 protected:
122 
126  const std::string get_simulator_names() const
127  {
128  std::stringstream result;
129 
130  result << "cathode"
131  << " | "
132  << "cathode_MPL"
133  << " | "
134  << "cathodeNIT"
135  << " | "
136  << "MEA"
137  << " | "
138  << "meaNIT"
139  << " | "
140  << "test"
141  << " | "
142  << "thermalTest"
143  << " | "
144  << "test_mesh"
145  << " | "
146  << "diffusion"
147  << " | "
148  << "ohmic";
149 
150  return result.str();
151  }
152 
156  const std::string get_simulator_specifications() const
157  {
158  std::stringstream result;
159 
160  result << "Poiseuille"
161  << " | "
162  << "Couette"
163  << " | "
164  << "lid_driven_cavity_flow"
165  << " | "
166  << "backward_step"
167  << " | "
168  << "serpentine_incomp"
169  << " | "
170  << "square"
171  << " | "
172  << "sphere"
173  << " | "
174  << "DarcyCTest_incomp"
175  << " | "
176  << "ThInPlane_incomp"
177  << " | "
178  << "pore_network_incomp"
179  << " | "
180  << "serpentine_comp"
181  << " | "
182  << "DarcyCTest_comp"
183  << " | "
184  << "ThInPlane_comp"
185  << " | "
186  << "pore_network_comp"
187  << " | "
188  << "StefanTube"
189  << " | "
190  << "KerkhofGeboersTest_1"
191  << " | "
192  << "KerkhofGeboersTest_2"
193  << " | "
194  << "cathode_KG_2G"
195  << " | "
196  << "cathode_KG_3G"
197  << " | "
198  << "cathode_ch_KG_2G"
199  << " | "
200  << "cathode_ch_KG_3G";
201 
202  return result.str();
203  }
204 
208  const std::string get_solver_names() const
209  {
210  std::stringstream result;
211 
212  result << "Linear"
213  << " | "
214  << "NewtonBasic"
215  << " | "
216  << "NewtonLineSearch"
217  << " | "
218  << "Newton3pp";
219 
220  return result.str();
221  }
222 
226  const std::string get_solver_methods() const
227  {
228  std::stringstream result;
229 
230  result << "AdaptiveRefinement";
231 
232  return result.str();
233  }
234 
236  // DATA //
238 
242  std::string name_application;
243 
249  std::string app_specification;
250 
254  std::string name_solver;
255 
259  std::string name_solve_method;
260 };
261 
262 #endif
This class selects an openFCST application which will run.
Definition: simulation_selector.h:68
std::string app_specification
Variable storing the name of the concrete application to be solved from the broader class of applicat...
Definition: simulation_selector.h:249
const std::string get_simulator_specifications() const
This function forms the string of names.
Definition: simulation_selector.h:156
std::string name_application
The name of an application.
Definition: simulation_selector.h:242
const std::string get_solver_names() const
This function forms the string of names.
Definition: simulation_selector.h:208
std::string name_solve_method
The name of a solution method.
Definition: simulation_selector.h:259
std::string name_solver
The name of a solver.
Definition: simulation_selector.h:254
const std::string get_solver_methods() const
This function forms the string of names.
Definition: simulation_selector.h:226
This class implements either iterative or time-stepping wrapper of applications.
Definition: application_wrapper.h:40
const std::string get_simulator_names() const
This function forms the string of names.
Definition: simulation_selector.h:126
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:39
Application handling matrices and assembling the linear system to solve the sensitivity equations...
Definition: optimization_block_matrix_application.h:62