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

Class storing chemical mixture properties. More...

#include <ascii_parser.h>

Public Member Functions

 TransportMixture (const ChemicalMixture< CoeffType > &mixture, const std::string &filename=DefaultFilename::transport_mixture(), bool verbose=true, ParsingType type=ASCII)
 
 TransportMixture (const ChemicalMixture< CoeffType > &mixture, ParserBase< CoeffType > *parser)
 
 ~TransportMixture ()
 
unsigned int n_species () const
 ChemicalMixture method. More...
 
const std::vector< Species > & species_list () const
 ChemicalMixture method. More...
 
const std::map< Species,
std::string > & 
species_inverse_name_map () const
 ChemicalMixture method. More...
 
const std::map< std::string,
Species > & 
species_name_map () const
 ChemicalMixture method. More...
 
const ChemicalMixture
< CoeffType > & 
chemical_mixture () const
 
void add_species (const unsigned int index, CoeffType LJ_depth, CoeffType LJ_diameter, CoeffType dipole_moment, CoeffType polarizability, CoeffType rotational_relaxation, CoeffType mass)
 
const std::vector
< TransportSpecies< CoeffType > * > & 
transport_species () const
 
const TransportSpecies
< CoeffType > & 
transport_species (unsigned int s) const
 

Protected Attributes

const ChemicalMixture
< CoeffType > & 
_chemical_mixture
 
std::vector< TransportSpecies
< CoeffType > * > 
_transport_species
 

Private Types

typedef unsigned int Species
 

Private Member Functions

 TransportMixture ()
 

Detailed Description

template<typename CoeffType = double>
class Antioch::TransportMixture< CoeffType >

Class storing chemical mixture properties.

This class manages the list of TransportSpecies for a requested set of species from input.

Definition at line 55 of file ascii_parser.h.

Member Typedef Documentation

template<typename CoeffType = double>
typedef unsigned int Antioch::TransportMixture< CoeffType >::Species
private

Definition at line 70 of file transport_mixture.h.

Constructor & Destructor Documentation

template<typename CoeffType >
Antioch::TransportMixture< CoeffType >::TransportMixture ( const ChemicalMixture< CoeffType > &  mixture,
const std::string &  filename = DefaultFilename::transport_mixture(),
bool  verbose = true,
ParsingType  type = ASCII 
)

Definition at line 39 of file transport_mixture.C.

References Antioch::TransportMixture< CoeffType >::_chemical_mixture, Antioch::TransportMixture< CoeffType >::_transport_species, antioch_parsing_error, Antioch::ASCII, Antioch::CHEMKIN, Antioch::read_transport_species_data(), and Antioch::XML.

41  : _chemical_mixture( chem_mix),
42  _transport_species(_chemical_mixture.n_species(), NULL )
43  {
44 
45  ParserBase<CoeffType> * parser(NULL);
46  switch(type)
47  {
48  case ASCII:
49  parser = new ASCIIParser<CoeffType>(filename,verbose);
50  break;
51  case CHEMKIN:
52  parser = new ChemKinParser<CoeffType>(filename,verbose);
53  break;
54  case XML:
55  parser = new XMLParser<CoeffType>(filename,verbose);
56  break;
57  default:
58  antioch_parsing_error("unknown type");
59  }
60 
61  // Now read in transport properties for the requested species and stash
62  read_transport_species_data(parser,*this);
63 
64  // check we have everyone requested
65  for( unsigned int s = 0; s < _transport_species.size(); ++s )
66  {
67  if(!_transport_species[s]) // it is not mandatory, Blottner or Sutherland are self-sufficient
68  {
69  std::cerr << "Warning: missing transport data for species "
70  << _chemical_mixture.species_inverse_name_map().at(_chemical_mixture.species_list()[s])
71  << "\n"
72  << "Be sure to use a transport model that does not require the default data"
73  << std::endl;
74  }
75  }
76 
77  delete parser;
78  }
std::vector< TransportSpecies< CoeffType > * > _transport_species
void read_transport_species_data(ParserBase< NumericType > *parser, TransportMixture< NumericType > &transport)
const ChemicalMixture< CoeffType > & _chemical_mixture
#define antioch_parsing_error(description)
template<typename CoeffType >
Antioch::TransportMixture< CoeffType >::TransportMixture ( const ChemicalMixture< CoeffType > &  mixture,
ParserBase< CoeffType > *  parser 
)

Definition at line 81 of file transport_mixture.C.

References Antioch::TransportMixture< CoeffType >::_chemical_mixture, Antioch::TransportMixture< CoeffType >::_transport_species, and Antioch::read_transport_species_data().

83  : _chemical_mixture( mixture),
84  _transport_species(_chemical_mixture.n_species(), NULL )
85  {
86  // Now read in transport properties for the requested species and stash
87  read_transport_species_data(parser,*this);
88 
89  // check we have everyone requested
90  for( unsigned int s = 0; s < _transport_species.size(); ++s )
91  {
92  if(!_transport_species[s]) // it is not mandatory, Blottner or Sutherland are self-sufficient
93  {
94  std::cerr << "Warning: missing transport data for species " << _chemical_mixture.species_inverse_name_map().at(
95  _chemical_mixture.species_list()[s]) << "\n"
96  << "Be sure to use a transport model that does not require the default data"
97  << std::endl;
98  }
99  }
100 
101  return;
102 
103  }
std::vector< TransportSpecies< CoeffType > * > _transport_species
void read_transport_species_data(ParserBase< NumericType > *parser, TransportMixture< NumericType > &transport)
const ChemicalMixture< CoeffType > & _chemical_mixture
template<typename CoeffType >
Antioch::TransportMixture< CoeffType >::~TransportMixture ( )

Definition at line 106 of file transport_mixture.C.

107  {
108  // Clean up all the TransportSpecies we stored
109  for( typename std::vector<TransportSpecies<CoeffType>* >::iterator it = _transport_species.begin();
110  it < _transport_species.end(); ++it )
111  {
112  delete (*it);
113  }
114  }
std::vector< TransportSpecies< CoeffType > * > _transport_species
template<typename CoeffType = double>
Antioch::TransportMixture< CoeffType >::TransportMixture ( )
private

Member Function Documentation

template<typename CoeffType >
void Antioch::TransportMixture< CoeffType >::add_species ( const unsigned int  index,
CoeffType  LJ_depth,
CoeffType  LJ_diameter,
CoeffType  dipole_moment,
CoeffType  polarizability,
CoeffType  rotational_relaxation,
CoeffType  mass 
)

Definition at line 117 of file transport_mixture.C.

124  {
125  Species name_enum = _chemical_mixture.species_list()[index];
126 
127  _transport_species[index] = new TransportSpecies<CoeffType>(name_enum,
128  LJ_depth,
129  LJ_diameter,
130  dipole_moment,
131  polarizability,
132  rotational_relaxation,mass);
133  }
std::vector< TransportSpecies< CoeffType > * > _transport_species
const ChemicalMixture< CoeffType > & _chemical_mixture
template<typename CoeffType >
const ChemicalMixture< CoeffType > & Antioch::TransportMixture< CoeffType >::chemical_mixture ( ) const
inline
Returns
the chemical mixture

Definition at line 150 of file transport_mixture.h.

Referenced by Antioch::MixtureAveragedTransportMixture< CoeffType >::MixtureAveragedTransportMixture().

151  {
152  return _chemical_mixture;
153  }
const ChemicalMixture< CoeffType > & _chemical_mixture
template<typename CoeffType >
unsigned int Antioch::TransportMixture< CoeffType >::n_species ( ) const
inline

ChemicalMixture method.

Definition at line 122 of file transport_mixture.h.

Referenced by Antioch::MixtureAveragedTransportMixture< CoeffType >::MixtureAveragedTransportMixture(), and Antioch::read_transport_species_data().

123  {
124  return _chemical_mixture.n_species();
125  }
const ChemicalMixture< CoeffType > & _chemical_mixture
template<typename CoeffType >
const std::map< Species, std::string > & Antioch::TransportMixture< CoeffType >::species_inverse_name_map ( ) const
inline

ChemicalMixture method.

Definition at line 136 of file transport_mixture.h.

Referenced by Antioch::read_transport_species_data().

137  {
138  return _chemical_mixture.species_inverse_name_map();
139  }
const ChemicalMixture< CoeffType > & _chemical_mixture
template<typename CoeffType >
const std::vector< Species > & Antioch::TransportMixture< CoeffType >::species_list ( ) const
inline

ChemicalMixture method.

Definition at line 129 of file transport_mixture.h.

130  {
131  return _chemical_mixture.species_list();
132  }
const ChemicalMixture< CoeffType > & _chemical_mixture
template<typename CoeffType >
const std::map< std::string, Species > & Antioch::TransportMixture< CoeffType >::species_name_map ( ) const
inline

ChemicalMixture method.

Definition at line 143 of file transport_mixture.h.

144  {
145  return _chemical_mixture.species_name_map();
146  }
const ChemicalMixture< CoeffType > & _chemical_mixture
template<typename CoeffType >
const std::vector< TransportSpecies< CoeffType > * > & Antioch::TransportMixture< CoeffType >::transport_species ( ) const
inline

Definition at line 157 of file transport_mixture.h.

Referenced by Antioch::read_transport_species_data(), and tester().

158  {
159  return _transport_species;
160  }
std::vector< TransportSpecies< CoeffType > * > _transport_species
template<typename CoeffType >
const TransportSpecies< CoeffType > & Antioch::TransportMixture< CoeffType >::transport_species ( unsigned int  s) const
inline

Definition at line 164 of file transport_mixture.h.

References antioch_assert, and antioch_assert_less.

165  {
168 
169  return (*_transport_species[s]);
170  }
std::vector< TransportSpecies< CoeffType > * > _transport_species
#define antioch_assert(asserted)
#define antioch_assert_less(expr1, expr2)

Member Data Documentation

template<typename CoeffType = double>
const ChemicalMixture<CoeffType>& Antioch::TransportMixture< CoeffType >::_chemical_mixture
protected
template<typename CoeffType = double>
std::vector<TransportSpecies<CoeffType>*> Antioch::TransportMixture< CoeffType >::_transport_species
protected

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

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