OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dakota_interface.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 // $Id: dakota_interface.h 2605 2014-08-15 03:36:44Z secanell $
3 //
4 // Copyright (C) 2006 by Marc Secanell
5 //
6 // This file is subject to QPL and may not be distributed
7 // without copyright and license information. Please refer
8 // to the file deal.II/doc/license.html for the text and
9 // further information on this license.
10 //
11 //---------------------------------------------------------------------------
12 #ifndef dakota_interface_h
13 #define dakota_interface_h
14 
15 //deal.II:
16 #include <deal.II/base/parameter_handler.h>
17 
18 // Fuel Cells:
20 #include <utils/fcst_utilities.h>
21 
22 //STL libraries:
23 #include<string>
24 #include<fstream>
25 #include<iostream>
26 #include<vector>
27 
28 namespace SIM
29 {
37  template <int dim>
39  {
40  public:
47  DakotaInterface(const std::string input_file,
48  ParameterHandler& param,
49  const std::string dakota_parameters,
50  const std::string dakota_results,
53 
56  {
57  };
58 
62  void run();
63 
64  private:
71  void declare_parameters(ParameterHandler& param);
72 
77  void initialize(ParameterHandler& param);
78 
83  void DakotaReadIn(const std::string dakota_parameters,
85  ParameterHandler &param);
86 
90  void DakotaWriteOut(const std::string dakota_results,
91  const std::vector<double>& responses,
92  const std::vector<std::vector<double> >& dresponses_dl);
93 
97  bool gradients;
101  unsigned int n_ref;
102 
106  std::string dakota_version;
107 
111  const std::string input_file;
112 
116  const std::string dakota_parameters;
117 
121  const std::string dakota_results;
122 
126  std::vector<int> ASV;
127 
132 
137 
139  ParameterHandler *param;
140  };
141 
142 }
143 
144 #endif
FuelCell::ApplicationCore::ApplicationWrapper * app
Pointer to nonlinear application.
Definition: dakota_interface.h:136
const std::string dakota_results
Name of the results file to DAKOTA.
Definition: dakota_interface.h:121
void DakotaWriteOut(const std::string dakota_results, const std::vector< double > &responses, const std::vector< std::vector< double > > &dresponses_dl)
Member function that is used to write the Dakota output file.
void DakotaReadIn(const std::string dakota_parameters, FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim > &app, ParameterHandler &param)
Member function that is used to read the file from Dakota and perform the necessary changes on the Pa...
std::vector< int > ASV
Definition: dakota_interface.h:126
void declare_parameters(ParameterHandler &param)
Declare all parameters that are needed for:
const std::string input_file
Name of the analysis file.
Definition: dakota_interface.h:111
Classes used to interface the fuel cell analysis code with DAKOTA (an optimization toolbox)...
Definition: dakota_interface.h:38
~DakotaInterface()
Destructor.
Definition: dakota_interface.h:55
FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim > * app_linear
Pointer to application.
Definition: dakota_interface.h:131
unsigned int n_ref
Number of refinements.
Definition: dakota_interface.h:101
This class implements either iterative or time-stepping wrapper of applications.
Definition: application_wrapper.h:39
std::string dakota_version
Dakota version used.
Definition: dakota_interface.h:106
const std::string dakota_parameters
Name of the parameters file from DAKOTA.
Definition: dakota_interface.h:116
void initialize(ParameterHandler &param)
Set up how many equations are needed and read in parameters for the parameter handler in order to ini...
ParameterHandler * param
Pointer to parameter handler object.
Definition: dakota_interface.h:139
Application handling matrices and assembling the linear system to solve the sensitivity equations...
Definition: optimization_block_matrix_application.h:49
DakotaInterface(const std::string input_file, ParameterHandler &param, const std::string dakota_parameters, const std::string dakota_results, FuelCell::ApplicationCore::OptimizationBlockMatrixApplication< dim > &app_lin, FuelCell::ApplicationCore::ApplicationWrapper &app)
Constructor for an object of this class.
bool gradients
Gradients necessary?
Definition: dakota_interface.h:97