diff --git a/Cantera/src/Constituents.cpp b/Cantera/src/Constituents.cpp index 0409d59d2..8a923e409 100755 --- a/Cantera/src/Constituents.cpp +++ b/Cantera/src/Constituents.cpp @@ -7,18 +7,7 @@ * $Date$ * $Revision$ * - * $Log$ - * Revision 1.2 2003-06-27 14:19:16 dggoodwin - * *** empty log message *** - * - * Revision 1.1.1.1 2003/04/14 17:57:51 dggoodwin - * Initial import. - * - * Revision 1.21 2002/12/19 15:21:54 dgg - * Changed sense of ptr_Element in constructor. Now default is to create - * independent element set. See comments below. - * - * + */ // Copyright 2001 California Institute of Technology @@ -503,4 +492,19 @@ namespace Cantera { return m_speciesComp[m_mm * k + m]; } + /********************************************************************* + * + * getAtoms() + * + * Get a vector containing the atomic composition + * of species k + */ + void Constituents::getAtoms(int k, double *atomArray) const + { + const int m_mm = m_Elements->nElements(); + for (int m = 0; m < m_mm; m++) { + atomArray[m] = (double) m_speciesComp[m_mm * k + m]; + } + } + } diff --git a/Cantera/src/Constituents.h b/Cantera/src/Constituents.h index 2dbebc053..9cc8075d5 100755 --- a/Cantera/src/Constituents.h +++ b/Cantera/src/Constituents.h @@ -7,7 +7,10 @@ * $Revision$ * * $Log$ - * Revision 1.3 2003-07-21 16:02:53 hkmoffa + * Revision 1.4 2003-09-03 18:15:50 hkmoffa + * Added a vector get for the atoms in a species. + * + * Revision 1.3 2003/07/21 16:02:53 hkmoffa * Took out a double nested @name that gave a warning to doxygen * * Revision 1.2 2003/06/27 14:19:16 dggoodwin @@ -220,6 +223,12 @@ namespace Cantera { /// Number of atoms of element m in species k. doublereal nAtoms(int k, int m) const; + /** + * Get a vector containing the atomic composition + * of species k + */ + void getAtoms(int k, double *atomArray) const; + /// Copy constructor and assignment operator Constituents::Constituents(const Constituents& right); Constituents& operator=(const Constituents& right);