Matthew Turk avatar Matthew Turk committed bcb7295

Disabling some error printing and fixing output statements.

Comments (0)

Files changed (3)

dengo/solvers/BE_chem_solve.C

       // check error in this cell (max norm)
       for (i=0; i<nchem; i++) {
 	if ( fabs(s[i]) > (atol[ioff+i] + rtol[ioff+i] * fabs(u[ioff+i]))) {
-      fprintf(stderr, "Unsolved[%d]: %d % 0.5g % 0.5g\n",
-         ix, i, s[i], atol[ioff+i] + rtol[ioff+i] * fabs(u[ioff+i]));
+      /*fprintf(stderr, "Unsolved[%d]: %d % 0.5g % 0.5g\n",
+         ix, i, s[i], atol[ioff+i] + rtol[ioff+i] * fabs(u[ioff+i]));*/
 	  unsolved = 1;
 	  break;
 	}
 
   // final check, diagnostics output
   if (unsolved) {
-    printf("BE_chem_solve WARNING: unsolved after %i iterations\n",isweep);
+    /*printf("BE_chem_solve WARNING: unsolved after %i iterations\n",isweep);*/
     return 1;
   } else {
-    printf("BE_chem_solve: solved with %i total iterations\n",isweep);
+    /*printf("BE_chem_solve: solved with %i total iterations\n",isweep);*/
     return 0;
   }
 

dengo/templates/rates_and_rate_tables.C.template

         if (rv == 0) {
 	    if (siter == 9999) break;
 	    siter++;
-            fprintf(stderr, "Successful Iteration[%d]: %0.16g / %0.16g\n",
-                     siter, dt, dtf);
-            ttot += dt;
+        if (siter % 1000 == 0) {
+            fprintf(stderr, "Successful Iteration[%d]: (%0.4g) %0.16g / %0.16g\n",
+                     siter, dt, ttot, dtf);
+        }
+        ttot += dt;
 	    dt = DMIN(dt * 1.1, dtf - ttot);
 	    {% if network.write_intermediate_solutions %}
 	    /* Write intermediate  results to HDF5 file */

examples/run_primordial_network.py

 from dengo.chemistry_constants import tiny, kboltz, mh
 from dengo.known_species import *
 
-NCELLS = 128
-density = 1e7
+NCELLS = 4
+density = 1e14
+temperature = np.logspace(2, 4, NCELLS)
+temperature[:] = 1e3
 X = 0.5
 
 primordial = ChemicalNetwork()
 # This defines the temperature range for the rate tables
 primordial.init_temperature((1e0, 1e8))
 
-init_array = np.ones(NCELLS) 
+init_array = np.ones(NCELLS) * density
 init_values = dict()
 init_values['HII']     = X * init_array
 init_values['HM']      = init_array * tiny
 number_density = primordial.calculate_number_density(init_values)
 
 # set up initial temperatures values used to define ge
-temperature = np.logspace(2, 4, NCELLS)
-temperature[:] = 1e3
 init_values['T'] = temperature
 
 # calculate ge (very crudely, no H2 help here)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.