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 1354 2013-08-17 00:01:22Z 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<base/parameter_handler.h>
17 
18 // Fuel Cells:
20 
21 //STL libraries:
22 #include<string>
23 #include<fstream>
24 #include<iostream>
25 #include<vector>
26 
27 namespace SIM
28 {
36  template <int dim>
38  {
39  public:
46  DakotaInterface(const std::string input_file,
47  ParameterHandler& param,
48  const std::string dakota_parameters,
49  const std::string dakota_results,
52 
55  {
56  };
57 
61  void run();
62 
63  private:
70  void declare_parameters(ParameterHandler& param);
71 
76  void initialize(ParameterHandler& param);
77 
82  void DakotaReadIn(const std::string dakota_parameters,
84  ParameterHandler &param);
85 
89  void DakotaWriteOut(const std::string dakota_results,
90  const std::vector<double>& responses,
91  const std::vector<std::vector<double> >& dresponses_dl);
92 
96  bool gradients;
100  unsigned int n_ref;
101 
105  std::string dakota_version;
106 
110  const std::string input_file;
111 
115  const std::string dakota_parameters;
116 
120  const std::string dakota_results;
121 
125  std::vector<int> ASV;
126 
131 
136 
138  ParameterHandler *param;
139  };
140 
141 }
142 
143 #endif