Skip to content

Commit

Permalink
Compute the mass of isomers properly
Browse files Browse the repository at this point in the history
  • Loading branch information
smaret committed May 18, 2015
1 parent bc33105 commit 7dbf0fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,13 @@ bool get_species_mass_and_charge( char* species, double* mass, int* charge )
*charge = 0;
int mass_multiplier = 1;

// For isomers, skip the first characters that describe the
// arrangement of elements
if ((strncmp(species, "e-", 2) == 0) ||
(strncmp(species, "l-", 2) == 0) ||
(strncmp(species, "c-", 2) == 0))
specie_pt += 2;

// Parse specie string
while( *specie_pt != '\0' )
{
Expand All @@ -496,7 +503,7 @@ bool get_species_mass_and_charge( char* species, double* mass, int* charge )
{
// Null terminate it
element[element_idx] = '\0';
// Compute it's mass
// Compute its mass
int element_mass = get_element_mass( element );
if( element_mass == -1 )
{
Expand Down

0 comments on commit 7dbf0fd

Please sign in to comment.