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 // M. Sabharwal
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>
30 
32 #include <solvers/newton_basic.h>
34 #include <solvers/newton_w_3pp.h>
35 #include <solvers/picard.h>
36 
38 // FUEL CELL APPLICATIONS WITH DIFFUSION-FICKS-BASED TRANSPORT //
40 
42 #include <applications/app_pemfc.h>
46 #include <applications/app_test.h>
48 #include <applications/app_ohmic.h>
49 
51 // OTHER APPLICATIONS //
53 
55 
56 using namespace boost;
57 
69 template<int dim>
71 {
72 public:
73 
77  SimulationSelector(boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
78  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
79 
84 
88  void declare_parameters(ParameterHandler& param) const;
89 
93  void initialize(ParameterHandler& param);
94 
109  boost::shared_ptr< FuelCell::ApplicationCore::OptimizationBlockMatrixApplication<dim> > select_application();
110 
114  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationWrapper > select_solver(FuelCell::ApplicationCore::OptimizationBlockMatrixApplication<dim>* app_lin);
115 
120  boost::shared_ptr< FuelCell::ApplicationCore::AdaptiveRefinement<dim> > select_solver_method(FuelCell::ApplicationCore::OptimizationBlockMatrixApplication<dim>* app_lin,
123 
124 protected:
125 
129  const std::string get_simulator_names() const
130  {
131  std::stringstream result;
132 
133  result << "cathode"
134  << " | "
135  << "anode"
136  << " | "
137  << "cathode_MPL"
138  << " | "
139  << "cathodeNIT"
140  << " | "
141  << "MEA"
142  << " | "
143  << "meaNIT"
144  << " | "
145  << "meaTwoPhaseSaturationNIT"
146  << " | "
147  << "test"
148  << " | "
149  << "thermalTest"
150  << " | "
151  << "test_mesh"
152  << " | "
153  << "diffusion"
154  << " | "
155  << "ohmic"
156  << " | "
157  << "meaTwoPhaseNITcapillary"
158  << " | "
159  << "Capillary_Testing";
160 
161  return result.str();
162  }
163 
167  const std::string get_simulator_specifications() const
168  {
169  std::stringstream result;
170 
171  result << "None"
172  << " | "
173  << "sphere"
174  << " | "
175  << "with_channel"
176  << " | "
177  << "without_channel"
178  << " | "
179  << "reaction"
180  << "|"
181  << "knudsen"
182  << "|"
183  << "reaction_and_knudsen";
184 
185  return result.str();
186  }
187 
191  const std::string get_nonlinear_solver_names() const
192  {
193  std::stringstream result;
194 
195  result << "None"
196  << " | "
197  << "NewtonBasic"
198  << " | "
199  << "NewtonLineSearch"
200  << " | "
201  << "Newton3pp"
202  << " | "
203  << "Picard";
204 
205  return result.str();
206  }
207 
211  const std::string get_refinement_methods() const
212  {
213  std::stringstream result;
214 
215  result << "AdaptiveRefinement";
216 
217  return result.str();
218  }
219 
220 
222  // DATA //
224 
228  boost::shared_ptr <FuelCell::ApplicationCore::ApplicationData> data;
229 
233  std::string name_application;
234 
240  std::string app_specification;
241 
246 
251 };
252 
253 #endif
std::string name_nonlinear_solver
The name of a nonlinear solver.
Definition: simulation_selector.h:245
This class selects an openFCST application which will run.
Definition: simulation_selector.h:70
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:240
const std::string get_simulator_specifications() const
This function forms the string of names.
Definition: simulation_selector.h:167
std::string name_application
Name of application.
Definition: simulation_selector.h:233
This class implements either iterative or time-stepping wrapper of applications.
Definition: application_wrapper.h:39
std::string name_refinement_method
Name of refinement method.
Definition: simulation_selector.h:250
const std::string get_simulator_names() const
This function forms the string of names.
Definition: simulation_selector.h:129
const std::string get_refinement_methods() const
This function forms the string of names.
Definition: simulation_selector.h:211
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
Application handling matrices and assembling the linear system to solve the sensitivity equations...
Definition: optimization_block_matrix_application.h:49
boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data
Data structure storing information to be shared between applications.
Definition: simulation_selector.h:228
const std::string get_nonlinear_solver_names() const
This function forms the string of names.
Definition: simulation_selector.h:191