27 #ifndef ANTIOCH_CEA_CURVE_FIT_H
28 #define ANTIOCH_CEA_CURVE_FIT_H
42 template<
typename CoeffType=
double>
43 class CEACurveFit:
public NASA9CurveFit<CoeffType>
47 CEACurveFit(
const std::vector<CoeffType>& coeffs );
49 CEACurveFit(
const std::vector<CoeffType>& coeffs,
const std::vector<CoeffType> & temps );
55 void remap_coeffs(
const std::vector<CoeffType>& coeffs );
59 template<
typename CoeffType>
66 antioch_error_msg(
"ERROR: Expected CEA style of input for coefficients! Must be a multiple of 10!");
79 template<
typename CoeffType>
82 const std::vector<CoeffType> & temp )
86 antioch_error_msg(
"ERROR: Expected CEA style of input for coefficients! Must be a multiple of 10!");
98 template<
typename CoeffType>
102 this->_coefficients.resize(this->_n_coeffs*(this->_temp.size()-1),0.0);
104 for(
unsigned int t = 0; t < this->_temp.size()-1; t++ )
106 for(
unsigned int c = 0; c < 7; c++ )
108 unsigned int i = 10*t + c;
109 unsigned int j = 9*t + c;
110 this->_coefficients[j] = coeffs[i];
113 for(
unsigned int c = 7; c < 9; c++ )
115 unsigned int i = 10*t + c;
116 unsigned int j = 9*t + c;
117 this->_coefficients[j] = coeffs[i+1];
124 #endif // ANTIOCH_CEA_CURVE_FIT_H
void remap_coeffs(const std::vector< CoeffType > &coeffs)
void check_temp_coeff_size_consistency() const
void init_nasa9_temps(const std::vector< CoeffType > &coeffs, unsigned n_coeffs)
std::vector< CoeffType > _temp
The temperatures.
This class stores the NASA polynomial fit to the thermodynamics quantities and .
#define antioch_error_msg(errmsg)
void check_coeff_size() const
CEACurveFit(const std::vector< CoeffType > &coeffs)
The parameters are reduced parameters.
unsigned int _n_coeffs
The number of coefficients in each interval.
std::vector< CoeffType > _coefficients
The coefficient data.