antioch-0.4.0
List of all members | Public Member Functions | Protected Attributes
AntiochTesting::NASA7XMLParsingTestFloat Class Reference
Inheritance diagram for AntiochTesting::NASA7XMLParsingTestFloat:
AntiochTesting::NASA7XMLParsingTest< float > AntiochTesting::NASA7ThermoTestBase< float >

Public Member Functions

 CPPUNIT_TEST_SUITE (NASA7XMLParsingTestFloat)
 
 CPPUNIT_TEST (test_supplied_species)
 
 CPPUNIT_TEST (test_parsed_species_list)
 
 CPPUNIT_TEST_SUITE_END ()
 
void test_supplied_species ()
 
void test_parsed_species_list ()
 
void check_curve_fits (const Antioch::NASAThermoMixture< float, Antioch::NASA7CurveFit< float > > &nasa_mixture)
 
void check_coefficients (const float *parsed_coeffs, std::vector< float > &exact_coeffs)
 
float tol ()
 
void setUp ()
 
void tearDown ()
 
void init_H2_coeffs_200_1000 ()
 
void init_H2_coeffs_1000_3500 ()
 
void init_all_H2_coeffs ()
 
void init_N2_coeffs_300_1000 ()
 
void init_N2_coeffs_1000_5000 ()
 
void init_all_N2_coeffs ()
 

Protected Attributes

std::vector< float > _H2_coeffs_200_1000
 
std::vector< float > _H2_coeffs_1000_3500
 
std::vector< float > _N2_coeffs_300_1000
 
std::vector< float > _N2_coeffs_1000_5000
 
std::vector< float > _all_standard_H2_coeffs
 
std::vector< float > _all_standard_N2_coeffs
 

Detailed Description

Definition at line 195 of file nasa_mixture_xml_parsing_test.C.

Member Function Documentation

void AntiochTesting::NASA7XMLParsingTest< float >::check_coefficients ( const float *  parsed_coeffs,
std::vector< float > &  exact_coeffs 
)
inlineinherited

Definition at line 151 of file nasa_mixture_xml_parsing_test.C.

152  {
153  for( unsigned int c = 0; c < exact_coeffs.size(); c++ )
154  CPPUNIT_ASSERT_DOUBLES_EQUAL( exact_coeffs[c], parsed_coeffs[c], this->tol() );
155  }
void AntiochTesting::NASA7XMLParsingTest< float >::check_curve_fits ( const Antioch::NASAThermoMixture< float , Antioch::NASA7CurveFit< float > > &  nasa_mixture)
inlineinherited

Definition at line 134 of file nasa_mixture_xml_parsing_test.C.

135  {
136  const Antioch::NASA7CurveFit<Scalar>& H2_curve_fit = nasa_mixture.curve_fit(0);
137  const Antioch::NASA7CurveFit<Scalar>& N2_curve_fit = nasa_mixture.curve_fit(1);
138 
139  CPPUNIT_ASSERT_EQUAL( (unsigned int)2, H2_curve_fit.n_intervals() );
140  CPPUNIT_ASSERT_EQUAL( (unsigned int)2, N2_curve_fit.n_intervals() );
141 
142  // Check N2 coefficients
143  this->check_coefficients( H2_curve_fit.coefficients(0), this->_H2_coeffs_200_1000 );
144  this->check_coefficients( H2_curve_fit.coefficients(1), this->_H2_coeffs_1000_3500 );
145 
146  // Check NO2 coefficients
147  this->check_coefficients( N2_curve_fit.coefficients(0), this->_N2_coeffs_300_1000 );
148  this->check_coefficients( N2_curve_fit.coefficients(1), this->_N2_coeffs_1000_5000 );
149  }
const NASAFit & curve_fit(unsigned int s) const
Definition: nasa_mixture.h:179
const CoeffType * coefficients(const unsigned int interval) const
The ordering/packing of the coefficients will depend on the subclass.
unsigned int n_intervals() const
The number of intervals for this NASA9 curve fit.
void check_coefficients(const float *parsed_coeffs, std::vector< float > &exact_coeffs)
AntiochTesting::NASA7XMLParsingTestFloat::CPPUNIT_TEST ( test_supplied_species  )
AntiochTesting::NASA7XMLParsingTestFloat::CPPUNIT_TEST ( test_parsed_species_list  )
AntiochTesting::NASA7XMLParsingTestFloat::CPPUNIT_TEST_SUITE ( NASA7XMLParsingTestFloat  )
AntiochTesting::NASA7XMLParsingTestFloat::CPPUNIT_TEST_SUITE_END ( )
void AntiochTesting::NASA7ThermoTestBase< float >::init_all_H2_coeffs ( )
inlineinherited
void AntiochTesting::NASA7ThermoTestBase< float >::init_all_N2_coeffs ( )
inlineinherited

Definition at line 117 of file nasa7_thermo_test_base.h.

void AntiochTesting::NASA7ThermoTestBase< float >::init_H2_coeffs_1000_3500 ( )
inlineinherited

Definition at line 70 of file nasa7_thermo_test_base.h.

71  {
72  _H2_coeffs_1000_3500.resize(7);
73  _H2_coeffs_1000_3500[0] = 3.337279200E+00L;
74  _H2_coeffs_1000_3500[1] = -4.940247310E-05L;
75  _H2_coeffs_1000_3500[2] = 4.994567780E-07L;
76  _H2_coeffs_1000_3500[3] = -1.795663940E-10L;
77  _H2_coeffs_1000_3500[4] = 2.002553760E-14L;
78  _H2_coeffs_1000_3500[5] = -9.501589220E+02L;
79  _H2_coeffs_1000_3500[6] = -3.205023310E+00L;
80  }
void AntiochTesting::NASA7ThermoTestBase< float >::init_H2_coeffs_200_1000 ( )
inlineinherited

Definition at line 58 of file nasa7_thermo_test_base.h.

59  {
60  _H2_coeffs_200_1000.resize(7);
61  _H2_coeffs_200_1000[0] = 2.344331120E+00L;
62  _H2_coeffs_200_1000[1] = 7.980520750E-03L;
63  _H2_coeffs_200_1000[2] = -1.947815100E-05L;
64  _H2_coeffs_200_1000[3] = 2.015720940E-08L;
65  _H2_coeffs_200_1000[4] = -7.376117610E-12L;
66  _H2_coeffs_200_1000[5] = -9.179351730E+02L;
67  _H2_coeffs_200_1000[6] = 6.830102380E-01L;
68  }
void AntiochTesting::NASA7ThermoTestBase< float >::init_N2_coeffs_1000_5000 ( )
inlineinherited

Definition at line 105 of file nasa7_thermo_test_base.h.

106  {
107  _N2_coeffs_1000_5000.resize(7);
108  _N2_coeffs_1000_5000[0] = 2.926640000E+00L;
109  _N2_coeffs_1000_5000[1] = 1.487976800E-03L;
110  _N2_coeffs_1000_5000[2] = -5.684760000E-07L;
111  _N2_coeffs_1000_5000[3] = 1.009703800E-10L;
112  _N2_coeffs_1000_5000[4] = -6.753351000E-15L;
113  _N2_coeffs_1000_5000[5] = -9.227977000E+02L;
114  _N2_coeffs_1000_5000[6] = 5.980528000E+00L;
115  }
void AntiochTesting::NASA7ThermoTestBase< float >::init_N2_coeffs_300_1000 ( )
inlineinherited

Definition at line 93 of file nasa7_thermo_test_base.h.

94  {
95  _N2_coeffs_300_1000.resize(7);
96  _N2_coeffs_300_1000[0] = 3.298677000E+00L;
97  _N2_coeffs_300_1000[1] = 1.408240400E-03L;
98  _N2_coeffs_300_1000[2] = -3.963222000E-06L;
99  _N2_coeffs_300_1000[3] = 5.641515000E-09L;
100  _N2_coeffs_300_1000[4] = -2.444854000E-12L;
101  _N2_coeffs_300_1000[5] = -1.020899900E+03L;
102  _N2_coeffs_300_1000[6] = 3.950372000E+00L;
103  }
void AntiochTesting::NASA7ThermoTestBase< float >::setUp ( )
inlineinherited
void AntiochTesting::NASA7ThermoTestBase< float >::tearDown ( )
inlineinherited

Definition at line 56 of file nasa7_thermo_test_base.h.

56 {}
void AntiochTesting::NASA7XMLParsingTest< float >::test_parsed_species_list ( )
inlineinherited

Definition at line 117 of file nasa_mixture_xml_parsing_test.C.

118  {
119  std::string thermo_filename = std::string(ANTIOCH_TESTING_INPUT_FILES_PATH)+"nasa7_thermo_test.xml";
120 
121  Antioch::XMLParser<Scalar> xml_parser(thermo_filename,false);
122 
123  std::vector<std::string> species_str_list = xml_parser.species_list();
124 
125  Antioch::ChemicalMixture<Scalar> chem_mixture( species_str_list );
126 
128 
129  xml_parser.read_thermodynamic_data(nasa_mixture);
130 
131  this->check_curve_fits(nasa_mixture);
132  }
Nothing is stored, this parser is based on the tinyxml2 implementation.
Class storing chemical mixture properties.
void check_curve_fits(const Antioch::NASAThermoMixture< float, Antioch::NASA7CurveFit< float > > &nasa_mixture)
void AntiochTesting::NASA7XMLParsingTest< float >::test_supplied_species ( )
inlineinherited

Definition at line 100 of file nasa_mixture_xml_parsing_test.C.

101  {
102  std::vector<std::string> species_str_list(2);
103  species_str_list[0] = "H2";
104  species_str_list[1] = "N2";
105 
106  Antioch::ChemicalMixture<Scalar> chem_mixture( species_str_list );
107 
108  std::string thermo_filename = std::string(ANTIOCH_TESTING_INPUT_FILES_PATH)+"nasa7_thermo_test.xml";
109 
111 
112  Antioch::read_nasa_mixture_data( nasa_mixture, thermo_filename, Antioch::XML );
113 
114  this->check_curve_fits(nasa_mixture);
115  }
void read_nasa_mixture_data(NASAThermoMixture< NumericType, CurveType > &thermo, const std::string &filename=DefaultSourceFilename::thermo_data(), ParsingType=ASCII, bool verbose=true)
Class storing chemical mixture properties.
void check_curve_fits(const Antioch::NASAThermoMixture< float, Antioch::NASA7CurveFit< float > > &nasa_mixture)
float AntiochTesting::NASA7XMLParsingTest< float >::tol ( )
inlineinherited

Definition at line 157 of file nasa_mixture_xml_parsing_test.C.

158  { return std::numeric_limits<Scalar>::epsilon() * 10; }

Member Data Documentation

std::vector<float > AntiochTesting::NASA7ThermoTestBase< float >::_all_standard_H2_coeffs
protectedinherited

Definition at line 137 of file nasa7_thermo_test_base.h.

std::vector<float > AntiochTesting::NASA7ThermoTestBase< float >::_all_standard_N2_coeffs
protectedinherited

Definition at line 138 of file nasa7_thermo_test_base.h.

std::vector<float > AntiochTesting::NASA7ThermoTestBase< float >::_H2_coeffs_1000_3500
protectedinherited

Definition at line 131 of file nasa7_thermo_test_base.h.

std::vector<float > AntiochTesting::NASA7ThermoTestBase< float >::_H2_coeffs_200_1000
protectedinherited

Definition at line 130 of file nasa7_thermo_test_base.h.

std::vector<float > AntiochTesting::NASA7ThermoTestBase< float >::_N2_coeffs_1000_5000
protectedinherited

Definition at line 134 of file nasa7_thermo_test_base.h.

std::vector<float > AntiochTesting::NASA7ThermoTestBase< float >::_N2_coeffs_300_1000
protectedinherited

Definition at line 133 of file nasa7_thermo_test_base.h.


The documentation for this class was generated from the following file:

Generated on Thu Jul 7 2016 11:09:51 for antioch-0.4.0 by  doxygen 1.8.8