OpenFCST: The open-source Fuel Cell Simulation Toolbox
|
This class is used to output data or to initialize and launch simulations. More...
#include <simulator_builder.h>
Public Member Functions | |
Constructors, destructor, and initalization | |
SimulatorBuilder () | |
Constructor. More... | |
~SimulatorBuilder () | |
Destructor. More... | |
void | parse_inputs (int argc, char *argv[]) |
Member function used to read in the command line and initialize the necessary data. More... | |
void | scan () |
Member function used to call the declaration of the parameters, initialize data and set the application and solver objects to those specified in the input file. More... | |
Execute | |
virtual void | run () |
Run the simulation. More... | |
Protected Member Functions | |
Initialization (called by scan()) | |
void | declare_parameters (ParameterHandler ¶m) const |
Declare all necessary parameters to read the input files. More... | |
void | initialize (ParameterHandler ¶m) |
Initialize the local variables declared by the parameter handler. More... | |
void | open_logfile (const std::string &) |
Member function used to attach the deal.II logfile to the application and provide the name of the file. More... | |
Execution routines (called by run) | |
void | run_optimization () |
Set up the required optimization objects (i.e. More... | |
void | run_test () |
This routine is mainly used for testing single member functions in classes. More... | |
XML converters: | |
void | output_default_main () |
Outputs the SimulatorBuilder parameter options to file "main.xml" in current working directory. More... | |
void | output_default_other (std::string main_file) |
Outputs the AdaptiveRefinement and DakotaApplication parameters options to files "data.xml" and "opt.xml" in current working directory. More... | |
void | convert_file (std::string main_file) |
Opens project specified by main file. More... | |
Print info | |
void | print_logo () const |
Member function that is used to print information about the program. More... | |
void | print_timer_info () const |
Print timer info. More... | |
Protected Attributes | |
Constant parameters | |
const std::string | program_name |
Local varible for the program name. More... | |
const std::string | program_version |
Local variable for the program version. More... | |
Objects storing data read from all data files, linear applications and ApplicationWrapper applications | |
ParameterHandler | param |
Parameter handler object that will be used to store all input data for the application. More... | |
boost::shared_ptr < FuelCell::ApplicationCore::ApplicationData > | data |
Data structure storing information to be shared between applications. More... | |
boost::shared_ptr < FuelCell::ApplicationCore::OptimizationBlockMatrixApplication < dim > > | app_lin |
Pointer where linear application is stored. More... | |
boost::shared_ptr < FuelCell::ApplicationCore::ApplicationWrapper > | newton |
Pointer to the non-linear solver. More... | |
boost::shared_ptr < FuelCell::ApplicationCore::AdaptiveRefinement < dim > > | solver |
Pointer to a solver application which applies adaptive refinement to the grid. More... | |
boost::shared_ptr < SimulationSelector< dim > > | sim_selector |
Object which stores the name of the application and solver Allows the user to select the application and set objects to the empty pointers. More... | |
File names and general options: | |
std::string | input_file |
Stores the name of the input file with the application selector data. More... | |
boost::shared_ptr< std::ofstream > | log_file |
Stores a pointer to the log file object. More... | |
std::string | simulator_parameter_file_name |
Stores the name of the parameter file containing the physical data for the simulation. More... | |
std::string | analysis_type |
Decision varible for selecting the type of analysis. More... | |
bool | save_transfer_files |
Set to true if you want to keep the mesh and solution from the simulation. More... | |
Auxiliary data: | |
Timer | timer |
Object used to calculate the CPU and Run time for the simulation. More... | |
Dakota dependent parameters | |
bool | dakota_use |
Variable set in parse_inputs which determines whether the program is being called from DAKOTA. More... | |
bool | dakota_direct |
Decision varible for using the direct dakota interface. More... | |
std::string | optimization_parameter_file_name |
Stores the name of the parameter file containing the optimization data. More... | |
std::string | dakota_results |
Variable set in parse_inputs which stores the name of the results (responses) file if the simulation is being called from DAKOTA. More... | |
std::string | dakota_parameters |
Variable set in parse_inputs which stores the name of the parameter file if the simulation is being called from DAKOTA. More... | |
Polarization curve parameters: | |
FuelCell::PolarizationCurve< dim > | curve |
Polarization curve object. More... | |
Parametric study section: | |
FuelCell::ParametricStudy< dim > | param_study |
Polarization curve object. More... | |
This class is used to output data or to initialize and launch simulations.
It reads from the command line either an input file or any other flag and acts accordingly. Based on the flags it will print instructions to screen or setup a simulation.
and the concept of sequential applications and simplified parameter study without Dakota by
SimulatorBuilder< dim >::SimulatorBuilder | ( | ) |
Constructor.
SimulatorBuilder< dim >::~SimulatorBuilder | ( | ) |
Destructor.
|
protected |
Opens project specified by main file.
main_file | and outputs corresponding "main" "data" and "opt" in current working directory. |
Possible options for conversion are xml2prm and prm2xml.
|
protected |
Declare all necessary parameters to read the input files.
The following parameters are set here:
|
protected |
Initialize the local variables declared by the parameter handler.
|
protected |
Member function used to attach the deal.II logfile to the application and provide the name of the file.
If no name is given, then the machine hostname is used.
|
protected |
Outputs the SimulatorBuilder parameter options to file "main.xml" in current working directory.
|
protected |
Outputs the AdaptiveRefinement and DakotaApplication parameters options to files "data.xml" and "opt.xml" in current working directory.
void SimulatorBuilder< dim >::parse_inputs | ( | int | argc, |
char * | argv[] | ||
) |
Member function used to read in the command line and initialize the necessary data.
|
protected |
Member function that is used to print information about the program.
The info in print logo appears everytime the program is executed.
|
protected |
Print timer
info.
|
virtual |
Run the simulation.
Determines whether optimization is being used and runs a single simulation or optimization routines
|
protected |
Set up the required optimization objects (i.e.
It must be a child of Dakota::DirectApplicInterface
http://dakota.sandia.gov/docs/dakota/5.2/html-dev/DakLibrary.html
|
protected |
This routine is mainly used for testing single member functions in classes.
It will run in isolation from the main simulation framework, so that you are not solving a finite element problem.
void SimulatorBuilder< dim >::scan | ( | ) |
Member function used to call the declaration of the parameters, initialize data and set the application and solver objects to those specified in the input file.
|
protected |
Decision varible for selecting the type of analysis.
This variable is set in the input file in:
Possible options are:
|
protected |
Pointer where linear application is stored.
|
protected |
Polarization curve object.
|
protected |
Decision varible for using the direct dakota interface.
|
protected |
Variable set in parse_inputs which stores the name of the parameter file if the simulation is being called from DAKOTA.
|
protected |
Variable set in parse_inputs which stores the name of the results (responses) file if the simulation is being called from DAKOTA.
|
protected |
Variable set in parse_inputs which determines whether the program is being called from DAKOTA.
|
protected |
Data structure storing information to be shared between applications.
|
protected |
Stores the name of the input file with the application selector data.
This value is specified as the argument when you launch openFCST.
|
protected |
Stores a pointer to the log file object.
This value is specified in the main.xml file under section
|
protected |
Pointer to the non-linear solver.
|
protected |
Stores the name of the parameter file containing the optimization data.
|
protected |
Parameter handler object that will be used to store all input data for the application.
|
protected |
Polarization curve object.
|
protected |
Local varible for the program name.
|
protected |
Local variable for the program version.
|
protected |
Set to true if you want to keep the mesh and solution from the simulation.
|
protected |
Object which stores the name of the application and solver Allows the user to select the application and set objects to the empty pointers.
|
protected |
Stores the name of the parameter file containing the physical data for the simulation.
I.e. Fuel cell data.
|
protected |
Pointer to a solver application which applies adaptive refinement to the grid.
|
protected |
Object used to calculate the CPU and Run time for the simulation.