[MOAB-dev] r3992 - MOAB/trunk/tools/dagmc

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Wed Jun 2 15:00:30 CDT 2010


Author: sjackson
Date: 2010-06-02 15:00:30 -0500 (Wed, 02 Jun 2010)
New Revision: 3992

Modified:
   MOAB/trunk/tools/dagmc/ray_fire_test.cc
Log:
Update DagMC's ray_fire_test tool to record user-specified rays
if -p python output is requested.  Also make a couple of cosmetic
fixes to this code.

Modified: MOAB/trunk/tools/dagmc/ray_fire_test.cc
===================================================================
--- MOAB/trunk/tools/dagmc/ray_fire_test.cc	2010-06-02 14:51:01 UTC (rev 3991)
+++ MOAB/trunk/tools/dagmc/ray_fire_test.cc	2010-06-02 20:00:30 UTC (rev 3992)
@@ -100,7 +100,7 @@
     str << "           if < 0, fire rays inward through the center" << std::endl;
     str << "           if >= 0, fire randomly directed rays.  (default 0)" << std::endl;
     str << "-f <x> <y> <z> <u> <v> <w>  Fire one given ray and report result." << std::endl;
-    str << "           (May be given multiple times.  -s implies -n 0)" << std::endl;
+    str << "           (May be given multiple times.  -f implies -n 0)" << std::endl;
     str << "-z <int>   seed the random number generator (default 12345)" << std::endl;
     str << "-L <real>  if present, limit random ray Location to between +-<value> degrees" << std::endl;
     str << "-D <real>  if present, limit random ray Direction to between +-<value> degrees" << std::endl;
@@ -518,7 +518,7 @@
   out << "# This file was automatically generated by ray_fire_test, and contains" << std::endl;
   out << "# the results of a single program run.  It is formatted as a python dictionary," << std::endl;
   out << "# and its contents may be loaded into python with a command such as: " << std::endl;
-  out << "#  data = eval( compile( open('filename').read(), 'filename','eval')" << std::endl;
+  out << "#  data = eval( compile( open('filename').read(), 'filename','eval'))" << std::endl;
   out << "# (with the name of this file substituted for 'filename')" << std::endl;
   out << "{" << std::endl;
 
@@ -533,6 +533,13 @@
   DICT_VAL(source_rad);
   unsigned num_user_rays = rays.size();
   DICT_VAL(num_user_rays);
+  out << "'user_rays':[";
+  for( unsigned i = 0; i < num_user_rays; ++i ){
+    out << "(("   << rays[i].p[0] << "," << rays[i].p[1] << "," << rays[i].p[2] 
+	<< "),(" << rays[i].v[0] << "," << rays[i].v[1] << "," << rays[i].v[2] << ")),";
+  }
+  out << "]," << std::endl;
+
   DICT_VAL(num_random_rays);
   DICT_VAL(random_rays_missed);
   if( num_random_rays > 0 ){

















More information about the moab-dev mailing list