[MOAB-dev] r4224 - MOAB/trunk/itaps/imesh

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon Oct 18 17:10:22 CDT 2010


Author: kraftche
Date: 2010-10-18 17:10:22 -0500 (Mon, 18 Oct 2010)
New Revision: 4224

Added:
   MOAB/trunk/itaps/imesh/MOAB_iMesh_unit_tests.cpp
Modified:
   MOAB/trunk/itaps/imesh/Makefile.am
Log:
add more rigorous tests of iMesh_getEntArrAdj in an attempt to reproduce bug seen by Mark Miller

Added: MOAB/trunk/itaps/imesh/MOAB_iMesh_unit_tests.cpp
===================================================================
--- MOAB/trunk/itaps/imesh/MOAB_iMesh_unit_tests.cpp	                        (rev 0)
+++ MOAB/trunk/itaps/imesh/MOAB_iMesh_unit_tests.cpp	2010-10-18 22:10:22 UTC (rev 4224)
@@ -0,0 +1,384 @@
+#include "TestRunner.hpp"
+#include "iMesh.h"
+#include <algorithm>
+
+void test_getEntArrAdj_conn();
+void test_getEntArrAdj_vertex();
+void test_getEntArrAdj_up();
+void test_getEntArrAdj_down();
+void test_getEntArrAdj_invalid_size();
+void test_getEntArrAdj_none();
+
+int main( int argc, char* argv[] )
+{
+  REGISTER_TEST( test_getEntArrAdj_conn );
+  REGISTER_TEST( test_getEntArrAdj_vertex );
+  REGISTER_TEST( test_getEntArrAdj_up );
+  REGISTER_TEST( test_getEntArrAdj_down );
+  REGISTER_TEST( test_getEntArrAdj_invalid_size );
+  REGISTER_TEST( test_getEntArrAdj_none );
+
+  return RUN_TESTS( argc, argv ); 
+}
+
+// INTERVAL x INTERVAL x INTERVAL regular hex mesh with skin faces.
+// Vertices are located at even coordinate
+// values and adjacent vertices are separated by one unit.  The entire
+// grid is in the first octant with the first vertex at the origin.
+// Faces are grouped by the side of the grid that they occur in.
+// The faces are { -Y, X, Y, -X, -Z, Z }.
+const int INTERVALS = 2;
+iBase_EntityHandle VERTS[INTERVALS+1][INTERVALS+1][INTERVALS+1];
+iBase_EntityHandle HEXES[INTERVALS][INTERVALS][INTERVALS];
+iBase_EntityHandle FACES[6][INTERVALS][INTERVALS];
+
+static void HEX_VERTS( int i, int j, int k, iBase_EntityHandle conn[8] ) {
+  conn[0] = VERTS[i  ][j  ][k  ];
+  conn[1] = VERTS[i+1][j  ][k  ];
+  conn[2] = VERTS[i+1][j+1][k  ];
+  conn[3] = VERTS[i  ][j+1][k  ];
+  conn[4] = VERTS[i  ][j  ][k+1];
+  conn[5] = VERTS[i+1][j  ][k+1];
+  conn[6] = VERTS[i+1][j+1][k+1];
+  conn[7] = VERTS[i  ][j+1][k+1];
+}
+
+static void QUAD_VERTS( int f, int i, int j, iBase_EntityHandle conn[4] ) {


More information about the moab-dev mailing list