[MOAB-dev] commit/MOAB: 25 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Mar 26 21:02:19 CDT 2014


25 new commits in MOAB:

https://bitbucket.org/fathomteam/moab/commits/0c1a9c7d0bc3/
Changeset:   0c1a9c7d0bc3
Branch:      None
User:        makeclean
Date:        2014-01-22 03:25:16
Summary:     Added new default argument to ray_fire to allow entrance intersections to be allowed for geant4

Affected #:  1 file

diff --git a/tools/dagmc/DagMC.hpp b/tools/dagmc/DagMC.hpp
index 9e71601..4b1a69d 100755
--- a/tools/dagmc/DagMC.hpp
+++ b/tools/dagmc/DagMC.hpp
@@ -178,6 +178,7 @@ public:
                      const double ray_start[3], const double ray_dir[3],
                      EntityHandle& next_surf, double& next_surf_dist,
                      RayHistory* history = NULL, double dist_limit = 0,
+		     int ray_normal = 1, 
                      OrientedBoxTreeTool::TrvStats* stats = NULL );
   
   /**\brief Test if a point is inside or outside a volume 


https://bitbucket.org/fathomteam/moab/commits/341dc4538281/
Changeset:   341dc4538281
Branch:      None
User:        makeclean
Date:        2014-01-22 03:25:40
Summary:     Added comments regarding the new default arguments to rayfire

Affected #:  1 file

diff --git a/tools/dagmc/DagMC.cpp b/tools/dagmc/DagMC.cpp
index 87f84cb..21d4ba3 100755
--- a/tools/dagmc/DagMC.cpp
+++ b/tools/dagmc/DagMC.cpp
@@ -536,6 +536,7 @@ ErrorCode DagMC::ray_fire(const EntityHandle vol,
                           const double point[3], const double dir[3],
                           EntityHandle& next_surf, double& next_surf_dist,
                           RayHistory* history, double user_dist_limit,
+			  int ray_orientation, 
                           OrientedBoxTreeTool::TrvStats* stats ) { 
 
   // take some stats that are independent of nps
@@ -592,7 +593,8 @@ ErrorCode DagMC::ray_fire(const EntityHandle vol,
   const int min_tolerance_intersections = 0;
 
   // only get exit intersections
-  const int desired_orientation = 1;
+  // ray_orientation default = 1, only gets exit intersections
+  // ray_orientation if provided = -1, get entrance intersections 
 
   // numericalPrecision is used for box.intersect_ray and find triangles in the
   // neighborhood of edge/node intersections.
@@ -601,7 +603,7 @@ ErrorCode DagMC::ray_fire(const EntityHandle vol,
                                      min_tolerance_intersections,
                                      point, dir, &nonneg_ray_len,
                                      stats, &neg_ray_len, &vol, &senseTag, 
-                                     &desired_orientation, 
+                                     &ray_orientation, 
                                      history ? &(history->prev_facets) : NULL );
   assert( MB_SUCCESS == rval );
   if(MB_SUCCESS != rval) return rval;


https://bitbucket.org/fathomteam/moab/commits/266f76941d3b/
Changeset:   266f76941d3b
Branch:      None
User:        makeclean
Date:        2014-01-29 16:14:49
Summary:     updated doxygen comment and made arguments consistent

Affected #:  1 file

diff --git a/tools/dagmc/DagMC.hpp b/tools/dagmc/DagMC.hpp
index 4b1a69d..045b722 100755
--- a/tools/dagmc/DagMC.hpp
+++ b/tools/dagmc/DagMC.hpp
@@ -170,6 +170,9 @@ public:
    *                by this query will also be added to the history.
    * @param dist_limit Optional distance limit.  If provided and > 0, no intersections at a 
    *                distance further than this value will be returned.
+   * @param ray_orientation Optional ray orientation. If provided determines intersections 
+   *                along the normal provided, e.g. if -1 allows intersections back along the
+   *                the ray direction
    * @param stats Optional TrvStats object used to measure performance of underlying OBB
    *              ray-firing query.  See OrientedBoxTreeTool.hpp for details.
    * 
@@ -178,7 +181,7 @@ public:
                      const double ray_start[3], const double ray_dir[3],
                      EntityHandle& next_surf, double& next_surf_dist,
                      RayHistory* history = NULL, double dist_limit = 0,
-		     int ray_normal = 1, 
+		     int ray_orientation = 1, 
                      OrientedBoxTreeTool::TrvStats* stats = NULL );
   
   /**\brief Test if a point is inside or outside a volume 


https://bitbucket.org/fathomteam/moab/commits/fede9b62eec7/
Changeset:   fede9b62eec7
Branch:      None
User:        makeclean
Date:        2014-01-31 16:13:31
Summary:     removed extraneous comments

Affected #:  1 file

diff --git a/tools/dagmc/DagMC.cpp b/tools/dagmc/DagMC.cpp
index 21d4ba3..6e2260a 100755
--- a/tools/dagmc/DagMC.cpp
+++ b/tools/dagmc/DagMC.cpp
@@ -592,10 +592,6 @@ ErrorCode DagMC::ray_fire(const EntityHandle vol,
   // min_tolerance_intersections is passed but not used in this call
   const int min_tolerance_intersections = 0;
 
-  // only get exit intersections
-  // ray_orientation default = 1, only gets exit intersections
-  // ray_orientation if provided = -1, get entrance intersections 
-
   // numericalPrecision is used for box.intersect_ray and find triangles in the
   // neighborhood of edge/node intersections.
   rval = obbTree.ray_intersect_sets( dists, surfs, facets,


https://bitbucket.org/fathomteam/moab/commits/efab76086e29/
Changeset:   efab76086e29
Branch:      None
User:        makeclean
Date:        2014-01-31 16:14:00
Summary:     made default arguments for ray_fire clear

Affected #:  1 file

diff --git a/tools/dagmc/DagMC.hpp b/tools/dagmc/DagMC.hpp
index 045b722..fe39082 100755
--- a/tools/dagmc/DagMC.hpp
+++ b/tools/dagmc/DagMC.hpp
@@ -172,7 +172,7 @@ public:
    *                distance further than this value will be returned.
    * @param ray_orientation Optional ray orientation. If provided determines intersections 
    *                along the normal provided, e.g. if -1 allows intersections back along the
-   *                the ray direction
+   *                the ray direction, Default is 1, i.e. exit intersections
    * @param stats Optional TrvStats object used to measure performance of underlying OBB
    *              ray-firing query.  See OrientedBoxTreeTool.hpp for details.
    * 


https://bitbucket.org/fathomteam/moab/commits/8b2ad157ff46/
Changeset:   8b2ad157ff46
Branch:      None
User:        makeclean
Date:        2014-02-11 01:28:24
Summary:     added dagmc test driver file

Affected #:  2 files

diff --git a/test/dagmc/Makefile.am b/test/dagmc/Makefile.am
new file mode 100644
index 0000000..e3cd63e
--- /dev/null
+++ b/test/dagmc/Makefile.am
@@ -0,0 +1,21 @@
+LDADD = $(top_builddir)/src/libMOAB.la $(top_builddir)/src/dagmc.la
+
+MESHDIR = $(top_srcdir)/MeshFiles/unittest
+
+AM_CPPFLAGS += -DSRCDIR=$(srcdir) \
+               -DMESHDIR=$(MESHDIR) \
+               -I$(builddir) -I.. -I$(srcdir)/.. \
+               -I$(top_builddir)/src \
+               -I$(top_srcdir)/src \
+               -I$(top_srcdir)/src/io \
+               -I$(top_srcdir)/src/parallel \
+               -I$(top_srcdir)/tools/dagmc 
+
+TESTS = dagmc_test
+
+check_PROGRAMS = $(TESTS)
+
+dagmc_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_test.cpp
+dagmc_test_CXXFLAGS = $(DAGMC_FLAGS)  $(CXXFLAGS)
+
+

diff --git a/test/dagmc/dagmc_test.cpp b/test/dagmc/dagmc_test.cpp
new file mode 100644
index 0000000..b6c7c16
--- /dev/null
+++ b/test/dagmc/dagmc_test.cpp
@@ -0,0 +1,44 @@
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+#include "DagMC.hpp"
+
+using namespace moab;
+
+using moab::DagMC;
+
+#define DAG DagMC::instance()
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+
+void dagmc_load_file() 
+{
+  ErrorCode rval = DAG->load_file("test_geom.h5m"); // open the Dag file
+  CHECK_ERR(rval);
+}
+
+void dagmc_build_obb() 
+{
+  ErrorCode rval = DAG->init_OBBTree();
+  CHECK_ERR(rval);
+}
+  
+  
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  result += RUN_TEST( dagmc_load_file ); // test ray fire
+  result += RUN_TEST( dagmc_build_obb ); // build the obb
+
+  return result;
+}


https://bitbucket.org/fathomteam/moab/commits/24ed8cf8244e/
Changeset:   24ed8cf8244e
Branch:      None
User:        makeclean
Date:        2014-02-11 01:50:06
Summary:     modified to add new dagmc test

Affected #:  1 file

diff --git a/configure.ac b/configure.ac
index ea22a5e..12dfa6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1205,6 +1205,7 @@ AC_CONFIG_FILES([Makefile
                  src/parallel/Makefile
                  src/oldinc/Makefile
                  test/Makefile
+		 test/dagmc/Makefile
                  test/h5file/Makefile
                  test/dual/Makefile
                  test/obb/Makefile


https://bitbucket.org/fathomteam/moab/commits/b75d79778ccb/
Changeset:   b75d79778ccb
Branch:      None
User:        makeclean
Date:        2014-02-11 01:50:14
Summary:     modified to add new dagmc test

Affected #:  1 file

diff --git a/test/Makefile.am b/test/Makefile.am
index 631e126..c31ac87 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = . io dual obb perf
+SUBDIRS = . io dual obb perf dagmc
 if HDF5_FILE
   SUBDIRS += h5file
 endif


https://bitbucket.org/fathomteam/moab/commits/5fb3ea820d93/
Changeset:   5fb3ea820d93
Branch:      None
User:        makeclean
Date:        2014-02-11 04:50:22
Summary:     added test file to meshdir

Affected #:  1 file

diff --git a/MeshFiles/unittest/dagmc/test_geom.h5m b/MeshFiles/unittest/dagmc/test_geom.h5m
new file mode 100644
index 0000000..18e1d36
Binary files /dev/null and b/MeshFiles/unittest/dagmc/test_geom.h5m differ


https://bitbucket.org/fathomteam/moab/commits/17327ec775e0/
Changeset:   17327ec775e0
Branch:      None
User:        makeclean
Date:        2014-02-11 04:50:45
Summary:     modified makefile for dagmc tests

Affected #:  1 file

diff --git a/test/dagmc/Makefile.am b/test/dagmc/Makefile.am
index e3cd63e..22b6d7a 100644
--- a/test/dagmc/Makefile.am
+++ b/test/dagmc/Makefile.am
@@ -1,4 +1,4 @@
-LDADD = $(top_builddir)/src/libMOAB.la $(top_builddir)/src/dagmc.la
+LDADD = $(top_builddir)/src/libMOAB.la $(top_builddir)/tools/dagmc/DagMC.lo
 
 MESHDIR = $(top_srcdir)/MeshFiles/unittest
 
@@ -16,6 +16,6 @@ TESTS = dagmc_test
 check_PROGRAMS = $(TESTS)
 
 dagmc_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_test.cpp
-dagmc_test_CXXFLAGS = $(DAGMC_FLAGS)  $(CXXFLAGS)
+dagmc_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
 
 


https://bitbucket.org/fathomteam/moab/commits/447a028b775b/
Changeset:   447a028b775b
Branch:      None
User:        makeclean
Date:        2014-02-11 04:51:09
Summary:     added files from dagmc_meshdir as input to test

Affected #:  1 file

diff --git a/test/dagmc/dagmc_test.cpp b/test/dagmc/dagmc_test.cpp
index b6c7c16..84b4af0 100644
--- a/test/dagmc/dagmc_test.cpp
+++ b/test/dagmc/dagmc_test.cpp
@@ -20,10 +20,16 @@ using moab::DagMC;
             << __LINE__ << std::endl; \
   return A; } } while(false)
 
+#ifdef MESHDIR
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#endif
+
 
 void dagmc_load_file() 
 {
-  ErrorCode rval = DAG->load_file("test_geom.h5m"); // open the Dag file
+  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
   CHECK_ERR(rval);
 }
 


https://bitbucket.org/fathomteam/moab/commits/d72c05490f99/
Changeset:   d72c05490f99
Branch:      None
User:        makeclean
Date:        2014-02-11 05:13:04
Summary:     added more tests

Affected #:  1 file

diff --git a/test/dagmc/dagmc_test.cpp b/test/dagmc/dagmc_test.cpp
index 84b4af0..4946db3 100644
--- a/test/dagmc/dagmc_test.cpp
+++ b/test/dagmc/dagmc_test.cpp
@@ -38,13 +38,39 @@ void dagmc_build_obb()
   ErrorCode rval = DAG->init_OBBTree();
   CHECK_ERR(rval);
 }
-  
+
+void dagmc_num_vols()
+{
+  int num_vols = DAG->num_entities(3); 
+  CHECK_EQUAL(2,num_vols);
+}
+
+void dagmc_entity_handle()
+{
+  int num_vols = DAG->num_entities(3); 
+  EntityHandle vol;
+  for ( int i = 0 ; i < num_vols ; i++ )
+    {
+      vol = DAG->entity_by_index(3,i);
+    }
+  CHECK_EQUAL(12682136550675316765,vol);
+}
+
+void dagmc_point_in()
+{
+  int result = 0;
+  double xyz[3]={0.0,0.0,0.0};
+  ErrorCode = DAG->point_in_volume(12682136550675316765,pos,&result);
+  CHECK_EQUAL(1,result);
+}
   
 int main(int /* argc */, char** /* argv */)
 {
   int result = 0;
   result += RUN_TEST( dagmc_load_file ); // test ray fire
   result += RUN_TEST( dagmc_build_obb ); // build the obb
-
+  result += RUN_TEST( dagmc_num_vols  ); // make sure the num of vols correct
+  result += RUN_TEST( dagmc_entity_handle); // check the entity handle correct
+  result += RUN_TEST( dagmc_point_in);
   return result;
 }


https://bitbucket.org/fathomteam/moab/commits/fa9ad58309c5/
Changeset:   fa9ad58309c5
Branch:      None
User:        makeclean
Date:        2014-02-11 05:16:10
Summary:     updated args in point_in test

Affected #:  1 file

diff --git a/test/dagmc/dagmc_test.cpp b/test/dagmc/dagmc_test.cpp
index 4946db3..00abf47 100644
--- a/test/dagmc/dagmc_test.cpp
+++ b/test/dagmc/dagmc_test.cpp
@@ -60,7 +60,7 @@ void dagmc_point_in()
 {
   int result = 0;
   double xyz[3]={0.0,0.0,0.0};
-  ErrorCode = DAG->point_in_volume(12682136550675316765,pos,&result);
+  ErrorCode rval = DAG->point_in_volume(12682136550675316765,xyz,&result);
   CHECK_EQUAL(1,result);
 }
   


https://bitbucket.org/fathomteam/moab/commits/69c1fca800f1/
Changeset:   69c1fca800f1
Branch:      None
User:        makeclean
Date:        2014-02-11 05:17:41
Summary:     updated args in point_in test

Affected #:  1 file

diff --git a/test/dagmc/dagmc_test.cpp b/test/dagmc/dagmc_test.cpp
index 00abf47..9a61b62 100644
--- a/test/dagmc/dagmc_test.cpp
+++ b/test/dagmc/dagmc_test.cpp
@@ -60,7 +60,7 @@ void dagmc_point_in()
 {
   int result = 0;
   double xyz[3]={0.0,0.0,0.0};
-  ErrorCode rval = DAG->point_in_volume(12682136550675316765,xyz,&result);
+  ErrorCode rval = DAG->point_in_volume(12682136550675316765,xyz,result);
   CHECK_EQUAL(1,result);
 }
   


https://bitbucket.org/fathomteam/moab/commits/ef89eeecde57/
Changeset:   ef89eeecde57
Branch:      None
User:        makeclean
Date:        2014-02-12 16:20:10
Summary:     added more dagmc test to simple tests

Affected #:  1 file

diff --git a/test/dagmc/dagmc_test.cpp b/test/dagmc/dagmc_test.cpp
index 9a61b62..3a0c925 100644
--- a/test/dagmc/dagmc_test.cpp
+++ b/test/dagmc/dagmc_test.cpp
@@ -49,28 +49,78 @@ void dagmc_entity_handle()
 {
   int num_vols = DAG->num_entities(3); 
   EntityHandle vol;
+  EntityHandle volume = 12682136550675316765;
   for ( int i = 0 ; i < num_vols ; i++ )
     {
       vol = DAG->entity_by_index(3,i);
     }
-  CHECK_EQUAL(12682136550675316765,vol);
+  CHECK_EQUAL(volume,vol);
 }
 
 void dagmc_point_in()
 {
   int result = 0;
   double xyz[3]={0.0,0.0,0.0};
-  ErrorCode rval = DAG->point_in_volume(12682136550675316765,xyz,result);
+  EntityHandle volume = 12682136550675316765;
+  ErrorCode rval = DAG->point_in_volume(volume,xyz,result);
   CHECK_EQUAL(1,result);
 }
+
+void dagmc_rayfire()
+{
+  const double eps = 1e-6; // epsilon for test, faceting tol?
+
+  // note model is cube of side 10, centred at 0,0,0, so ray fire along
+  // any unit direction should be exactly 5.0
+  double xyz[3]={0.0,0.0,0.0};
+  double dir[3]={0.0,0.0,1.0}; 
+  EntityHandle next_surf;
+  double next_surf_dist;
+  EntityHandle volume = 12682136550675316765;
+
+  ErrorCode rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist);
+  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps); 
+}
+
+void dagmc_closest_to()
+{
+  const double eps = 1e-6; // epsilon for test, faceting tol?
+
+  // note model is cube of side 10, centred at 0,0,0, so ray fire along
+  // any unit direction should be exactly 5.0
+  double xyz[3]={-6.0,0.0,0.0};
+  double distance; // distance from point to nearest surface
+  EntityHandle volume = 12682136550675316765;
+
+  ErrorCode rval = DAG->closest_to_location(volume,xyz,distance);
+  // distance should be 1.0 cm
+  CHECK_REAL_EQUAL(1.0,distance,eps); 
+}
+
+void dagmc_test_boundary()
+{
+  EntityHandle volume = 12682136550675316765;
+  EntityHandle surf   = 12682136550675316759;
+  double xyz[3]={0.0,0.0,5.0};
+  double dir[3]={0.0,0.0,1.0}; 
+  int result;
+  
+  ErrorCode rval = DAG->test_volume_boundary(volume,surf,xyz,dir,result);
+  // check ray leaving volume
+  CHECK_EQUAL(0,result);  
+}
   
 int main(int /* argc */, char** /* argv */)
 {
   int result = 0;
-  result += RUN_TEST( dagmc_load_file ); // test ray fire
-  result += RUN_TEST( dagmc_build_obb ); // build the obb
-  result += RUN_TEST( dagmc_num_vols  ); // make sure the num of vols correct
-  result += RUN_TEST( dagmc_entity_handle); // check the entity handle correct
-  result += RUN_TEST( dagmc_point_in);
+  result += RUN_TEST( dagmc_load_file );     // test ray fire
+  result += RUN_TEST( dagmc_build_obb );     // build the obb
+  result += RUN_TEST( dagmc_num_vols  );     // make sure the num of vols correct
+  result += RUN_TEST( dagmc_entity_handle);  // check the entity handle correct
+  result += RUN_TEST( dagmc_point_in);       // check entity by point
+  result += RUN_TEST( dagmc_rayfire ) ;      // ensure ray fire distance is correct
+  result += RUN_TEST( dagmc_closest_to );    // check the distance to surface nearest point
+  result += RUN_TEST( dagmc_test_boundary ); // check particle entering leaving
+
   return result;
 }


https://bitbucket.org/fathomteam/moab/commits/292601d31bae/
Changeset:   292601d31bae
Branch:      None
User:        makeclean
Date:        2014-02-12 19:55:20
Summary:     added point in volume tests

Affected #:  1 file

diff --git a/test/dagmc/dagmc_pointinvol_test.cpp b/test/dagmc/dagmc_pointinvol_test.cpp
new file mode 100644
index 0000000..a540b63
--- /dev/null
+++ b/test/dagmc/dagmc_pointinvol_test.cpp
@@ -0,0 +1,454 @@
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+#include "DagMC.hpp"
+
+using namespace moab;
+
+using moab::DagMC;
+
+#define DAG DagMC::instance()
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+#ifdef MESHDIR
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#endif
+
+
+void dagmc_setup_test() 
+{
+  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
+  CHECK_ERR(rval);
+  rval = DAG->init_OBBTree();
+  CHECK_ERR(rval);
+
+  int num_vols = DAG->num_entities(3); 
+  EntityHandle vol;
+  EntityHandle volume = 12682136550675316765;
+  for ( int i = 0 ; i < num_vols ; i++ )
+    {
+      vol = DAG->entity_by_index(3,i);
+    }
+  CHECK_EQUAL(volume,vol);
+}
+
+void dagmc_point_in()
+{
+  int result = 0;
+  double xyz[3]={0.0,0.0,0.0};
+  EntityHandle volume = 12682136550675316765;
+  ErrorCode rval = DAG->point_in_volume(volume,xyz,result);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_1()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={-1.0,0.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_2()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,0.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_3()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,-1.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_4()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,1.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+  
+void dagmc_point_in_vol_5()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,0.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_6()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,0.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_1()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_2()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_3()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_4()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_5()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,-1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_6()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,-1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_7()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,-1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_8()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,-1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  result += RUN_TEST( dagmc_setup_test );     // setup problem
+  result += RUN_TEST( dagmc_point_in );       // point in centre
+  // rays fired along cardinal directions 
+  result += RUN_TEST( dagmc_point_in_vol_1);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_2);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_3);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_4);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_5);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_6);       // point in centre
+  // rays fired at nodes
+  result += RUN_TEST( dagmc_point_on_corner_1); 
+  result += RUN_TEST( dagmc_point_on_corner_2); 
+  result += RUN_TEST( dagmc_point_on_corner_3); 
+  result += RUN_TEST( dagmc_point_on_corner_4); 
+
+		      //  result += RUN_TEST( dagmc_point_in({0.0,0.0,5.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({0.0,0.0,-5.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({0.0,5.0,0.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({0.0,-5.0,0.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({5.0,0.0,0.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({-5.0,0.0,0.0});       // point in centre
+
+  return result;
+}


https://bitbucket.org/fathomteam/moab/commits/6ac093dec54f/
Changeset:   6ac093dec54f
Branch:      None
User:        makeclean
Date:        2014-02-12 20:01:15
Summary:     renamed file

Affected #:  1 file

diff --git a/test/dagmc/dagmc_simple_test.cpp b/test/dagmc/dagmc_simple_test.cpp
new file mode 100644
index 0000000..3a0c925
--- /dev/null
+++ b/test/dagmc/dagmc_simple_test.cpp
@@ -0,0 +1,126 @@
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+#include "DagMC.hpp"
+
+using namespace moab;
+
+using moab::DagMC;
+
+#define DAG DagMC::instance()
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+#ifdef MESHDIR
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#endif
+
+
+void dagmc_load_file() 
+{
+  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
+  CHECK_ERR(rval);
+}
+
+void dagmc_build_obb() 
+{
+  ErrorCode rval = DAG->init_OBBTree();
+  CHECK_ERR(rval);
+}
+
+void dagmc_num_vols()
+{
+  int num_vols = DAG->num_entities(3); 
+  CHECK_EQUAL(2,num_vols);
+}
+
+void dagmc_entity_handle()
+{
+  int num_vols = DAG->num_entities(3); 
+  EntityHandle vol;
+  EntityHandle volume = 12682136550675316765;
+  for ( int i = 0 ; i < num_vols ; i++ )
+    {
+      vol = DAG->entity_by_index(3,i);
+    }
+  CHECK_EQUAL(volume,vol);
+}
+
+void dagmc_point_in()
+{
+  int result = 0;
+  double xyz[3]={0.0,0.0,0.0};
+  EntityHandle volume = 12682136550675316765;
+  ErrorCode rval = DAG->point_in_volume(volume,xyz,result);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_rayfire()
+{
+  const double eps = 1e-6; // epsilon for test, faceting tol?
+
+  // note model is cube of side 10, centred at 0,0,0, so ray fire along
+  // any unit direction should be exactly 5.0
+  double xyz[3]={0.0,0.0,0.0};
+  double dir[3]={0.0,0.0,1.0}; 
+  EntityHandle next_surf;
+  double next_surf_dist;
+  EntityHandle volume = 12682136550675316765;
+
+  ErrorCode rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist);
+  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps); 
+}
+
+void dagmc_closest_to()
+{
+  const double eps = 1e-6; // epsilon for test, faceting tol?
+
+  // note model is cube of side 10, centred at 0,0,0, so ray fire along
+  // any unit direction should be exactly 5.0
+  double xyz[3]={-6.0,0.0,0.0};
+  double distance; // distance from point to nearest surface
+  EntityHandle volume = 12682136550675316765;
+
+  ErrorCode rval = DAG->closest_to_location(volume,xyz,distance);
+  // distance should be 1.0 cm
+  CHECK_REAL_EQUAL(1.0,distance,eps); 
+}
+
+void dagmc_test_boundary()
+{
+  EntityHandle volume = 12682136550675316765;
+  EntityHandle surf   = 12682136550675316759;
+  double xyz[3]={0.0,0.0,5.0};
+  double dir[3]={0.0,0.0,1.0}; 
+  int result;
+  
+  ErrorCode rval = DAG->test_volume_boundary(volume,surf,xyz,dir,result);
+  // check ray leaving volume
+  CHECK_EQUAL(0,result);  
+}
+  
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  result += RUN_TEST( dagmc_load_file );     // test ray fire
+  result += RUN_TEST( dagmc_build_obb );     // build the obb
+  result += RUN_TEST( dagmc_num_vols  );     // make sure the num of vols correct
+  result += RUN_TEST( dagmc_entity_handle);  // check the entity handle correct
+  result += RUN_TEST( dagmc_point_in);       // check entity by point
+  result += RUN_TEST( dagmc_rayfire ) ;      // ensure ray fire distance is correct
+  result += RUN_TEST( dagmc_closest_to );    // check the distance to surface nearest point
+  result += RUN_TEST( dagmc_test_boundary ); // check particle entering leaving
+
+  return result;
+}


https://bitbucket.org/fathomteam/moab/commits/568f8b88089d/
Changeset:   568f8b88089d
Branch:      None
User:        makeclean
Date:        2014-02-12 20:01:39
Summary:     modifed makefile to allow rayfire tests

Affected #:  1 file

diff --git a/test/dagmc/Makefile.am b/test/dagmc/Makefile.am
index 22b6d7a..cdefe5a 100644
--- a/test/dagmc/Makefile.am
+++ b/test/dagmc/Makefile.am
@@ -11,11 +11,17 @@ AM_CPPFLAGS += -DSRCDIR=$(srcdir) \
                -I$(top_srcdir)/src/parallel \
                -I$(top_srcdir)/tools/dagmc 
 
-TESTS = dagmc_test
+TESTS = dagmc_simple_test \
+        dagmc_rayfire_test \
+        dagmc_pointinvol_test
 
 check_PROGRAMS = $(TESTS)
 
-dagmc_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_test.cpp
-dagmc_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
+dagmc_simple_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_simple_test.cpp
+dagmc_simple_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
+dagmc_rayfire_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_rayfire_test.cpp
+dagmc_rayfire_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
+dagmc_pointinvol_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_pointinvol_test.cpp
+dagmc_pointinvol_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
 
 


https://bitbucket.org/fathomteam/moab/commits/2830fa1de50a/
Changeset:   2830fa1de50a
Branch:      None
User:        makeclean
Date:        2014-02-12 23:34:11
Summary:     added rayfire tests

Affected #:  1 file

diff --git a/test/dagmc/dagmc_rayfire_test.cpp b/test/dagmc/dagmc_rayfire_test.cpp
new file mode 100644
index 0000000..23f6ebf
--- /dev/null
+++ b/test/dagmc/dagmc_rayfire_test.cpp
@@ -0,0 +1,179 @@
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+#include "DagMC.hpp"
+
+using namespace moab;
+
+using moab::DagMC;
+
+#define DAG DagMC::instance()
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+#ifdef MESHDIR
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#endif
+
+double eps = 1.0e-6;
+
+void dagmc_setup_test() 
+{
+  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
+  CHECK_ERR(rval);
+  rval = DAG->init_OBBTree();
+  CHECK_ERR(rval);
+
+  int num_vols = DAG->num_entities(3); 
+  EntityHandle vol;
+  EntityHandle volume = 12682136550675316765;
+  for ( int i = 0 ; i < num_vols ; i++ )
+    {
+      vol = DAG->entity_by_index(3,i);
+    }
+  CHECK_EQUAL(volume,vol);
+}
+
+void dagmc_origin_face_rayfire()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={-1.0,0.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  std::cout << next_surf_dist << std::endl;
+  CHECK_REAL_EQUAL(15.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire_orient_exit()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0,1);
+  std::cout << next_surf_dist << std::endl;
+  CHECK_REAL_EQUAL(15.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire_orient_entrance()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0.0,-1);
+  std::cout << next_surf_dist << std::endl;
+  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire_history_fail()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  history.reset(); 
+  // first ray fire with history
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0,1);
+  // second ray fire with history
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+
+  // using history with this geom, there should be no next surface, i.e. 0
+  EntityHandle ZERO = 0;
+  CHECK_EQUAL(ZERO ,next_surf);
+}
+
+void dagmc_outside_face_rayfire_history()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  history.reset(); 
+  // first ray fire with history
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0,1);
+  std::cout << next_surf << " " << history.size() << std::endl;
+  // second ray fire with history
+
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+  std::cout << next_surf << " " << history.size() << std::endl;
+  //  std::cout << next_surf << std::endl;
+
+  //  std::cout << next_surf_dist << std::endl;
+
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+  std::cout << next_surf << " " << history.size() << std::endl;
+  //  std::cout << next_surf << std::endl;
+
+  //  std::cout << next_surf_dist << std::endl;
+
+  // using history with this geom, there should be no next surface, i.e. 0
+  EntityHandle ZERO = 0;
+  CHECK_EQUAL(ZERO ,next_surf);
+}
+
+
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  result += RUN_TEST( dagmc_setup_test );     // setup problem
+  // rays fired along cardinal directions 
+  result += RUN_TEST( dagmc_origin_face_rayfire );       // point in centre
+  result += RUN_TEST( dagmc_outside_face_rayfire );
+  result += RUN_TEST( dagmc_outside_face_rayfire_orient_exit ); // fire ray from point outside volume looking for exit intersections
+  result += RUN_TEST( dagmc_outside_face_rayfire_orient_entrance ); // fire ray from point outside volume looking for entrance intersection
+  result += RUN_TEST( dagmc_outside_face_rayfire_history_fail ); // fire ray from point outside geometry using ray history
+  result += RUN_TEST( dagmc_outside_face_rayfire_history ); // fire ray from point outside geometry using ray history
+
+  return result;
+}


https://bitbucket.org/fathomteam/moab/commits/9a5d443273b3/
Changeset:   9a5d443273b3
Branch:      None
User:        makeclean
Date:        2014-02-12 23:34:23
Summary:     renamed dagmc_test

Affected #:  1 file

diff --git a/test/dagmc/dagmc_test.cpp b/test/dagmc/dagmc_test.cpp
deleted file mode 100644
index 3a0c925..0000000
--- a/test/dagmc/dagmc_test.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-#include <iostream>
-#include "moab/Interface.hpp"
-#ifndef IS_BUILDING_MB
-#define IS_BUILDING_MB
-#endif
-#include "TestUtil.hpp"
-#include "Internals.hpp"
-#include "moab/Core.hpp"
-
-#include "DagMC.hpp"
-
-using namespace moab;
-
-using moab::DagMC;
-
-#define DAG DagMC::instance()
-
-#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
-  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
-            << __LINE__ << std::endl; \
-  return A; } } while(false)
-
-#ifdef MESHDIR
-static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
-#else
-static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
-#endif
-
-
-void dagmc_load_file() 
-{
-  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
-  CHECK_ERR(rval);
-}
-
-void dagmc_build_obb() 
-{
-  ErrorCode rval = DAG->init_OBBTree();
-  CHECK_ERR(rval);
-}
-
-void dagmc_num_vols()
-{
-  int num_vols = DAG->num_entities(3); 
-  CHECK_EQUAL(2,num_vols);
-}
-
-void dagmc_entity_handle()
-{
-  int num_vols = DAG->num_entities(3); 
-  EntityHandle vol;
-  EntityHandle volume = 12682136550675316765;
-  for ( int i = 0 ; i < num_vols ; i++ )
-    {
-      vol = DAG->entity_by_index(3,i);
-    }
-  CHECK_EQUAL(volume,vol);
-}
-
-void dagmc_point_in()
-{
-  int result = 0;
-  double xyz[3]={0.0,0.0,0.0};
-  EntityHandle volume = 12682136550675316765;
-  ErrorCode rval = DAG->point_in_volume(volume,xyz,result);
-  CHECK_EQUAL(1,result);
-}
-
-void dagmc_rayfire()
-{
-  const double eps = 1e-6; // epsilon for test, faceting tol?
-
-  // note model is cube of side 10, centred at 0,0,0, so ray fire along
-  // any unit direction should be exactly 5.0
-  double xyz[3]={0.0,0.0,0.0};
-  double dir[3]={0.0,0.0,1.0}; 
-  EntityHandle next_surf;
-  double next_surf_dist;
-  EntityHandle volume = 12682136550675316765;
-
-  ErrorCode rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist);
-  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps); 
-}
-
-void dagmc_closest_to()
-{
-  const double eps = 1e-6; // epsilon for test, faceting tol?
-
-  // note model is cube of side 10, centred at 0,0,0, so ray fire along
-  // any unit direction should be exactly 5.0
-  double xyz[3]={-6.0,0.0,0.0};
-  double distance; // distance from point to nearest surface
-  EntityHandle volume = 12682136550675316765;
-
-  ErrorCode rval = DAG->closest_to_location(volume,xyz,distance);
-  // distance should be 1.0 cm
-  CHECK_REAL_EQUAL(1.0,distance,eps); 
-}
-
-void dagmc_test_boundary()
-{
-  EntityHandle volume = 12682136550675316765;
-  EntityHandle surf   = 12682136550675316759;
-  double xyz[3]={0.0,0.0,5.0};
-  double dir[3]={0.0,0.0,1.0}; 
-  int result;
-  
-  ErrorCode rval = DAG->test_volume_boundary(volume,surf,xyz,dir,result);
-  // check ray leaving volume
-  CHECK_EQUAL(0,result);  
-}
-  
-int main(int /* argc */, char** /* argv */)
-{
-  int result = 0;
-  result += RUN_TEST( dagmc_load_file );     // test ray fire
-  result += RUN_TEST( dagmc_build_obb );     // build the obb
-  result += RUN_TEST( dagmc_num_vols  );     // make sure the num of vols correct
-  result += RUN_TEST( dagmc_entity_handle);  // check the entity handle correct
-  result += RUN_TEST( dagmc_point_in);       // check entity by point
-  result += RUN_TEST( dagmc_rayfire ) ;      // ensure ray fire distance is correct
-  result += RUN_TEST( dagmc_closest_to );    // check the distance to surface nearest point
-  result += RUN_TEST( dagmc_test_boundary ); // check particle entering leaving
-
-  return result;
-}


https://bitbucket.org/fathomteam/moab/commits/2db52fb92cc8/
Changeset:   2db52fb92cc8
Branch:      None
User:        makeclean
Date:        2014-03-21 19:01:00
Summary:     updated ray_fire with history test

Affected #:  1 file

diff --git a/test/dagmc/dagmc_rayfire_test.cpp b/test/dagmc/dagmc_rayfire_test.cpp
index 23f6ebf..28c81dd 100644
--- a/test/dagmc/dagmc_rayfire_test.cpp
+++ b/test/dagmc/dagmc_rayfire_test.cpp
@@ -114,10 +114,16 @@ void dagmc_outside_face_rayfire_history_fail()
   EntityHandle next_surf;
 
   history.reset(); 
+
+  // ray fired exactly along boundary shared by 2 facets on a single surface,
+  // needs to ray_fires to cross, this is expected and ok
+
   // first ray fire with history
   ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0,1);
   // second ray fire with history
   rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+  // this fire should hit graveyard, i.e. next_surf = 0
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
 
   // using history with this geom, there should be no next surface, i.e. 0
   EntityHandle ZERO = 0;
@@ -145,17 +151,12 @@ void dagmc_outside_face_rayfire_history()
   xyz[1]=origin[1]+(next_surf_dist*dir[1]);
   xyz[2]=origin[2]+(next_surf_dist*dir[2]);
 
-  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
-  std::cout << next_surf << " " << history.size() << std::endl;
-  //  std::cout << next_surf << std::endl;
+  // ray fired execacyl
 
-  //  std::cout << next_surf_dist << std::endl;
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
 
   rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
-  std::cout << next_surf << " " << history.size() << std::endl;
-  //  std::cout << next_surf << std::endl;
 
-  //  std::cout << next_surf_dist << std::endl;
 
   // using history with this geom, there should be no next surface, i.e. 0
   EntityHandle ZERO = 0;


https://bitbucket.org/fathomteam/moab/commits/fc3ec033fea3/
Changeset:   fc3ec033fea3
Branch:      None
User:        makeclean
Date:        2014-03-21 19:39:52
Summary:     updated signature of ray_fire calls

Affected #:  1 file

diff --git a/tools/dagmc/ray_fire_test.cc b/tools/dagmc/ray_fire_test.cc
index 7e5ce30..cc73a38 100644
--- a/tools/dagmc/ray_fire_test.cc
+++ b/tools/dagmc/ray_fire_test.cc
@@ -277,7 +277,8 @@ int main( int argc, char* argv[] )
       ray_t ray = rays[i];
       std::cout << " Ray: point = " << ray.p << " dir = " << ray.v << std::endl;
 
-      rval = dagmc.ray_fire( vol, ray.p.array(), ray.v.array(), surf, dist, NULL, 0, trv_stats );
+      // added ray orientation
+      rval = dagmc.ray_fire( vol, ray.p.array(), ray.v.array(), surf, dist, NULL, 0, 1, trv_stats );
 
       if(MB_SUCCESS != rval) {
         std::cerr << "ERROR: ray_fire() failed!" << std::endl;
@@ -326,8 +327,8 @@ int main( int argc, char* argv[] )
               << " " << uvw << " " << uvw%uvw << std::endl;
     uavg += uvw[0]; vavg += uvw[1]; wavg += uvw[2];
 #endif
-    
-    dagmc.ray_fire(vol, xyz.array(), uvw.array(), surf, dist, NULL, 0, trv_stats );
+    // added ray orientation
+    dagmc.ray_fire(vol, xyz.array(), uvw.array(), surf, dist, NULL, 0, 1, trv_stats );
 
     if( surf == 0){ random_rays_missed++; }
 


https://bitbucket.org/fathomteam/moab/commits/1e722e4960c3/
Changeset:   1e722e4960c3
Branch:      None
User:        makeclean
Date:        2014-03-21 20:29:46
Summary:     removed cgm dependence

Affected #:  1 file

diff --git a/test/dagmc/Makefile.am b/test/dagmc/Makefile.am
index cdefe5a..36aa48e 100644
--- a/test/dagmc/Makefile.am
+++ b/test/dagmc/Makefile.am
@@ -18,10 +18,10 @@ TESTS = dagmc_simple_test \
 check_PROGRAMS = $(TESTS)
 
 dagmc_simple_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_simple_test.cpp
-dagmc_simple_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
+dagmc_simple_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) 
 dagmc_rayfire_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_rayfire_test.cpp
-dagmc_rayfire_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
+dagmc_rayfire_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
 dagmc_pointinvol_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_pointinvol_test.cpp
-dagmc_pointinvol_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) -lcgm -lcubiti19
+dagmc_pointinvol_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
 
 


https://bitbucket.org/fathomteam/moab/commits/bd8fbc2d0f39/
Changeset:   bd8fbc2d0f39
Branch:      None
User:        makeclean
Date:        2014-03-27 00:55:13
Summary:     added CGM_FLAGS to makefile

Affected #:  1 file

diff --git a/test/dagmc/Makefile.am b/test/dagmc/Makefile.am
index 36aa48e..2ee4a3a 100644
--- a/test/dagmc/Makefile.am
+++ b/test/dagmc/Makefile.am
@@ -18,10 +18,10 @@ TESTS = dagmc_simple_test \
 check_PROGRAMS = $(TESTS)
 
 dagmc_simple_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_simple_test.cpp
-dagmc_simple_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) 
+dagmc_simple_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) $(CGM_LIBS)
 dagmc_rayfire_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_rayfire_test.cpp
-dagmc_rayfire_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
+dagmc_rayfire_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) $(CGM_LIBS)
 dagmc_pointinvol_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_pointinvol_test.cpp
-dagmc_pointinvol_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS)
+dagmc_pointinvol_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) $(CGM_LIBS)
 
 


https://bitbucket.org/fathomteam/moab/commits/6cd8859f4a32/
Changeset:   6cd8859f4a32
Branch:      master
User:        gonuke
Date:        2014-03-27 03:01:30
Summary:     Merge remote-tracking branch 'makeclean/dagmc_update'

Passes all test with no-cgm, ACIS & OCC.

Affected #:  10 files

diff --git a/MeshFiles/unittest/dagmc/test_geom.h5m b/MeshFiles/unittest/dagmc/test_geom.h5m
new file mode 100644
index 0000000..18e1d36
Binary files /dev/null and b/MeshFiles/unittest/dagmc/test_geom.h5m differ

diff --git a/configure.ac b/configure.ac
index 82bf72b..29623de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1223,6 +1223,7 @@ AC_CONFIG_FILES([Makefile
                  src/parallel/Makefile
                  src/oldinc/Makefile
                  test/Makefile
+		 test/dagmc/Makefile
                  test/h5file/Makefile
                  test/dual/Makefile
                  test/obb/Makefile

diff --git a/test/Makefile.am b/test/Makefile.am
index 631e126..c31ac87 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = . io dual obb perf
+SUBDIRS = . io dual obb perf dagmc
 if HDF5_FILE
   SUBDIRS += h5file
 endif

diff --git a/test/dagmc/Makefile.am b/test/dagmc/Makefile.am
new file mode 100644
index 0000000..2ee4a3a
--- /dev/null
+++ b/test/dagmc/Makefile.am
@@ -0,0 +1,27 @@
+LDADD = $(top_builddir)/src/libMOAB.la $(top_builddir)/tools/dagmc/DagMC.lo
+
+MESHDIR = $(top_srcdir)/MeshFiles/unittest
+
+AM_CPPFLAGS += -DSRCDIR=$(srcdir) \
+               -DMESHDIR=$(MESHDIR) \
+               -I$(builddir) -I.. -I$(srcdir)/.. \
+               -I$(top_builddir)/src \
+               -I$(top_srcdir)/src \
+               -I$(top_srcdir)/src/io \
+               -I$(top_srcdir)/src/parallel \
+               -I$(top_srcdir)/tools/dagmc 
+
+TESTS = dagmc_simple_test \
+        dagmc_rayfire_test \
+        dagmc_pointinvol_test
+
+check_PROGRAMS = $(TESTS)
+
+dagmc_simple_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_simple_test.cpp
+dagmc_simple_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) $(CGM_LIBS)
+dagmc_rayfire_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_rayfire_test.cpp
+dagmc_rayfire_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) $(CGM_LIBS)
+dagmc_pointinvol_test_SOURCES = $(srcdir)/../TestUtil.hpp dagmc_pointinvol_test.cpp
+dagmc_pointinvol_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CXXFLAGS) $(CGM_LIBS)
+
+

diff --git a/test/dagmc/dagmc_pointinvol_test.cpp b/test/dagmc/dagmc_pointinvol_test.cpp
new file mode 100644
index 0000000..a540b63
--- /dev/null
+++ b/test/dagmc/dagmc_pointinvol_test.cpp
@@ -0,0 +1,454 @@
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+#include "DagMC.hpp"
+
+using namespace moab;
+
+using moab::DagMC;
+
+#define DAG DagMC::instance()
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+#ifdef MESHDIR
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#endif
+
+
+void dagmc_setup_test() 
+{
+  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
+  CHECK_ERR(rval);
+  rval = DAG->init_OBBTree();
+  CHECK_ERR(rval);
+
+  int num_vols = DAG->num_entities(3); 
+  EntityHandle vol;
+  EntityHandle volume = 12682136550675316765;
+  for ( int i = 0 ; i < num_vols ; i++ )
+    {
+      vol = DAG->entity_by_index(3,i);
+    }
+  CHECK_EQUAL(volume,vol);
+}
+
+void dagmc_point_in()
+{
+  int result = 0;
+  double xyz[3]={0.0,0.0,0.0};
+  EntityHandle volume = 12682136550675316765;
+  ErrorCode rval = DAG->point_in_volume(volume,xyz,result);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_1()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={-1.0,0.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_2()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,0.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_3()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,-1.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_4()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,1.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+  
+void dagmc_point_in_vol_5()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,0.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_in_vol_6()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 0.0,0.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_1()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_2()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_3()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_4()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_5()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,-1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_6()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,-1.0,1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_7()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ 1.0,-1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_point_on_corner_8()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={ -1.0,-1.0,-1.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  // normalise the vector
+  double dir_norm = (dir[0]*dir[0])+(dir[1]*dir[1])+(dir[2]*dir[2]);
+
+  dir[0]=dir[0]/sqrt(dir_norm);
+  dir[1]=dir[1]/sqrt(dir_norm);
+  dir[2]=dir[2]/sqrt(dir_norm);
+
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl;
+
+  rval = DAG->point_in_volume(volume,xyz,result,dir);
+  CHECK_ERR(rval);
+  CHECK_EQUAL(1,result);
+}
+
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  result += RUN_TEST( dagmc_setup_test );     // setup problem
+  result += RUN_TEST( dagmc_point_in );       // point in centre
+  // rays fired along cardinal directions 
+  result += RUN_TEST( dagmc_point_in_vol_1);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_2);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_3);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_4);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_5);       // point in centre
+  result += RUN_TEST( dagmc_point_in_vol_6);       // point in centre
+  // rays fired at nodes
+  result += RUN_TEST( dagmc_point_on_corner_1); 
+  result += RUN_TEST( dagmc_point_on_corner_2); 
+  result += RUN_TEST( dagmc_point_on_corner_3); 
+  result += RUN_TEST( dagmc_point_on_corner_4); 
+
+		      //  result += RUN_TEST( dagmc_point_in({0.0,0.0,5.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({0.0,0.0,-5.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({0.0,5.0,0.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({0.0,-5.0,0.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({5.0,0.0,0.0});       // point in centre
+		      //  result += RUN_TEST( dagmc_point_in({-5.0,0.0,0.0});       // point in centre
+
+  return result;
+}

diff --git a/test/dagmc/dagmc_rayfire_test.cpp b/test/dagmc/dagmc_rayfire_test.cpp
new file mode 100644
index 0000000..28c81dd
--- /dev/null
+++ b/test/dagmc/dagmc_rayfire_test.cpp
@@ -0,0 +1,180 @@
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+#include "DagMC.hpp"
+
+using namespace moab;
+
+using moab::DagMC;
+
+#define DAG DagMC::instance()
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+#ifdef MESHDIR
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#endif
+
+double eps = 1.0e-6;
+
+void dagmc_setup_test() 
+{
+  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
+  CHECK_ERR(rval);
+  rval = DAG->init_OBBTree();
+  CHECK_ERR(rval);
+
+  int num_vols = DAG->num_entities(3); 
+  EntityHandle vol;
+  EntityHandle volume = 12682136550675316765;
+  for ( int i = 0 ; i < num_vols ; i++ )
+    {
+      vol = DAG->entity_by_index(3,i);
+    }
+  CHECK_EQUAL(volume,vol);
+}
+
+void dagmc_origin_face_rayfire()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={-1.0,0.0,0.0};
+  double origin[3]={0.0,0.0,0.0};
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire()
+{
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist);
+  std::cout << next_surf_dist << std::endl;
+  CHECK_REAL_EQUAL(15.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire_orient_exit()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0,1);
+  std::cout << next_surf_dist << std::endl;
+  CHECK_REAL_EQUAL(15.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire_orient_entrance()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0.0,-1);
+  std::cout << next_surf_dist << std::endl;
+  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps);
+}
+
+void dagmc_outside_face_rayfire_history_fail()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  history.reset(); 
+
+  // ray fired exactly along boundary shared by 2 facets on a single surface,
+  // needs to ray_fires to cross, this is expected and ok
+
+  // first ray fire with history
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0,1);
+  // second ray fire with history
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+  // this fire should hit graveyard, i.e. next_surf = 0
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+
+  // using history with this geom, there should be no next surface, i.e. 0
+  EntityHandle ZERO = 0;
+  CHECK_EQUAL(ZERO ,next_surf);
+}
+
+void dagmc_outside_face_rayfire_history()
+{
+  DagMC::RayHistory history;
+  int result = 0;
+  EntityHandle volume = 12682136550675316765;
+  double dir[3]={1.0,0.0,0.0}; // ray along x direction
+  double origin[3]={-10.0,0.0,0.0}; // origin at -10 0 0 
+  double xyz[3];
+  double next_surf_dist;
+  EntityHandle next_surf;
+
+  history.reset(); 
+  // first ray fire with history
+  ErrorCode rval = DAG->ray_fire(volume,origin,dir,next_surf,next_surf_dist,&history,0,1);
+  std::cout << next_surf << " " << history.size() << std::endl;
+  // second ray fire with history
+
+  xyz[0]=origin[0]+(next_surf_dist*dir[0]);
+  xyz[1]=origin[1]+(next_surf_dist*dir[1]);
+  xyz[2]=origin[2]+(next_surf_dist*dir[2]);
+
+  // ray fired execacyl
+
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+
+  rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist,&history,0,1);
+
+
+  // using history with this geom, there should be no next surface, i.e. 0
+  EntityHandle ZERO = 0;
+  CHECK_EQUAL(ZERO ,next_surf);
+}
+
+
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  result += RUN_TEST( dagmc_setup_test );     // setup problem
+  // rays fired along cardinal directions 
+  result += RUN_TEST( dagmc_origin_face_rayfire );       // point in centre
+  result += RUN_TEST( dagmc_outside_face_rayfire );
+  result += RUN_TEST( dagmc_outside_face_rayfire_orient_exit ); // fire ray from point outside volume looking for exit intersections
+  result += RUN_TEST( dagmc_outside_face_rayfire_orient_entrance ); // fire ray from point outside volume looking for entrance intersection
+  result += RUN_TEST( dagmc_outside_face_rayfire_history_fail ); // fire ray from point outside geometry using ray history
+  result += RUN_TEST( dagmc_outside_face_rayfire_history ); // fire ray from point outside geometry using ray history
+
+  return result;
+}

diff --git a/test/dagmc/dagmc_simple_test.cpp b/test/dagmc/dagmc_simple_test.cpp
new file mode 100644
index 0000000..3a0c925
--- /dev/null
+++ b/test/dagmc/dagmc_simple_test.cpp
@@ -0,0 +1,126 @@
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+#include "DagMC.hpp"
+
+using namespace moab;
+
+using moab::DagMC;
+
+#define DAG DagMC::instance()
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+#ifdef MESHDIR
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/dagmc/test_geom.h5m";
+#endif
+
+
+void dagmc_load_file() 
+{
+  ErrorCode rval = DAG->load_file(input_file); // open the Dag file
+  CHECK_ERR(rval);
+}
+
+void dagmc_build_obb() 
+{
+  ErrorCode rval = DAG->init_OBBTree();
+  CHECK_ERR(rval);
+}
+
+void dagmc_num_vols()
+{
+  int num_vols = DAG->num_entities(3); 
+  CHECK_EQUAL(2,num_vols);
+}
+
+void dagmc_entity_handle()
+{
+  int num_vols = DAG->num_entities(3); 
+  EntityHandle vol;
+  EntityHandle volume = 12682136550675316765;
+  for ( int i = 0 ; i < num_vols ; i++ )
+    {
+      vol = DAG->entity_by_index(3,i);
+    }
+  CHECK_EQUAL(volume,vol);
+}
+
+void dagmc_point_in()
+{
+  int result = 0;
+  double xyz[3]={0.0,0.0,0.0};
+  EntityHandle volume = 12682136550675316765;
+  ErrorCode rval = DAG->point_in_volume(volume,xyz,result);
+  CHECK_EQUAL(1,result);
+}
+
+void dagmc_rayfire()
+{
+  const double eps = 1e-6; // epsilon for test, faceting tol?
+
+  // note model is cube of side 10, centred at 0,0,0, so ray fire along
+  // any unit direction should be exactly 5.0
+  double xyz[3]={0.0,0.0,0.0};
+  double dir[3]={0.0,0.0,1.0}; 
+  EntityHandle next_surf;
+  double next_surf_dist;
+  EntityHandle volume = 12682136550675316765;
+
+  ErrorCode rval = DAG->ray_fire(volume,xyz,dir,next_surf,next_surf_dist);
+  CHECK_REAL_EQUAL(5.0,next_surf_dist,eps); 
+}
+
+void dagmc_closest_to()
+{
+  const double eps = 1e-6; // epsilon for test, faceting tol?
+
+  // note model is cube of side 10, centred at 0,0,0, so ray fire along
+  // any unit direction should be exactly 5.0
+  double xyz[3]={-6.0,0.0,0.0};
+  double distance; // distance from point to nearest surface
+  EntityHandle volume = 12682136550675316765;
+
+  ErrorCode rval = DAG->closest_to_location(volume,xyz,distance);
+  // distance should be 1.0 cm
+  CHECK_REAL_EQUAL(1.0,distance,eps); 
+}
+
+void dagmc_test_boundary()
+{
+  EntityHandle volume = 12682136550675316765;
+  EntityHandle surf   = 12682136550675316759;
+  double xyz[3]={0.0,0.0,5.0};
+  double dir[3]={0.0,0.0,1.0}; 
+  int result;
+  
+  ErrorCode rval = DAG->test_volume_boundary(volume,surf,xyz,dir,result);
+  // check ray leaving volume
+  CHECK_EQUAL(0,result);  
+}
+  
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  result += RUN_TEST( dagmc_load_file );     // test ray fire
+  result += RUN_TEST( dagmc_build_obb );     // build the obb
+  result += RUN_TEST( dagmc_num_vols  );     // make sure the num of vols correct
+  result += RUN_TEST( dagmc_entity_handle);  // check the entity handle correct
+  result += RUN_TEST( dagmc_point_in);       // check entity by point
+  result += RUN_TEST( dagmc_rayfire ) ;      // ensure ray fire distance is correct
+  result += RUN_TEST( dagmc_closest_to );    // check the distance to surface nearest point
+  result += RUN_TEST( dagmc_test_boundary ); // check particle entering leaving
+
+  return result;
+}

diff --git a/tools/dagmc/DagMC.cpp b/tools/dagmc/DagMC.cpp
index 87f84cb..6e2260a 100755
--- a/tools/dagmc/DagMC.cpp
+++ b/tools/dagmc/DagMC.cpp
@@ -536,6 +536,7 @@ ErrorCode DagMC::ray_fire(const EntityHandle vol,
                           const double point[3], const double dir[3],
                           EntityHandle& next_surf, double& next_surf_dist,
                           RayHistory* history, double user_dist_limit,
+			  int ray_orientation, 
                           OrientedBoxTreeTool::TrvStats* stats ) { 
 
   // take some stats that are independent of nps
@@ -591,9 +592,6 @@ ErrorCode DagMC::ray_fire(const EntityHandle vol,
   // min_tolerance_intersections is passed but not used in this call
   const int min_tolerance_intersections = 0;
 
-  // only get exit intersections
-  const int desired_orientation = 1;
-
   // numericalPrecision is used for box.intersect_ray and find triangles in the
   // neighborhood of edge/node intersections.
   rval = obbTree.ray_intersect_sets( dists, surfs, facets,
@@ -601,7 +599,7 @@ ErrorCode DagMC::ray_fire(const EntityHandle vol,
                                      min_tolerance_intersections,
                                      point, dir, &nonneg_ray_len,
                                      stats, &neg_ray_len, &vol, &senseTag, 
-                                     &desired_orientation, 
+                                     &ray_orientation, 
                                      history ? &(history->prev_facets) : NULL );
   assert( MB_SUCCESS == rval );
   if(MB_SUCCESS != rval) return rval;

diff --git a/tools/dagmc/DagMC.hpp b/tools/dagmc/DagMC.hpp
index 9e71601..fe39082 100755
--- a/tools/dagmc/DagMC.hpp
+++ b/tools/dagmc/DagMC.hpp
@@ -170,6 +170,9 @@ public:
    *                by this query will also be added to the history.
    * @param dist_limit Optional distance limit.  If provided and > 0, no intersections at a 
    *                distance further than this value will be returned.
+   * @param ray_orientation Optional ray orientation. If provided determines intersections 
+   *                along the normal provided, e.g. if -1 allows intersections back along the
+   *                the ray direction, Default is 1, i.e. exit intersections
    * @param stats Optional TrvStats object used to measure performance of underlying OBB
    *              ray-firing query.  See OrientedBoxTreeTool.hpp for details.
    * 
@@ -178,6 +181,7 @@ public:
                      const double ray_start[3], const double ray_dir[3],
                      EntityHandle& next_surf, double& next_surf_dist,
                      RayHistory* history = NULL, double dist_limit = 0,
+		     int ray_orientation = 1, 
                      OrientedBoxTreeTool::TrvStats* stats = NULL );
   
   /**\brief Test if a point is inside or outside a volume 

diff --git a/tools/dagmc/ray_fire_test.cc b/tools/dagmc/ray_fire_test.cc
index 7e5ce30..cc73a38 100644
--- a/tools/dagmc/ray_fire_test.cc
+++ b/tools/dagmc/ray_fire_test.cc
@@ -277,7 +277,8 @@ int main( int argc, char* argv[] )
       ray_t ray = rays[i];
       std::cout << " Ray: point = " << ray.p << " dir = " << ray.v << std::endl;
 
-      rval = dagmc.ray_fire( vol, ray.p.array(), ray.v.array(), surf, dist, NULL, 0, trv_stats );
+      // added ray orientation
+      rval = dagmc.ray_fire( vol, ray.p.array(), ray.v.array(), surf, dist, NULL, 0, 1, trv_stats );
 
       if(MB_SUCCESS != rval) {
         std::cerr << "ERROR: ray_fire() failed!" << std::endl;
@@ -326,8 +327,8 @@ int main( int argc, char* argv[] )
               << " " << uvw << " " << uvw%uvw << std::endl;
     uavg += uvw[0]; vavg += uvw[1]; wavg += uvw[2];
 #endif
-    
-    dagmc.ray_fire(vol, xyz.array(), uvw.array(), surf, dist, NULL, 0, trv_stats );
+    // added ray orientation
+    dagmc.ray_fire(vol, xyz.array(), uvw.array(), surf, dist, NULL, 0, 1, trv_stats );
 
     if( surf == 0){ random_rays_missed++; }

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list