antioch-0.4.0
transport_species_parsing.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 
29 
30 // Antioch
31 #include "antioch/ascii_parser.h"
33 
34 namespace Antioch
35 {
36  template <typename NumericType>
38  {
39  parser->read_transport_data(transport);
40 
41  // sanity check, we may require these informations
42  bool fail(false);
43  for(unsigned int s = 0; s < transport.n_species(); s++)
44  {
45  if(!transport.transport_species()[s])
46  {
47  fail = true;
48  break;
49  }
50  }
51  if(fail)
52  {
53  std::cerr << "Molecule(s) is(are) missing in transport description. Please update the information."
54  << " Currently using file " << parser->file() << ".\n"
55  << "You might have some problem later if you need these description. "
56  << "Missing molecule(s) is(are):" << std::endl;
57  for(unsigned int i = 0; i < transport.n_species(); i++)
58  {
59  if(!transport.transport_species()[i])
60  {
61  std::cerr << transport.species_inverse_name_map().at(i) << std::endl;
62  }
63  }
64  }
65  }
66 
67  template <typename NumericType>
68  void read_transport_species_data_ascii(TransportMixture<NumericType> & transport, const std::string & filename)
69  {
71 
72  ASCIIParser<NumericType> parser(filename,true);
73 
74  read_transport_species_data( &parser, transport);
75  }
76 
77  // Instantiate
78  template void read_transport_species_data<float>( ParserBase<float>*, TransportMixture<float>& );
79  template void read_transport_species_data<double>( ParserBase<double>*, TransportMixture<double>& );
80  template void read_transport_species_data<long double>( ParserBase<long double>*, TransportMixture<long double>& );
81 
82  template void read_transport_species_data_ascii<float>( TransportMixture<float>&, const std::string& );
83  template void read_transport_species_data_ascii<double>( TransportMixture<double>&, const std::string& );
84  template void read_transport_species_data_ascii<long double>( TransportMixture<long double>&, const std::string& );
85 
86 } // end namespace Antioch
void read_transport_species_data_ascii(TransportMixture< NumericType > &transport, const std::string &filename)
template void read_transport_species_data_ascii< long double >(TransportMixture< long double > &, const std::string &)
void read_transport_species_data(ParserBase< NumericType > *parser, TransportMixture< NumericType > &transport)
const std::vector< TransportSpecies< CoeffType > * > & transport_species() const
virtual void read_transport_data(TransportMixture< NumericType > &)
reads the transport data, not valid in xml && chemkin
Definition: parser_base.h:138
template void read_transport_species_data_ascii< float >(TransportMixture< float > &, const std::string &)
const std::string file() const
Definition: parser_base.h:242
Class storing chemical mixture properties.
Definition: ascii_parser.h:55
#define antioch_deprecated()
template void read_transport_species_data_ascii< double >(TransportMixture< double > &, const std::string &)
const std::map< Species, std::string > & species_inverse_name_map() const
ChemicalMixture method.
unsigned int n_species() const
ChemicalMixture method.
The parameters are reduced parameters.
template void read_transport_species_data< float >(ParserBase< float > *, TransportMixture< float > &)
A parser is an instance related to a file.
template void read_transport_species_data< double >(ParserBase< double > *, TransportMixture< double > &)
template void read_transport_species_data< long double >(ParserBase< long double > *, TransportMixture< long double > &)

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