OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
experimental_data.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // C++ Implementation: experimental_data
4 //
5 // Description: Used to read in an array of experimental data with column headers.
6 // For use with parameter estimation or generating polarization curves.
7 //
8 // Author: Marc Secanell <secanell@ualberta.ca>, Peter Dobson <pdobson@ualberta.ca> (C) 2009,2010
9 //
10 // Copyright: See COPYING file that comes with this distribution
11 //
12 // Created by: Marc Secanell, Peter Dobson (December 2009)
13 // Last updated: January, 2010
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELL__EXPERIMENTAL_DATA_H
18 #define _FUELCELL__EXPERIMENTAL_DATA_H
19 
20 //appframe
21 #include "fe_vectors.h"
22 #include "application_data.h"
23 #include "event.h"
24 #include "application_base.h"
25 #include "application_wrapper.h"
26 
27 //STL libraries:
28 #include<string>
29 #include<fstream>
30 #include<iostream>
31 #include<vector>
32 
33 using namespace dealii;
34 
35 namespace SIM
36 {
42  {
43  public:
44 
48  ExperimentalData(std::string filename);
53  {};
54 
58  void parse_data_names() const;
59 
63  void print_data() const;
68  void extract_vector(std::string label, std::vector<double>& data_vector);
69 
73  void get_experimental_values(std::vector<std::string>& name_OC, std::vector< std::vector<double> >& value_OC) const;
74 
75 // /**
76 // * function that gets the string vector and value array
77 // */
78 // void store_OCV_values(std::vector<std::string>& name_OC, std::vector< std::vector<double> >& value_OC, std::vector<double>& current);
79 
80 // /**
81 // * function that gets the string vector and value array
82 // */
83 // bool find_OCV(std::vector<double>& conditions, double& OCV);
84 
85  // Inline Functions
89  inline int get_num_rows() const
90  {
91  return experimental_values.size();
92  }
96  inline int get_num_columns() const
97  {
98  return experimental_values[0].size();
99  }
100 
101 
102  private:
107  void read_data_file();
108 
112  std::vector< std::vector<double> > experimental_values;
116  std::vector<std::string> data_names;
120  const std::string data_file;
124  std::vector<double> OCV_list;
125 
126  std::vector <std::vector<double> > OCV_conditions;
127 
128  };
129 
130 }
131 
132 #endif
133 
134 
135 
std::vector< std::vector< double > > experimental_values
array of experimental values used in NLS parameter study
Definition: experimental_data.h:112
int get_num_rows() const
function that gets the string vector and value array
Definition: experimental_data.h:89
std::vector< std::vector< double > > OCV_conditions
Definition: experimental_data.h:126
const std::string data_file
String specifying the data file to be read.
Definition: experimental_data.h:120
Description: Used to read in an array of experimental data with column headers.
Definition: experimental_data.h:41
std::vector< std::string > data_names
names of operating conditions for experimental values used in NLS parameter study ...
Definition: experimental_data.h:116
~ExperimentalData()
Destructor.
Definition: experimental_data.h:52
int get_num_columns() const
function that returns the number of data points (rows) in the data file
Definition: experimental_data.h:96
std::vector< double > OCV_list
vector of values holding the open circuit voltage for the data provided
Definition: experimental_data.h:124