antioch-0.4.0
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
Antioch::NASAThermoMixture< CoeffType, NASAFit > Class Template Reference

#include <ascii_parser.h>

Public Member Functions

 NASAThermoMixture (const ChemicalMixture< CoeffType > &chem_mixture)
 
virtual ~NASAThermoMixture ()
 Destructor. More...
 
void add_curve_fit (const std::string &species_name, const std::vector< CoeffType > &coeffs)
 
void add_curve_fit (const std::string &species_name, const std::vector< CoeffType > &coeffs, const std::vector< CoeffType > &temps)
 
const NASAFit & curve_fit (unsigned int s) const
 
CoeffType cp_at_200p1 (unsigned int s) const
 
bool check () const
 Checks that curve fits have been specified for all species in the mixture. More...
 
const ChemicalMixture
< CoeffType > & 
chemical_mixture () const
 

Protected Attributes

const ChemicalMixture
< CoeffType > & 
_chem_mixture
 
std::vector< NASAFit * > _species_curve_fits
 
std::vector< CoeffType > _cp_at_200p1
 

Private Member Functions

 NASAThermoMixture ()
 Default constructor. More...
 

Detailed Description

template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
class Antioch::NASAThermoMixture< CoeffType, NASAFit >

Definition at line 59 of file ascii_parser.h.

Constructor & Destructor Documentation

template<typename CoeffType, typename NASAFit >
Antioch::NASAThermoMixture< CoeffType, NASAFit >::NASAThermoMixture ( const ChemicalMixture< CoeffType > &  chem_mixture)

Definition at line 95 of file nasa_mixture.h.

96  : _chem_mixture(chem_mixture),
97  _species_curve_fits(chem_mixture.n_species(), NULL),
99  {
100  return;
101  }
const ChemicalMixture< CoeffType > & _chem_mixture
Definition: nasa_mixture.h:79
std::vector< NASAFit * > _species_curve_fits
Definition: nasa_mixture.h:81
std::vector< CoeffType > _cp_at_200p1
Definition: nasa_mixture.h:83
template<typename CoeffType , typename NASAFit >
Antioch::NASAThermoMixture< CoeffType, NASAFit >::~NASAThermoMixture ( )
virtual

Destructor.

virtual so this can be subclassed by the user.

Definition at line 105 of file nasa_mixture.h.

106  {
107  // Clean up all the NASAFits we created
108  for( typename std::vector<NASAFit* >::iterator it = _species_curve_fits.begin();
109  it < _species_curve_fits.end(); ++it )
110  {
111  delete (*it);
112  }
113 
114  return;
115  }
std::vector< NASAFit * > _species_curve_fits
Definition: nasa_mixture.h:81
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
Antioch::NASAThermoMixture< CoeffType, NASAFit >::NASAThermoMixture ( )
private

Default constructor.

Private to force to user to supply a ChemicalMixture object.

Member Function Documentation

template<typename CoeffType, typename NASAFit >
void Antioch::NASAThermoMixture< CoeffType, NASAFit >::add_curve_fit ( const std::string &  species_name,
const std::vector< CoeffType > &  coeffs 
)
inline

Definition at line 120 of file nasa_mixture.h.

References antioch_assert, antioch_assert_less_equal, and Antioch::NASAEvaluator< CoeffType, NASAFit >::cp().

Referenced by Antioch::ASCIIParser< NumericType >::read_thermodynamic_data_root(), and Antioch::ChemKinParser< NumericType >::read_thermodynamic_data_root().

122  {
123  antioch_assert( _chem_mixture.species_name_map().find(species_name) !=
124  _chem_mixture.species_name_map().end() );
125 
126  unsigned int s = _chem_mixture.species_name_map().find(species_name)->second;
127 
130 
131  _species_curve_fits[s] = new NASAFit(coeffs);
132 
133  NASAEvaluator<CoeffType,NASAFit> evaluator( *this );
134  _cp_at_200p1[s] = evaluator.cp( TempCache<CoeffType>(200.1), s );
135 
136  return;
137  }
#define antioch_assert(asserted)
const ChemicalMixture< CoeffType > & _chem_mixture
Definition: nasa_mixture.h:79
#define antioch_assert_less_equal(expr1, expr2)
std::vector< NASAFit * > _species_curve_fits
Definition: nasa_mixture.h:81
std::vector< CoeffType > _cp_at_200p1
Definition: nasa_mixture.h:83
template<typename CoeffType, typename NASAFit >
void Antioch::NASAThermoMixture< CoeffType, NASAFit >::add_curve_fit ( const std::string &  species_name,
const std::vector< CoeffType > &  coeffs,
const std::vector< CoeffType > &  temps 
)
inline

Definition at line 141 of file nasa_mixture.h.

References antioch_assert, antioch_assert_less_equal, and Antioch::NASAEvaluator< CoeffType, NASAFit >::cp().

143  {
144  antioch_assert( _chem_mixture.species_name_map().find(species_name) !=
145  _chem_mixture.species_name_map().end() );
146 
147  unsigned int s = _chem_mixture.species_name_map().find(species_name)->second;
148 
151 
152  _species_curve_fits[s] = new NASAFit(coeffs,temps);
153 
154  NASAEvaluator<CoeffType,NASAFit> evaluator( *this );
155  _cp_at_200p1[s] = evaluator.cp( TempCache<CoeffType>(200.1), s );
156 
157  return;
158  }
#define antioch_assert(asserted)
const ChemicalMixture< CoeffType > & _chem_mixture
Definition: nasa_mixture.h:79
#define antioch_assert_less_equal(expr1, expr2)
std::vector< NASAFit * > _species_curve_fits
Definition: nasa_mixture.h:81
std::vector< CoeffType > _cp_at_200p1
Definition: nasa_mixture.h:83
template<typename CoeffType , typename NASAFit >
bool Antioch::NASAThermoMixture< CoeffType, NASAFit >::check ( ) const
inline

Checks that curve fits have been specified for all species in the mixture.

Definition at line 163 of file nasa_mixture.h.

Referenced by Antioch::read_nasa_mixture_data().

164  {
165  bool valid = true;
166 
167  for( typename std::vector<NASAFit* >::const_iterator it = _species_curve_fits.begin();
168  it != _species_curve_fits.end(); ++ it )
169  {
170  if( !(*it) )
171  valid = false;
172  }
173 
174  return valid;
175  }
std::vector< NASAFit * > _species_curve_fits
Definition: nasa_mixture.h:81
template<typename CoeffType , typename NASAFit >
const ChemicalMixture< CoeffType > & Antioch::NASAThermoMixture< CoeffType, NASAFit >::chemical_mixture ( ) const
inline
template<typename CoeffType , typename NASAFit >
CoeffType Antioch::NASAThermoMixture< CoeffType, NASAFit >::cp_at_200p1 ( unsigned int  s) const
inline

Definition at line 192 of file nasa_mixture.h.

References antioch_assert_less.

193  {
194  antioch_assert_less( s, _cp_at_200p1.size() );
195  return _cp_at_200p1[s];
196  }
#define antioch_assert_less(expr1, expr2)
std::vector< CoeffType > _cp_at_200p1
Definition: nasa_mixture.h:83
template<typename CoeffType , typename NASAFit >
const NASAFit & Antioch::NASAThermoMixture< CoeffType, NASAFit >::curve_fit ( unsigned int  s) const
inline

Definition at line 179 of file nasa_mixture.h.

References antioch_assert, and antioch_assert_less.

Referenced by AntiochTesting::NASA9XMLParsingTest< long double >::test_supplied_species().

180  {
181  // Did we allocate for enough species?
183 
184  // Did we read in enough mixture data?
186 
187  return *_species_curve_fits[s];
188  }
#define antioch_assert(asserted)
#define antioch_assert_less(expr1, expr2)
std::vector< NASAFit * > _species_curve_fits
Definition: nasa_mixture.h:81

Member Data Documentation

template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
const ChemicalMixture<CoeffType>& Antioch::NASAThermoMixture< CoeffType, NASAFit >::_chem_mixture
protected

Definition at line 79 of file nasa_mixture.h.

template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
std::vector<CoeffType> Antioch::NASAThermoMixture< CoeffType, NASAFit >::_cp_at_200p1
protected

Definition at line 83 of file nasa_mixture.h.

template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
std::vector<NASAFit* > Antioch::NASAThermoMixture< CoeffType, NASAFit >::_species_curve_fits
protected

Definition at line 81 of file nasa_mixture.h.


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

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