37 template<
typename CoeffType>
39 const std::string & species_data,
40 const std::string & vibration_data,
41 const std::string & electronic_data)
48 this->read_species_characteristics(&parser,species_data,vibration_data,electronic_data);
53 template<
typename CoeffType>
55 const std::string & species_data,
56 const std::string & vibration_data,
57 const std::string & electronic_data)
59 read_chemical_species_composition<CoeffType>(parser, *
this);
61 this->read_species_characteristics(parser,species_data,vibration_data,electronic_data);
66 template<
typename CoeffType>
69 const std::string & species_data,
70 const std::string & vibration_data,
71 const std::string & electronic_data)
73 this->initialize_species(species_list);
77 this->read_species_characteristics(
static_cast<ParserBase<CoeffType> *
>(&parser),species_data,vibration_data,electronic_data);
82 template<
typename CoeffType>
87 it < _chemical_species.end(); ++it )
95 template<
typename CoeffType>
98 const std::string & vibration_data,
99 const std::string & electronic_data)
102 this->read_species_mandatory_characteristics(parser);
106 this->read_species_vibrational_characteristics(parser);
110 this->read_species_electronic_characteristics(parser);
113 template<
typename CoeffType>
116 _chemical_species.resize( species_list.size(), NULL );
118 this->init_species_name_map(species_list);
121 this->build_inverse_name_map();
124 _species_list.reserve( species_list.size() );
125 for(
unsigned int s = 0; s < species_list.size(); s++ )
127 if( _species_name_map.find( species_list[s] ) == _species_name_map.end() )
129 std::cerr <<
"Error in ChemicalMixture: Unknown species " << species_list[s] << std::endl;
133 _species_list.push_back( _species_name_map.find( species_list[s] )->second );
137 template<
typename CoeffType>
140 _species_name_map.clear();
141 for(
unsigned int s = 0; s < species_list.size(); s++)
143 _species_name_map[species_list[s]] = s;
147 template<
typename CoeffType>
150 for( std::map<std::string,Species>::const_iterator it = _species_name_map.begin();
151 it != _species_name_map.end(); ++it )
153 _species_inv_name_map.insert( std::make_pair( it->second, it->first ) );
159 template <
typename CoeffType>
162 read_species_data<CoeffType>(parser, *
this);
165 template <
typename CoeffType>
168 read_species_vibrational_data<CoeffType>(parser, *
this);
171 template <
typename CoeffType>
174 read_species_electronic_data<CoeffType>(parser, *
this);
177 template<
typename CoeffType>
179 const std::string& name,
182 CoeffType n_tr_dofs,
int charge)
184 _chemical_species[index] =
188 template<
typename CoeffType>
190 const CoeffType theta_v,
191 const unsigned int ndg_v )
193 (_chemical_species[index])->add_vibrational_data(theta_v, ndg_v);
196 template<
typename CoeffType>
198 const CoeffType theta_e,
199 const unsigned int ndg_e )
201 (_chemical_species[index])->add_electronic_data(theta_e, ndg_e);
void read_species_vibrational_characteristics(ParserBase< CoeffType > *parser)
method to read vibrational characteristics
void build_inverse_name_map()
void init_species_name_map(const std::vector< std::string > &species_list)
ANTIOCH_NUMERIC_TYPE_CLASS_INSTANTIATE(Antioch::ChemicalMixture)
void read_species_mandatory_characteristics(ParserBase< CoeffType > *parser)
method to read mandatory characteristics
void change_file(const std::string &filename)
Class to encapsulate data for each chemical species.
virtual void change_file(const std::string &filename)=0
void initialize_species(const std::vector< std::string > &species_list)
method to initialize, backward compatibility
void add_species(const unsigned int index, const std::string &name, CoeffType mol_wght, CoeffType h_form, CoeffType n_tr_dofs, int charge)
void read_species_characteristics(ParserBase< CoeffType > *parser, const std::string &species_data, const std::string &vibration_data, const std::string &electronic_data)
method to read characteristics, using one parser
void add_species_vibrational_data(const unsigned int index, const CoeffType theta_v, const unsigned int ndg_v)
Class storing chemical mixture properties.
void add_species_electronic_data(const unsigned int index, const CoeffType theta_e, const unsigned int ndg_e)
The parameters are reduced parameters.
ChemicalMixture(const std::string &filename=DefaultFilename::species_list(), const bool verbose=true, const std::string &species_data=DefaultFilename::chemical_mixture(), const std::string &vibration_data=DefaultFilename::vibrational_data(), const std::string &electronic_data=DefaultFilename::electronic_data())
ascii parser by default
void read_species_electronic_characteristics(ParserBase< CoeffType > *parser)
method to read electronic characteristics
A parser is an instance related to a file.