[MOAB-dev] r2694 - MOAB/trunk/tools/dagmc
wilsonp at engr.wisc.edu
wilsonp at engr.wisc.edu
Tue Mar 10 13:41:52 CDT 2009
Author: wilsonp
Date: 2009-03-10 13:41:52 -0500 (Tue, 10 Mar 2009)
New Revision: 2694
Modified:
MOAB/trunk/tools/dagmc/ray_fire_test.cc
Log:
Added input argument source_rad to ray_fire_test. The starting point
of the ray is found by multiplying (u,v,w) by this value. Positive
values move the point forward along the ray and negative values move
the point backward along the ray.
Modified: MOAB/trunk/tools/dagmc/ray_fire_test.cc
===================================================================
--- MOAB/trunk/tools/dagmc/ray_fire_test.cc 2009-03-10 17:41:14 UTC (rev 2693)
+++ MOAB/trunk/tools/dagmc/ray_fire_test.cc 2009-03-10 18:41:52 UTC (rev 2694)
@@ -33,25 +33,26 @@
{
MBErrorCode rval;
- if (argc < 3) {
+ if (argc < 4) {
std::cerr << "Usage: " << argv[0] << " <mesh_filename> "
- << " <facet_tol> <#calls> " << std::endl;
+ << " <facet_tol> <source_rad> <#calls> " << std::endl;
return 1;
}
char* filename = argv[1];
- double tol = atof(argv[2]);
- int ncalls = atoi(argv[3]);
+ double facet_tol = atof(argv[2]);
+ double rad = atof(argv[3]);
+ int ncalls = atoi(argv[4]);
DagMC& dagmc = *DagMC::instance();
- rval = dagmc.load_file_and_init( filename, strlen(filename), 0, 0, tol);
+ rval = dagmc.load_file_and_init( filename, strlen(filename), 0, 0, facet_tol);
if (MB_SUCCESS != rval) {
std::cerr << "Failed to initialize DagMC." << std::endl;
return 2;
}
- MBEntityHandle vol = dagmc.entity_by_index(3, 1);
+ MBEntityHandle vol = dagmc.entity_by_index(3, 2);
if (0 == vol) {
std::cerr << "Problem getting first volume." << std::endl;
return 2;
@@ -63,7 +64,7 @@
// initialize random number generator using ttime1
srand((unsigned int) ttime1);
double denom = 1.0 / ((double) RAND_MAX);
- double u, v, w, normal, dist;
+ double x, y, z, u, v, w, normal, dist;
MBEntityHandle nsurf;
for (int i = 0; i < ncalls; i++) {
@@ -75,7 +76,11 @@
v *= normal;
w *= normal;
- dagmc.ray_fire(vol, 0, 1, u, v, w, 0.0, 0.0, 0.0, DBL_MAX,
+ x = u*rad;
+ y = v*rad;
+ z = w*rad;
+
+ dagmc.ray_fire(vol, 0, 1, u, v, w, x, y, z, DBL_MAX,
dist, nsurf);
}
get_time_mem(ttime2, utime2, stime2, tmem1);
More information about the moab-dev
mailing list