18 #ifndef _FUELCELLSHOP_VARIABLES_H
19 #define _FUELCELLSHOP_VARIABLES_H
22 #include <base/parameter_handler.h>
23 #include <base/point.h>
24 #include <base/function.h>
25 #include <lac/vector.h>
26 #include <fe/fe_values.h>
35 using namespace dealii;
37 namespace FuelCellShop
105 default_data = std::vector<double>(length, value);
118 default_data = data_in;
131 const double& operator[](
const unsigned int& i)
const
133 Assert( initialized, ExcMessage(
"SolutionVariables struct is not initialized !!!") );
137 Assert( i < data->size(), ExcMessage(
"Index is out of range in operator[] for SolutionVariables struct.") );
140 else if (data == NULL)
142 Assert( i < default_data.size(), ExcMessage(
"Index is out of range in operator[] for SolutionVariables struct.") );
143 return default_data.at(i);
150 bool is_initialized()
const
158 unsigned int size()
const
160 unsigned int answer = 0;
162 if (initialized && (data != NULL))
163 answer = data->size();
164 else if (initialized && (data == NULL))
165 answer = default_data.size();
175 Assert( initialized, ExcMessage(
"SolutionVariable not initialized !!!") );
186 const std::vector<double>*
data;
219 #endif // _FUELCELLSHOP_VARIABLES_H