Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update read_reaction_set_data API #261

Merged
merged 3 commits into from
Jul 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ O 16.00000 1.5420000000e7 1.5 0
O+ 15.99945 9.7560000000e7 1.5 1
O2 32.00000 0.000000000000 2.5 0
O2+ 31.99945 3.6370000000e7 2.5 1
O3 48.00000 3.0104166666e6 3.0 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also from http://cccbdb.nist.gov/hf0K.asp ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I should've included in the commit log that the comment exactly as stated is still correct. I'll force push an amendment to the commit log.

OH 17.00800 2.2995060000e6 2.5 0
Si 28.08550 1.5868220000e7 1.5 0
SiO 44.08550 -2.2683200000e6 2.5 0
Expand Down
8 changes: 8 additions & 0 deletions src/parsing/include/antioch/read_reaction_set_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
namespace Antioch
{

template <typename NumericType>
class ParserBase;

template <typename NumericType>
class ASCIIParser;

Expand Down Expand Up @@ -128,6 +131,11 @@ namespace Antioch
ReactionSet<NumericType>& reaction_set,
ParsingType type = ASCII );

template<typename NumericType>
void read_reaction_set_data(const bool verbose,
ReactionSet<NumericType>& reaction_set,
ParserBase<NumericType> * parser );

template <typename NumericType>
void verify_unit_of_parameter(Units<NumericType> & default_unit, const std::string & provided_unit,
const std::vector<std::string> & accepted_unit,
Expand Down
19 changes: 14 additions & 5 deletions src/parsing/src/read_reaction_set_data.C
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,20 @@ namespace Antioch
antioch_parsing_error("unknown type");
}

read_reaction_set_data(verbose,reaction_set,parser);

if(parser)
delete parser;
}

template<typename NumericType>
void read_reaction_set_data( const bool verbose,
ReactionSet<NumericType>& reaction_set,
ParserBase<NumericType> * parser )
{
//error or no reaction data
if(!parser->initialize())return;
if(!parser->initialize())
return;

const ChemicalMixture<NumericType>& chem_mixture = reaction_set.chemical_mixture();
unsigned int n_species = chem_mixture.n_species();
Expand Down Expand Up @@ -414,7 +426,7 @@ namespace Antioch
my_rxn->type() == ReactionType::TROE_FALLOFF_THREE_BODY)
)
{

std::cerr << "In reaction " << parser->reaction_id() << "\n"
<< "An equation of the form \"A * exp(-Ea/(R*T))\" is an Arrhenius equation,\n"
<< "and most certainly not a Kooij one\n"
Expand Down Expand Up @@ -743,9 +755,6 @@ namespace Antioch

if(verbose) std::cout << "\n\n";
}

if(parser)
delete parser;
}

// Instantiate
Expand Down
3 changes: 2 additions & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ standard_unit_tests_SOURCES = standard_unit/arrhenius_rate_test.C \
standard_unit/nasa_mixture_xml_parsing_test.C \
standard_unit/nasa_mixture_valarray_test.C \
standard_unit/macro_micro_thermo_test.C \
standard_unit/standard_unit_tests.C
standard_unit/standard_unit_tests.C \
standard_unit/xml_parsing_multiple_sections_test.C

eigen_unit_tests_SOURCES = eigen_unit/arrhenius_rate_eigen_test.C \
eigen_unit/nasa_mixture_eigen_test.C \
Expand Down
Loading