Show
Ignore:
Timestamp:
12/05/06 13:55:14 (2 years ago)
Author:
rjrw
Message:

Patch back to deal with SEGVs on previous step.

Still need to a) reorganize startup b) improve treatment of
decoupling within the network.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newmole/source/mole_co_solve.cpp

    r680 r684  
    5050        float abundan; 
    5151        struct chem_element_s *element; 
     52        double sum; 
    5253 
    5354        CO_step();                  /* Calculate the matrix elements */ 
     55 
     56        /* Ugly hack to deal with species which have become uncoupled */ 
     57        for (i=0;i<mole.num_comole_calc;i++) 
     58        { 
     59                sum = 0.; 
     60                for (j=0;j<mole.num_comole_calc;j++) 
     61                { 
     62                        sum = sum+fabs(mole.c[i][j]); 
     63                } 
     64                if (sum < SMALLFLOAT && fabs(mole.b[i]) < SMALLFLOAT) 
     65                { 
     66                        mole.c[i][i] = 1.; 
     67                } 
     68        } 
    5469 
    5570        cartot_mol = dense.xMolecules[ipCARBON] + findspecies("C")->hevmol + findspecies("C+")->hevmol;