[MOAB-dev] commit/MOAB: danwu: A compile error is fixed for examples/point_in_elem_search.cpp. This regression is caused by change to src/moab/SpatialLocator.hpp (commit 4d437a5 on 2013-11-27)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Feb 6 11:07:30 CST 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/e7583dca6d11/
Changeset:   e7583dca6d11
Branch:      master
User:        danwu
Date:        2014-02-06 18:02:36
Summary:     A compile error is fixed for examples/point_in_elem_search.cpp. This regression is caused by change to src/moab/SpatialLocator.hpp (commit 4d437a5 on 2013-11-27)
1) Signature of locate_point() has been updated. The corresponding function call should also be updated in point_in_elem_search.cpp.
2) locate_point() is now private. It should be set back to public so that it can be called by point_in_elem_search.cpp.
A small bug in point_in_elem_search.cpp is also fixed:
The file to be loaded should be argv[1], instead of argv[argc-1].

Affected #:  2 files

diff --git a/examples/point_in_elem_search.cpp b/examples/point_in_elem_search.cpp
index a917fa0..ce22928 100644
--- a/examples/point_in_elem_search.cpp
+++ b/examples/point_in_elem_search.cpp
@@ -27,7 +27,7 @@ int main(int argc, char **argv) {
 
   int num_queries = 1000000;
   
-  if (argc == 1) {
+  if (argc < 2 || argc > 3) {
     std::cout << "Usage: " << argv[0] << "<filename> [num_queries]" << std::endl;
     return 0;
   }
@@ -37,7 +37,7 @@ int main(int argc, char **argv) {
   moab::Core mb;
 
     // load the file
-  ErrorCode rval = mb.load_file(argv[argc-1]); ERR("Error loading file");
+  ErrorCode rval = mb.load_file(argv[1]); ERR("Error loading file");
   
     // get all 3d elements in the file
   Range elems;
@@ -66,7 +66,7 @@ int main(int argc, char **argv) {
   for (int i = 0; i < num_queries; i++) {
     pos = box.bMin + 
         CartVect(box_extents[0]*.01*(rand()%100), box_extents[1]*.01*(rand()%100), box_extents[2]*.01*(rand()%100));
-    ErrorCode tmp_rval = sl.locate_point(pos.array(), elem, params.array(), 0.0, 0.0, &is_inside);
+    ErrorCode tmp_rval = sl.locate_point(pos.array(), elem, params.array(), &is_inside, 0.0, 0.0);
     if (MB_SUCCESS != tmp_rval) rval = tmp_rval;
     if (is_inside) num_inside++;
   }

diff --git a/src/moab/SpatialLocator.hpp b/src/moab/SpatialLocator.hpp
index bb639d0..e8ab5cf 100644
--- a/src/moab/SpatialLocator.hpp
+++ b/src/moab/SpatialLocator.hpp
@@ -121,6 +121,12 @@ namespace moab {
                               const double inside_tol = 1.0e-6);
 #endif
 
+        /* locate a point */
+      ErrorCode locate_point(const double *pos, 
+                             EntityHandle &ent, double *params, bool *is_inside = NULL,
+                              const double rel_iter_tol = 1.0e-10, const double abs_iter_tol = 1.0e-10,
+                              const double inside_tol = 1.0e-6);
+
         /* return the tree */
       Tree *get_tree() {return myTree;}
 
@@ -151,12 +157,6 @@ namespace moab {
       
   private:
 
-        /* locate a point */
-      ErrorCode locate_point(const double *pos, 
-                             EntityHandle &ent, double *params, bool *is_inside = NULL,
-                              const double rel_iter_tol = 1.0e-10, const double abs_iter_tol = 1.0e-10,
-                              const double inside_tol = 1.0e-6);
-
         /* MOAB instance */
       Interface* mbImpl;

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