[MOAB-dev] r3828 - in MOAB/trunk: src/io test/io
bmsmith6 at wisc.edu
bmsmith6 at wisc.edu
Sat May 1 00:53:35 CDT 2010
Author: bmsmith
Date: 2010-05-01 00:53:35 -0500 (Sat, 01 May 2010)
New Revision: 3828
Added:
MOAB/trunk/test/io/ideas_test.cc
MOAB/trunk/test/io/test.unv
Modified:
MOAB/trunk/src/io/ReadIDEAS.cpp
MOAB/trunk/src/io/ReadIDEAS.hpp
MOAB/trunk/test/io/Makefile.am
Log:
?\226?\128?\162 Previous version only supported tet elements. Added support for tri, quad, hex, and prism elements.
?\226?\128?\162 Documented sources of information about this format.
?\226?\128?\162 Elements are added to material sets instead of individually being tagged.
?\226?\128?\162 Added sample file with unit tests.
Modified: MOAB/trunk/src/io/ReadIDEAS.cpp
===================================================================
--- MOAB/trunk/src/io/ReadIDEAS.cpp 2010-04-30 20:56:15 UTC (rev 3827)
+++ MOAB/trunk/src/io/ReadIDEAS.cpp 2010-05-01 05:53:35 UTC (rev 3828)
@@ -2,6 +2,7 @@
#include <fstream>
#include <vector>
#include <cstdlib>
+#include <sstream>
#include "assert.h"
#include "ReadIDEAS.hpp"
@@ -9,7 +10,9 @@
#include "Internals.hpp"
#include "moab/ReadUtilIface.hpp"
#include "FileTokenizer.hpp"
+#include "MBTagConventions.hpp"
#include "moab/Range.hpp"
+#include "moab/CN.hpp"
namespace moab {
@@ -66,28 +69,31 @@
while (! file.eof() ) {
file.getline(line, 10000);
s = line;
+ unsigned int header_id = (unsigned int) strtol(line, NULL, 10);
- unsigned int header_id = (unsigned int) strtol(line, NULL, 10);
- switch (header_id) {
- case VERTEX_LIST :
+ // create vertices
+ if( DOUBLE_PRECISION_NODES0==header_id ||
+ DOUBLE_PRECISION_NODES1==header_id ) {
if (first_vertex) // multiple vertex blocks?
return MB_FAILURE;
- rval = create_vertices( first_vertex, file_id_tag );
- break;
- case MAKE_TETRAHEDRA :
+ rval = create_vertices( first_vertex, file_id_tag );
+ }
+ // create elements
+ else if(ELEMENTS0==header_id ||
+ ELEMENTS1==header_id ||
+ ELEMENTS2==header_id) {
if (!first_vertex) // need to read vertices first
return MB_FAILURE;
- rval = create_tetrahedral_elements( first_vertex, file_id_tag );
- break;
- default:
- rval = skip_header();
More information about the moab-dev
mailing list