[MOAB-dev] r4337 - in MOAB/trunk: src src/io test

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Dec 7 15:32:14 CST 2010


Author: tautges
Date: 2010-12-07 15:32:14 -0600 (Tue, 07 Dec 2010)
New Revision: 4337

Modified:
   MOAB/trunk/src/ScdElementData.hpp
   MOAB/trunk/src/io/ReadNC.cpp
   MOAB/trunk/src/io/ReadNC.hpp
   MOAB/trunk/test/scdseq_test.cpp
Log:
Create quad or hex elements for NC data.

Also fixed a bug in ScdElementSeq::contains; in the case of a 1d/2d sequence,
j/k parameter should test for <= instead of <, since there is no extent in that/those
parameters.  Added code to scdseq test that caught this.

Passes make check.



Modified: MOAB/trunk/src/ScdElementData.hpp
===================================================================
--- MOAB/trunk/src/ScdElementData.hpp	2010-12-07 19:00:00 UTC (rev 4336)
+++ MOAB/trunk/src/ScdElementData.hpp	2010-12-07 21:32:14 UTC (rev 4337)
@@ -203,8 +203,10 @@
 inline bool ScdElementData::contains(const HomCoord &temp) const 
 {
     // upper bound is < instead of <= because element params max is one less
-    // than vertex params max
-  return (temp >= elementParams[0] && temp < elementParams[1]);
+    // than vertex params max, except in case of 2d or 1d sequence
+  return (temp >= elementParams[0] && 
+          ((!dIJKm1[1] && temp.j() == elementParams[1].j()) || (dIJKm1[1] && temp.j() < elementParams[1].j())) &&
+          ((!dIJKm1[2] && temp.k() == elementParams[1].k()) || (dIJKm1[2] && temp.k() < elementParams[1].k())));
 }
   
 inline bool ScdElementData::VertexDataRef::contains(const HomCoord &coords) const 

Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2010-12-07 19:00:00 UTC (rev 4336)
+++ MOAB/trunk/src/io/ReadNC.cpp	2010-12-07 21:32:14 UTC (rev 4337)
@@ -15,6 +15,7 @@
 #include "moab/ReadUtilIface.hpp"
 #include "MBTagConventions.hpp"
 #include "SequenceManager.hpp"
+#include "StructuredElementSeq.hpp"
 #include "VertexSequence.hpp"
 #include "FileOptions.hpp"
 
@@ -99,23 +100,18 @@
   rval = read_header();
   ERRORR(rval, " ");
 
+    // 2. Get bounds on ijk space
   rval = init_ijk_vals(opts);
   ERRORR(rval, "Trouble initializing ijk values.");
 
-  rval = create_verts();
+    // 3. Create structured mesh vertex/hex sequences
+  rval = create_verts_hexes();
   ERRORR(rval, "Trouble creating vertices.");
-/*  
-  status = mdbImpl->get_entities_by_handle(0, initRange);
-  if (MB_FAILURE == status) return status;
 
-    // 2. Read/create nodes and elements
-  status = read_nodes_elements(file_id_tag);
-  if (MB_FAILURE == status) return status;
- 
     // 3. Read variables onto grid


More information about the moab-dev mailing list