Cantera  2.0
Public Member Functions | Public Attributes | Private Member Functions | List of all members
CKReader Class Reference

Chemkin file reader class. More...

#include <CKReader.h>

Collaboration diagram for CKReader:
[legend]

Public Member Functions

 CKReader ()
 Constructor.
 
 ~CKReader ()
 Destructor. Does nothing.
 
bool read (const std::string &inputFile, const std::string &thermoDatabase, const std::string &logFile)
 Read and optionally validate a Chemkin input file.
 
void write (string outputFile)
 not implemented.
 

Public Attributes

elementList elements
 a list of Element objects
 
speciesList species
 a list of Species objects
 
reactionList reactions
 a list of Reaction objects
 
groupList groups
 a list of Groups
 
speciesTable speciesData
 a map from species names to Species objects
 
ReactionUnits units
 reaction units
 
bool verbose
 print detailed messages to log file
 
bool validate
 validate elements, species, and reaction
 
bool debug
 enable debugging output
 

Private Member Functions

bool validateSpecies (ostream &log)
 validate the species.
 
bool validateReactions (ostream &log)
 validate the reactions.
 
bool writeReactions (ostream &log)
 print a summary of all reactions to the log file
 

Detailed Description

Chemkin file reader class.

Class CKReader parses and validates a file containing a description of a chemical reaction mechanism in Chemkin format. See the Examples section for examples of how CKReader is used in user programs.

Definition at line 60 of file CKReader.h.

Constructor & Destructor Documentation

CKReader ( )
inline

Constructor.

Construct a new CKReader instance. By default, validation is enabled, as well as verbose output to the log file.

Definition at line 68 of file CKReader.h.

~CKReader ( )
inline

Destructor. Does nothing.

Definition at line 71 of file CKReader.h.

Member Function Documentation

bool read ( const std::string &  inputFile,
const std::string &  thermoDatabase,
const std::string &  logfile 
)

Read and optionally validate a Chemkin input file.

read and optionally validate an input file in Chemkin format.

Parameters
inputFilepath to the input file.
thermoDatabasepath to the species thermodynamic property database. If no database is required, enter a null string.
logFilefile to write logging and error messages to.
Returns
true if no errors encountered, false otherwise.
Parameters
inputFilepath to the input file
thermoDatabasepath to the species database file
logfilepath to the file where log messages should be written
Returns
true if no errors were encountered, false otherwise

Definition at line 38 of file CKReader.cpp.

References Species::name, ckr::newTask(), ckr::NoThermoDatabase, ckr::pad(), CKParser::readElementSection(), CKParser::readSpeciesSection(), CKParser::readThermoSection(), and ckr::valid().

void write ( string  outputFile)

not implemented.

bool validateSpecies ( ostream &  log)
private

validate the species.

validate the species

Definition at line 382 of file CKReader.cpp.

References ckr::checkThermo(), Species::comp, ckr::getMapKeys(), Species::name, ckr::newTask(), Species::valid, and ckr::valid().

bool validateReactions ( ostream &  log)
private

validate the reactions.

validate the reactions

Definition at line 451 of file CKReader.cpp.

References ckr::checkBalance(), Reaction::duplicate, and Reaction::isDuplicate.

bool writeReactions ( ostream &  log)
private

Member Data Documentation

elementList elements

a list of Element objects

Definition at line 73 of file CKReader.h.

speciesList species

a list of Species objects

Definition at line 74 of file CKReader.h.

reactionList reactions

a list of Reaction objects

Definition at line 75 of file CKReader.h.

groupList groups

a list of Groups

Definition at line 76 of file CKReader.h.

speciesTable speciesData

a map from species names to Species objects

Definition at line 77 of file CKReader.h.

reaction units

Definition at line 78 of file CKReader.h.

bool verbose

print detailed messages to log file

Definition at line 93 of file CKReader.h.

bool validate

validate elements, species, and reaction

Definition at line 94 of file CKReader.h.

bool debug

enable debugging output

Definition at line 95 of file CKReader.h.


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