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

bmsmith6 at wisc.edu bmsmith6 at wisc.edu
Wed Aug 25 14:11:34 CDT 2010


Author: bmsmith
Date: 2010-08-25 14:11:34 -0500 (Wed, 25 Aug 2010)
New Revision: 4108

Modified:
   MOAB/trunk/tools/dagmc/cub2h5m.cc
Log:
-Add facet_tolerance to ACIS file import. Increasing the facet_tolerance beyond the
default (0.001 cm) will result in more accurate mass conservation.
-Replace geometric test used to determine sense of quad faces wrt hex elements.
It should be a logical operation, as exists in MOAB's CN.hpp.



Modified: MOAB/trunk/tools/dagmc/cub2h5m.cc
===================================================================
--- MOAB/trunk/tools/dagmc/cub2h5m.cc	2010-08-20 22:54:53 UTC (rev 4107)
+++ MOAB/trunk/tools/dagmc/cub2h5m.cc	2010-08-25 19:11:34 UTC (rev 4108)
@@ -1,6 +1,7 @@
 #include "GeometryQueryTool.hpp"
 #include "InitCGMA.hpp"
 #include "CGMApp.hpp"
+#include "moab/CN.hpp"
 #include "moab/Core.hpp"
 #include "moab/CartVect.hpp"
 #include "cubfile.h"
@@ -332,51 +333,30 @@
     if(MB_SUCCESS != result) return result;
     if(1 != adj_elem.size()) return MB_INVALID_SIZE;
         
-    // get center of element
+    // get connectivity for element and face
     const EntityHandle *elem_conn;
-    int n_nodes;   
-    result = MBI->get_connectivity( adj_elem.front(), elem_conn, n_nodes );
+    int elem_n_nodes;   
+    result = MBI->get_connectivity( adj_elem.front(), elem_conn, elem_n_nodes );
     if(MB_SUCCESS != result) return result;
-    CartVect elem_coords[n_nodes];
-    result = MBI->get_coords( elem_conn, n_nodes, elem_coords[0].array() );
-    if(MB_SUCCESS != result) return result;
-    CartVect elem_center(0.0);
-    for(int j=0; j<n_nodes; ++j) elem_center += elem_coords[j];
-    elem_center /= n_nodes;
-
-    // get the center of the face
     const EntityHandle *face_conn;
-    result = MBI->get_connectivity( *i, face_conn, n_nodes );
+    int face_n_nodes;
+    result = MBI->get_connectivity( *i, face_conn, face_n_nodes );
     if(MB_SUCCESS != result) return result;
-    CartVect face_coords[n_nodes];
-    result = MBI->get_coords( face_conn, n_nodes, face_coords[0].array() );
-    if(MB_SUCCESS != result) return result;
-    assert(4 == n_nodes);
-    CartVect face_center(0.0);
-    for(int j=0; j<n_nodes; ++j) face_center += face_coords[j];
-    face_center /= n_nodes;
-    if(debug) std::cout << "      center of mesh face exposed by dead element=" 
-                        << face_center << std::endl;
 
-    // get the normal of the face
-    CartVect face_normal, a, b;
-    a = face_coords[2] - face_coords[1];
-    b = face_coords[0] - face_coords[1];


More information about the moab-dev mailing list