[MOAB-dev] commit/MOAB: danwu: Merged master into error_handling_enhancement

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Feb 12 10:45:15 CST 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/e8f3b0681974/
Changeset:   e8f3b0681974
Branch:      error_handling_enhancement
User:        danwu
Date:        2014-02-12 17:45:08
Summary:     Merged master into error_handling_enhancement
Affected #:  29 files

diff --git a/.gitignore b/.gitignore
index d842c2b..f909fa9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -155,6 +155,7 @@ test/io/gmsh_test
 test/io/ideas_test
 test/io/nastran_test
 test/io/read_cgm_test
+test/io/read_mpas_nc
 test/io/read_nc
 test/io/read_ucd_nc
 test/io/readutil_test
@@ -176,7 +177,6 @@ test/obb/obb_time
 test/obb/obb_tree_tool
 test/obb_test
 test/oldinc/test_oldinc
-test/read_mpas_nc
 test/parallel/*.h5m
 test/parallel/mbparallelcomm_test
 test/parallel/mhdf_parallel

diff --git a/MeshFiles/unittest/io/cube.sat b/MeshFiles/unittest/io/cube.sat
new file mode 100644
index 0000000..58fd508
--- /dev/null
+++ b/MeshFiles/unittest/io/cube.sat
@@ -0,0 +1,117 @@
+1900 0 1 0           
+10 Cubit 12.2 17 ACIS 19.0.2 Linux 24 Mon Jan  6 14:16:03 2014 
+1 9.9999999999999995e-07 1e-10 
+body $1 -1 -1 $-1 $2 $-1 $-1 T -5 -5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $0 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+lump $3 -1 -1 $-1 $-1 $4 $0 T -5 -5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+shell $-1 -1 -1 $-1 $-1 $-1 $5 $-1 $2 T -5 -5 -5 5 5 5 #
+face $6 -1 -1 $-1 $7 $8 $4 $-1 $9 forward single T -5 -5 5 5 5 5 F #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $5 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+face $10 -1 -1 $-1 $11 $12 $4 $-1 $13 reversed single T -5 -5 -5 5 5 -5 F #
+loop $-1 -1 -1 $-1 $-1 $14 $5 T -5 -5 5 5 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 0 0 5 0 0 1 1 0 0 forward_v I I I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $7 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+face $15 -1 -1 $-1 $16 $17 $4 $-1 $18 reversed single T -5 -5 -5 5 -5 5 F #
+loop $-1 -1 -1 $-1 $-1 $19 $7 T -5 -5 -5 5 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 0 0 -5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $20 $21 $22 $23 forward $8 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $11 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+face $24 -1 -1 $-1 $25 $26 $4 $-1 $27 reversed single T -5 -5 -5 -5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $28 $11 T -5 -5 -5 5 -5 5 unknown #
+plane-surface $-1 -1 -1 $-1 0 -5 0 0 1 -0 -0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $29 $30 $31 $32 forward $12 $-1 #
+coedge $-1 -1 -1 $-1 $33 $14 $34 $35 forward $8 $-1 #
+coedge $-1 -1 -1 $-1 $14 $33 $36 $37 forward $8 $-1 #
+coedge $-1 -1 -1 $-1 $38 $39 $14 $23 reversed $40 $-1 #
+edge $41 -1 -1 $-1 $42 -5 $43 5 $22 $44 forward @7 unknown T 5 -5 5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $16 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+face $45 -1 -1 $-1 $46 $47 $4 $-1 $48 reversed single T -5 5 -5 5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $49 $16 T -5 -5 -5 -5 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 -5 0 0 1 0 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $50 $36 $51 $52 forward $17 $-1 #
+coedge $-1 -1 -1 $-1 $53 $19 $50 $54 forward $12 $-1 #
+coedge $-1 -1 -1 $-1 $19 $53 $55 $56 forward $12 $-1 #
+coedge $-1 -1 -1 $-1 $39 $38 $19 $32 reversed $40 $-1 #
+edge $57 -1 -1 $-1 $58 -5 $59 5 $31 $60 forward @7 unknown T 5 -5 -5 5 5 -5 #
+coedge $-1 -1 -1 $-1 $21 $20 $61 $62 forward $8 $-1 #
+coedge $-1 -1 -1 $-1 $63 $64 $20 $35 reversed $47 $-1 #
+edge $65 -1 -1 $-1 $43 -5 $66 5 $34 $67 forward @7 unknown T -5 5 5 5 5 5 #
+coedge $-1 -1 -1 $-1 $28 $68 $21 $37 reversed $17 $-1 #
+edge $69 -1 -1 $-1 $70 -5 $42 5 $36 $71 forward @7 unknown T -5 -5 5 5 -5 5 #
+coedge $-1 -1 -1 $-1 $31 $22 $68 $72 forward $40 $-1 #
+coedge $-1 -1 -1 $-1 $22 $31 $63 $73 reversed $40 $-1 #
+loop $-1 -1 -1 $-1 $-1 $38 $46 T 5 -5 -5 5 5 5 unknown #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $23 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+vertex $74 -1 -1 $-1 $23 $75 #
+vertex $76 -1 -1 $-1 $23 $77 #
+straight-curve $-1 -1 -1 $-1 5 0 5 0 1 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $25 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+face $78 -1 -1 $-1 $-1 $40 $4 $-1 $79 reversed single T 5 -5 -5 5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $63 $25 T -5 5 -5 5 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 0 5 0 0 -1 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $80 $61 $64 $81 forward $26 $-1 #
+coedge $-1 -1 -1 $-1 $68 $28 $29 $54 reversed $17 $-1 #
+coedge $-1 -1 -1 $-1 $61 $80 $28 $52 reversed $26 $-1 #
+edge $82 -1 -1 $-1 $70 -5 $83 5 $51 $84 forward @7 unknown T -5 -5 -5 -5 -5 5 #
+coedge $-1 -1 -1 $-1 $30 $29 $80 $85 forward $12 $-1 #
+edge $86 -1 -1 $-1 $59 -5 $83 5 $50 $87 forward @7 unknown T -5 -5 -5 5 -5 -5 #
+coedge $-1 -1 -1 $-1 $64 $63 $30 $56 reversed $47 $-1 #
+edge $88 -1 -1 $-1 $89 -5 $58 5 $55 $90 forward @7 unknown T -5 5 -5 5 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $32 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+vertex $91 -1 -1 $-1 $32 $92 #
+vertex $93 -1 -1 $-1 $72 $94 #
+straight-curve $-1 -1 -1 $-1 5 0 -5 0 -1 0 I I #
+coedge $-1 -1 -1 $-1 $49 $51 $33 $62 reversed $26 $-1 #
+edge $95 -1 -1 $-1 $66 -5 $70 5 $61 $96 forward @7 unknown T -5 -5 5 -5 5 5 #
+coedge $-1 -1 -1 $-1 $55 $34 $39 $73 forward $47 $-1 #
+coedge $-1 -1 -1 $-1 $34 $55 $49 $81 reversed $47 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $35 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+vertex $97 -1 -1 $-1 $35 $98 #
+straight-curve $-1 -1 -1 $-1 0 5 5 -1 0 0 I I #
+coedge $-1 -1 -1 $-1 $36 $50 $38 $72 reversed $17 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $37 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+vertex $99 -1 -1 $-1 $62 $100 #
+straight-curve $-1 -1 -1 $-1 0 -5 5 1 0 0 I I #
+edge $101 -1 -1 $-1 $42 -5 $59 5 $38 $102 forward @7 unknown T 5 -5 -5 5 -5 5 #
+edge $103 -1 -1 $-1 $43 -5 $58 5 $39 $104 forward @7 unknown T 5 5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $42 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+point $-1 -1 -1 $-1 5 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $43 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+point $-1 -1 -1 $-1 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $46 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+plane-surface $-1 -1 -1 $-1 5 0 0 -1 0 0 0 -0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $51 $49 $53 $85 reversed $26 $-1 #
+edge $105 -1 -1 $-1 $66 -5 $89 5 $64 $106 forward @7 unknown T -5 5 -5 -5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $52 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+vertex $107 -1 -1 $-1 $85 $108 #
+straight-curve $-1 -1 -1 $-1 -5 -5 0 0 0 -1 I I #
+edge $109 -1 -1 $-1 $83 -5 $89 5 $80 $110 forward @7 unknown T -5 -5 -5 -5 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $54 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+straight-curve $-1 -1 -1 $-1 0 -5 -5 -1 0 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $56 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+vertex $111 -1 -1 $-1 $56 $112 #
+straight-curve $-1 -1 -1 $-1 0 5 -5 1 0 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $58 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+point $-1 -1 -1 $-1 5 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $59 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 6 #
+point $-1 -1 -1 $-1 5 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $62 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+straight-curve $-1 -1 -1 $-1 -5 0 5 0 -1 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $66 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+point $-1 -1 -1 $-1 -5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $70 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+point $-1 -1 -1 $-1 -5 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $72 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+straight-curve $-1 -1 -1 $-1 5 -5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $73 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 12 #
+straight-curve $-1 -1 -1 $-1 5 5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $81 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 11 #
+straight-curve $-1 -1 -1 $-1 -5 5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $83 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+point $-1 -1 -1 $-1 -5 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $85 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+straight-curve $-1 -1 -1 $-1 -5 0 -5 0 1 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $-1 $-1 $89 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+point $-1 -1 -1 $-1 -5 5 -5 #
+End-of-ACIS-data 
\ No newline at end of file

diff --git a/MeshFiles/unittest/io/cube.stp b/MeshFiles/unittest/io/cube.stp
new file mode 100644
index 0000000..c17645d
--- /dev/null
+++ b/MeshFiles/unittest/io/cube.stp
@@ -0,0 +1,185 @@
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('STEP AP214'),'1');
+FILE_NAME('/home/iulian/source/MOABsource/MeshFiles/unittest/io/cube.stp','2014-02-11T15:06:47',(' '),(' '),'Spatial InterOp 3D',' ',' ');
+FILE_SCHEMA(('automotive_design'));
+ENDSEC;
+DATA;
+#1=PRODUCT_DEFINITION_CONTEXT('',#9,'design');
+#2=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#9);
+#3=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#10,#11);
+#4=SHAPE_DEFINITION_REPRESENTATION(#12,#13);
+#5= (GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#16))GLOBAL_UNIT_ASSIGNED_CONTEXT((#18,#19,#20))REPRESENTATION_CONTEXT('NONE','WORKSPACE'));
+#9=APPLICATION_CONTEXT(' ');
+#10=PRODUCT_CATEGORY('part','NONE');
+#11=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#22));
+#12=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#23);
+#13=ADVANCED_BREP_SHAPE_REPRESENTATION('1',(#24,#25),#5);
+#16=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-06),#18,'','');
+#18= (CONVERSION_BASED_UNIT('MILLIMETRE',#28)LENGTH_UNIT()NAMED_UNIT(#31));
+#19= (NAMED_UNIT(#33)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#20= (NAMED_UNIT(#33)SOLID_ANGLE_UNIT()SI_UNIT($,.STERADIAN.));
+#22=PRODUCT('1','1','PART-1-DESC',(#39));
+#23=PRODUCT_DEFINITION('NONE','NONE',#40,#1);
+#24=MANIFOLD_SOLID_BREP('1',#41);
+#25=AXIS2_PLACEMENT_3D('',#42,#43,#44);
+#28=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0),#45);
+#31=DIMENSIONAL_EXPONENTS(1.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#33=DIMENSIONAL_EXPONENTS(0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#39=PRODUCT_CONTEXT('',#9,'mechanical');
+#40=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#22,.NOT_KNOWN.);
+#41=CLOSED_SHELL('',(#46,#47,#48,#49,#50,#51));
+#42=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#43=DIRECTION('',(0.0,0.0,1.0));
+#44=DIRECTION('',(1.0,0.0,0.0));
+#45= (NAMED_UNIT(#31)LENGTH_UNIT()SI_UNIT(.MILLI.,.METRE.));
+#46=ADVANCED_FACE('',(#53),#54,.T.);
+#47=ADVANCED_FACE('',(#55),#56,.F.);
+#48=ADVANCED_FACE('',(#57),#58,.F.);
+#49=ADVANCED_FACE('',(#59),#60,.F.);
+#50=ADVANCED_FACE('',(#61),#62,.F.);
+#51=ADVANCED_FACE('',(#63),#64,.F.);
+#53=FACE_OUTER_BOUND('',#65,.T.);
+#54=PLANE('',#66);
+#55=FACE_OUTER_BOUND('',#67,.T.);
+#56=PLANE('',#68);
+#57=FACE_OUTER_BOUND('',#69,.T.);
+#58=PLANE('',#70);
+#59=FACE_OUTER_BOUND('',#71,.T.);
+#60=PLANE('',#72);
+#61=FACE_OUTER_BOUND('',#73,.T.);
+#62=PLANE('',#74);
+#63=FACE_OUTER_BOUND('',#75,.T.);
+#64=PLANE('',#76);
+#65=EDGE_LOOP('',(#77,#78,#79,#80));
+#66=AXIS2_PLACEMENT_3D('',#81,#82,#83);
+#67=EDGE_LOOP('',(#84,#85,#86,#87));
+#68=AXIS2_PLACEMENT_3D('',#88,#89,#90);
+#69=EDGE_LOOP('',(#91,#92,#93,#94));
+#70=AXIS2_PLACEMENT_3D('',#95,#96,#97);
+#71=EDGE_LOOP('',(#98,#99,#100,#101));
+#72=AXIS2_PLACEMENT_3D('',#102,#103,#104);
+#73=EDGE_LOOP('',(#105,#106,#107,#108));
+#74=AXIS2_PLACEMENT_3D('',#109,#110,#111);
+#75=EDGE_LOOP('',(#112,#113,#114,#115));
+#76=AXIS2_PLACEMENT_3D('',#116,#117,#118);
+#77=ORIENTED_EDGE('',*,*,#119,.T.);
+#78=ORIENTED_EDGE('',*,*,#120,.T.);
+#79=ORIENTED_EDGE('',*,*,#121,.T.);
+#80=ORIENTED_EDGE('',*,*,#122,.T.);
+#81=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#82=DIRECTION('',(0.0,0.0,1.0));
+#83=DIRECTION('',(1.0,0.0,0.0));
+#84=ORIENTED_EDGE('',*,*,#123,.T.);
+#85=ORIENTED_EDGE('',*,*,#124,.T.);
+#86=ORIENTED_EDGE('',*,*,#125,.T.);
+#87=ORIENTED_EDGE('',*,*,#126,.T.);
+#88=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#89=DIRECTION('',(0.0,0.0,1.0));
+#90=DIRECTION('',(1.0,0.0,0.0));
+#91=ORIENTED_EDGE('',*,*,#127,.T.);
+#92=ORIENTED_EDGE('',*,*,#124,.F.);
+#93=ORIENTED_EDGE('',*,*,#128,.F.);
+#94=ORIENTED_EDGE('',*,*,#122,.F.);
+#95=CARTESIAN_POINT('',(0.0,-5.0,0.0));
+#96=DIRECTION('',(0.0,1.0,-0.0));
+#97=DIRECTION('',(-0.0,0.0,1.0));
+#98=ORIENTED_EDGE('',*,*,#129,.T.);
+#99=ORIENTED_EDGE('',*,*,#125,.F.);
+#100=ORIENTED_EDGE('',*,*,#127,.F.);
+#101=ORIENTED_EDGE('',*,*,#121,.F.);
+#102=CARTESIAN_POINT('',(-5.0,0.0,0.0));
+#103=DIRECTION('',(1.0,0.0,0.0));
+#104=DIRECTION('',(0.0,0.0,-1.0));
+#105=ORIENTED_EDGE('',*,*,#130,.T.);
+#106=ORIENTED_EDGE('',*,*,#126,.F.);
+#107=ORIENTED_EDGE('',*,*,#129,.F.);
+#108=ORIENTED_EDGE('',*,*,#120,.F.);
+#109=CARTESIAN_POINT('',(0.0,5.0,0.0));
+#110=DIRECTION('',(0.0,-1.0,0.0));
+#111=DIRECTION('',(0.0,0.0,-1.0));
+#112=ORIENTED_EDGE('',*,*,#128,.T.);
+#113=ORIENTED_EDGE('',*,*,#123,.F.);
+#114=ORIENTED_EDGE('',*,*,#130,.F.);
+#115=ORIENTED_EDGE('',*,*,#119,.F.);
+#116=CARTESIAN_POINT('',(5.0,0.0,0.0));
+#117=DIRECTION('',(-1.0,0.0,0.0));
+#118=DIRECTION('',(0.0,-0.0,1.0));
+#119=EDGE_CURVE('',#131,#132,#133,.T.);
+#120=EDGE_CURVE('',#132,#134,#135,.T.);
+#121=EDGE_CURVE('',#134,#136,#137,.T.);
+#122=EDGE_CURVE('',#136,#131,#138,.T.);
+#123=EDGE_CURVE('',#139,#140,#141,.T.);
+#124=EDGE_CURVE('',#140,#142,#143,.T.);
+#125=EDGE_CURVE('',#142,#144,#145,.T.);
+#126=EDGE_CURVE('',#144,#139,#146,.T.);
+#127=EDGE_CURVE('',#136,#142,#147,.T.);
+#128=EDGE_CURVE('',#131,#140,#148,.T.);
+#129=EDGE_CURVE('',#134,#144,#149,.T.);
+#130=EDGE_CURVE('',#132,#139,#150,.T.);
+#131=VERTEX_POINT('',#151);
+#132=VERTEX_POINT('',#152);
+#133=LINE('',#153,#154);
+#134=VERTEX_POINT('',#155);
+#135=LINE('',#156,#157);
+#136=VERTEX_POINT('',#158);
+#137=LINE('',#159,#160);
+#138=LINE('',#161,#162);
+#139=VERTEX_POINT('',#163);
+#140=VERTEX_POINT('',#164);
+#141=LINE('',#165,#166);
+#142=VERTEX_POINT('',#167);
+#143=LINE('',#168,#169);
+#144=VERTEX_POINT('',#170);
+#145=LINE('',#171,#172);
+#146=LINE('',#173,#174);
+#147=LINE('',#175,#176);
+#148=LINE('',#177,#178);
+#149=LINE('',#179,#180);
+#150=LINE('',#181,#182);
+#151=CARTESIAN_POINT('',(5.0,-5.0,5.0));
+#152=CARTESIAN_POINT('',(5.0,5.0,5.0));
+#153=CARTESIAN_POINT('',(5.0,0.0,5.0));
+#154=VECTOR('',#183,1.0);
+#155=CARTESIAN_POINT('',(-5.0,5.0,5.0));
+#156=CARTESIAN_POINT('',(0.0,5.0,5.0));
+#157=VECTOR('',#184,1.0);
+#158=CARTESIAN_POINT('',(-5.0,-5.0,5.0));
+#159=CARTESIAN_POINT('',(-5.0,0.0,5.0));
+#160=VECTOR('',#185,1.0);
+#161=CARTESIAN_POINT('',(0.0,-5.0,5.0));
+#162=VECTOR('',#186,1.0);
+#163=CARTESIAN_POINT('',(5.0,5.0,-5.0));
+#164=CARTESIAN_POINT('',(5.0,-5.0,-5.0));
+#165=CARTESIAN_POINT('',(5.0,0.0,-5.0));
+#166=VECTOR('',#187,1.0);
+#167=CARTESIAN_POINT('',(-5.0,-5.0,-5.0));
+#168=CARTESIAN_POINT('',(0.0,-5.0,-5.0));
+#169=VECTOR('',#188,1.0);
+#170=CARTESIAN_POINT('',(-5.0,5.0,-5.0));
+#171=CARTESIAN_POINT('',(-5.0,0.0,-5.0));
+#172=VECTOR('',#189,1.0);
+#173=CARTESIAN_POINT('',(0.0,5.0,-5.0));
+#174=VECTOR('',#190,1.0);
+#175=CARTESIAN_POINT('',(-5.0,-5.0,0.0));
+#176=VECTOR('',#191,1.0);
+#177=CARTESIAN_POINT('',(5.0,-5.0,0.0));
+#178=VECTOR('',#192,1.0);
+#179=CARTESIAN_POINT('',(-5.0,5.0,0.0));
+#180=VECTOR('',#193,1.0);
+#181=CARTESIAN_POINT('',(5.0,5.0,0.0));
+#182=VECTOR('',#194,1.0);
+#183=DIRECTION('',(0.0,1.0,0.0));
+#184=DIRECTION('',(-1.0,0.0,0.0));
+#185=DIRECTION('',(0.0,-1.0,0.0));
+#186=DIRECTION('',(1.0,0.0,0.0));
+#187=DIRECTION('',(0.0,-1.0,0.0));
+#188=DIRECTION('',(-1.0,0.0,0.0));
+#189=DIRECTION('',(0.0,1.0,0.0));
+#190=DIRECTION('',(1.0,0.0,0.0));
+#191=DIRECTION('',(0.0,0.0,-1.0));
+#192=DIRECTION('',(0.0,0.0,-1.0));
+#193=DIRECTION('',(0.0,0.0,-1.0));
+#194=DIRECTION('',(0.0,0.0,-1.0));
+ENDSEC;
+END-ISO-10303-21;

diff --git a/config/compiler.m4 b/config/compiler.m4
index ce83a5f..4787100 100644
--- a/config/compiler.m4
+++ b/config/compiler.m4
@@ -548,6 +548,8 @@ case "$cc_compiler:$host_cpu" in
       bgq)
         FATHOM_CC_32BIT=-q32
         FATHOM_CC_64BIT=-q64
+	FATHOM_CC_SPECIAL=-qarch=qp
+	FATHOM_CXX_SPECIAL="-qarch=qp -qpic=large -qmaxmem=-1"
         AR="ar"
         NM="nm -B"
         ;;

diff --git a/examples/makefile b/examples/makefile
index c2a0c38..a7de511 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -38,7 +38,7 @@ DirectAccessNoHoles: DirectAccessNoHoles.o ${MOAB_LIBDIR}/libMOAB.la
 	${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
 
 DirectAccessNoHolesF90: DirectAccessNoHolesF90.o ${MOAB_LIBDIR}/libMOAB.la
-	${MOAB_CXX} -o $@ $< ${IMESH_LIBS}
+	${MOAB_FC} -o $@ $< ${IMESH_LIBS}
 
 ReduceExchangeTags : ReduceExchangeTags.o ${MOAB_LIBDIR}/libMOAB.la
 	${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}

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/CMakeLists.txt b/src/CMakeLists.txt
index 280b203..40f7a59 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,6 +7,7 @@
     AxisBox.cpp
     BitPage.cpp
     BitTag.cpp
+    BoundBox.cpp
     BSPTree.cpp
     BSPTreePoly.cpp
     CN.cpp
@@ -46,6 +47,8 @@
     SweptVertexData.cpp
     SysUtil.cpp
     TagInfo.cpp
+    Tree.cpp
+    TupleList.cpp
     Types.cpp
     TypeSequenceManager.cpp
     UnstructuredElemSeq.cpp
@@ -93,14 +96,27 @@
     io/WriteVtk.cpp
     ReaderWriterSet.cpp
   )
+
+  set ( MOABLD_LIB_SRCS
+    LocalDiscretization/ElemEvaluator.cpp
+    LocalDiscretization/LinearHex.cpp
+    LocalDiscretization/LinearQuad.cpp
+    LocalDiscretization/LinearTet.cpp
+    LocalDiscretization/LinearTri.cpp
+    LocalDiscretization/QuadraticHex.cpp
+#    LocalDiscretization/SpectralHex.cpp
+#    LocalDiscretization/SpectralQuad.cpp
+  ) 
+
   include_directories(
-    ${MOAB_BINARY_DIR}
     ${MOAB_SOURCE_DIR}/src
-    ${MOAB_BINARY_DIR}/src
     ${MOAB_SOURCE_DIR}/src/io
     ${MOAB_SOURCE_DIR}/src/parallel
-    ${MOAB_BINARY_DIR}/src/parallel
+    ${MOAB_SOURCE_DIR}/src/LocalDiscretization
     ${MOAB_SOURCE_DIR}/src/moab/point_locater/lotte
+    ${MOAB_BINARY_DIR}
+    ${MOAB_BINARY_DIR}/src
+    ${MOAB_BINARY_DIR}/src/parallel
   )
 
   if ( NetCDF_FOUND )
@@ -143,7 +159,7 @@
   endif ( HDF5_FOUND )
 
 
-  SET(MOAB_LIB_SRCS ${MOABCORE_LIB_SRCS} ${MOABPTLOC_LIB_SRCS} ${MOABIO_LIB_SRCS})
+  SET(MOAB_LIB_SRCS ${MOABCORE_LIB_SRCS} ${MOABPTLOC_LIB_SRCS} ${MOABIO_LIB_SRCS} ${MOABLD_LIB_SRCS})
 
   set_source_files_properties( ${MOAB_LIB_SRCS}
     COMPILE_FLAGS "-DIS_BUILDING_MB ${MOAB_DEFINES}"

diff --git a/src/SpatialLocator.cpp b/src/SpatialLocator.cpp
index f765ab9..36016c1 100644
--- a/src/SpatialLocator.cpp
+++ b/src/SpatialLocator.cpp
@@ -72,7 +72,7 @@ namespace moab
       locTable.enableWriteAccess();
 
         // pass storage directly into locate_points, since we know those arrays are contiguous
-      ErrorCode rval = locate_points(pos, num_points, locTable.vul_wr, locTable.vr_wr, NULL, rel_iter_tol, abs_iter_tol,
+      ErrorCode rval = locate_points(pos, num_points, (EntityHandle*)locTable.vul_wr, locTable.vr_wr, NULL, rel_iter_tol, abs_iter_tol,
                                      inside_tol);
       std::fill(locTable.vi_wr, locTable.vi_wr+num_points, 0);
       locTable.set_n(num_points);

diff --git a/src/io/NCHelper.cpp b/src/io/NCHelper.cpp
index c915382..9ef1332 100644
--- a/src/io/NCHelper.cpp
+++ b/src/io/NCHelper.cpp
@@ -48,6 +48,9 @@ NCHelper* NCHelper::get_nc_helper(ReadNC* readNC, int fileId, const FileOptions&
   else {
     if (NCHelperMPAS::can_read_file(readNC))
       return new (std::nothrow) NCHelperMPAS(readNC, fileId, opts, fileSet);
+    // For a HOMME connectivity file, there might be no CF convention
+    else if (NCHelperHOMME::can_read_file(readNC, fileId))
+      return new (std::nothrow) NCHelperHOMME(readNC, fileId, opts, fileSet);
   }
 
   // Unknown NetCDF grid (will fill this in later for POP, CICE and CLM)

diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index efddb0c..53fa9ad 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -15,7 +15,7 @@ namespace moab {
 
 NCHelperHOMME::NCHelperHOMME(ReadNC* readNC, int fileId, const FileOptions& opts, EntityHandle fileSet)
 : UcdNCHelper(readNC, fileId, opts, fileSet),
-_spectralOrder(-1), connectId(-1)
+_spectralOrder(-1), connectId(-1), isConnFile(false)
 {
   // Calculate spectral order
   std::map<std::string, ReadNC::AttData>::iterator attIt = readNC->globalAtts.find("np");
@@ -26,6 +26,11 @@ _spectralOrder(-1), connectId(-1)
     else
       _spectralOrder--; // Spectral order is one less than np
   }
+  else {
+    // As can_read_file() returns true and there is no global attribute "np", it should be a connectivity file
+    isConnFile = true;
+    _spectralOrder = 3; // Assume np is 4
+  }
 }
 
 bool NCHelperHOMME::can_read_file(ReadNC* readNC, int fileId)
@@ -52,6 +57,15 @@ bool NCHelperHOMME::can_read_file(ReadNC* readNC, int fileId)
 
     return true;
   }
+  else {
+    // If dimension names "ncol" AND "ncorners" AND "ncells" exist, then it should be the HOMME connectivity file
+    // In this case, the mesh can still be created
+    std::vector<std::string>& dimNames = readNC->dimNames;
+    if ((std::find(dimNames.begin(), dimNames.end(), std::string("ncol")) != dimNames.end()) &&
+        (std::find(dimNames.begin(), dimNames.end(), std::string("ncorners")) != dimNames.end()) &&
+        (std::find(dimNames.begin(), dimNames.end(), std::string("ncells")) != dimNames.end()))
+      return true;
+  }
 
   return false;
 }
@@ -67,15 +81,20 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
   std::vector<std::string>::iterator vit;
 
   // Look for time dimension
-  if ((vit = std::find(dimNames.begin(), dimNames.end(), "time")) != dimNames.end())
-    idx = vit - dimNames.begin();
-  else if ((vit = std::find(dimNames.begin(), dimNames.end(), "t")) != dimNames.end())
-    idx = vit - dimNames.begin();
+  if (isConnFile) {
+    // Connectivity file might not have time dimension
+  }
   else {
-    ERRORR(MB_FAILURE, "Couldn't find 'time' or 't' dimension.");
+    if ((vit = std::find(dimNames.begin(), dimNames.end(), "time")) != dimNames.end())
+      idx = vit - dimNames.begin();
+    else if ((vit = std::find(dimNames.begin(), dimNames.end(), "t")) != dimNames.end())
+      idx = vit - dimNames.begin();
+    else {
+      ERRORR(MB_FAILURE, "Couldn't find 'time' or 't' dimension.");
+    }
+    tDim = idx;
+    nTimeSteps = dimLens[idx];
   }
-  tDim = idx;
-  nTimeSteps = dimLens[idx];
 
   // Get number of vertices (labeled as number of columns)
   if ((vit = std::find(dimNames.begin(), dimNames.end(), "ncol")) != dimNames.end())
@@ -90,15 +109,20 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
   nCells = nVertices - 2;
 
   // Get number of levels
-  if ((vit = std::find(dimNames.begin(), dimNames.end(), "lev")) != dimNames.end())
-    idx = vit - dimNames.begin();
-  else if ((vit = std::find(dimNames.begin(), dimNames.end(), "ilev")) != dimNames.end())
-    idx = vit - dimNames.begin();
+  if (isConnFile) {
+    // Connectivity file might not have level dimension
+  }
   else {
-    ERRORR(MB_FAILURE, "Couldn't find 'lev' or 'ilev' dimension.");
+    if ((vit = std::find(dimNames.begin(), dimNames.end(), "lev")) != dimNames.end())
+      idx = vit - dimNames.begin();
+    else if ((vit = std::find(dimNames.begin(), dimNames.end(), "ilev")) != dimNames.end())
+      idx = vit - dimNames.begin();
+    else {
+      ERRORR(MB_FAILURE, "Couldn't find 'lev' or 'ilev' dimension.");
+    }
+    levDim = idx;
+    nLevels = dimLens[idx];
   }
-  levDim = idx;
-  nLevels = dimLens[idx];
 
   // Store lon values in xVertVals
   std::map<std::string, ReadNC::VarData>::iterator vmit;
@@ -120,35 +144,45 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
   }
 
   // Store lev values in levVals
-  if ((vmit = varInfo.find("lev")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
-    rval = read_coordinate("lev", 0, nLevels - 1, levVals);
-    ERRORR(rval, "Trouble reading 'lev' variable.");
-
-    // Decide whether down is positive
-    char posval[10];
-    int success = NCFUNC(get_att_text)(_fileId, (*vmit).second.varId, "positive", posval);
-    if (0 == success && !strcmp(posval, "down")) {
-      for (std::vector<double>::iterator dvit = levVals.begin(); dvit != levVals.end(); ++dvit)
-        (*dvit) *= -1.0;
-    }
+  if (isConnFile) {
+    // Connectivity file might not have level variable
   }
   else {
-    ERRORR(MB_FAILURE, "Couldn't find 'lev' variable.");
+    if ((vmit = varInfo.find("lev")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
+      rval = read_coordinate("lev", 0, nLevels - 1, levVals);
+      ERRORR(rval, "Trouble reading 'lev' variable.");
+
+      // Decide whether down is positive
+      char posval[10];
+      int success = NCFUNC(get_att_text)(_fileId, (*vmit).second.varId, "positive", posval);
+      if (0 == success && !strcmp(posval, "down")) {
+        for (std::vector<double>::iterator dvit = levVals.begin(); dvit != levVals.end(); ++dvit)
+          (*dvit) *= -1.0;
+      }
+    }
+    else {
+      ERRORR(MB_FAILURE, "Couldn't find 'lev' variable.");
+    }
   }
 
   // Store time coordinate values in tVals
-  if ((vmit = varInfo.find("time")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
-    rval = read_coordinate("time", 0, nTimeSteps - 1, tVals);
-    ERRORR(rval, "Trouble reading 'time' variable.");
-  }
-  else if ((vmit = varInfo.find("t")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
-    rval = read_coordinate("t", 0, nTimeSteps - 1, tVals);
-    ERRORR(rval, "Trouble reading 't' variable.");
+  if (isConnFile) {
+    // Connectivity file might not have time variable
   }
   else {
-    // If expected time variable is not available, set dummy time coordinate values to tVals
-    for (int t = 0; t < nTimeSteps; t++)
-      tVals.push_back((double)t);
+    if ((vmit = varInfo.find("time")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
+      rval = read_coordinate("time", 0, nTimeSteps - 1, tVals);
+      ERRORR(rval, "Trouble reading 'time' variable.");
+    }
+    else if ((vmit = varInfo.find("t")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
+      rval = read_coordinate("t", 0, nTimeSteps - 1, tVals);
+      ERRORR(rval, "Trouble reading 't' variable.");
+    }
+    else {
+      // If expected time variable is not available, set dummy time coordinate values to tVals
+      for (int t = 0; t < nTimeSteps; t++)
+        tVals.push_back((double)t);
+    }
   }
 
   // For each variable, determine the entity location type and number of levels
@@ -225,23 +259,6 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
   bool& spectralMesh = _readNC->spectralMesh;
   int& gatherSetRank = _readNC->gatherSetRank;
 
-  // Need to get/read connectivity data before creating elements
-  std::string conn_fname;
-
-  // Try to open the connectivity file through CONN option, if used
-  ErrorCode rval = _opts.get_str_option("CONN", conn_fname);
-  if (MB_SUCCESS != rval) {
-    // Default convention for reading HOMME is a file HommeMapping.nc in same dir as data file
-    conn_fname = std::string(fileName);
-    size_t idx = conn_fname.find_last_of("/");
-    if (idx != std::string::npos)
-      conn_fname = conn_fname.substr(0, idx).append("/HommeMapping.nc");
-    else
-      conn_fname = "HommeMapping.nc";
-  }
-
-  int success = 0;
-
   int rank = 0;
   int procs = 1;
 #ifdef USE_MPI
@@ -253,19 +270,42 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
   }
 #endif
 
+  ErrorCode rval;
+  int success = 0;
+
+  // Need to get/read connectivity data before creating elements
+  std::string conn_fname;
+
+  if (isConnFile) {
+    // Connectivity file has already been read
+    connectId = _readNC->fileId;
+  }
+  else {
+    // Try to open the connectivity file through CONN option, if used
+    rval = _opts.get_str_option("CONN", conn_fname);
+    if (MB_SUCCESS != rval) {
+      // Default convention for reading HOMME is a file HommeMapping.nc in same dir as data file
+      conn_fname = std::string(fileName);
+      size_t idx = conn_fname.find_last_of("/");
+      if (idx != std::string::npos)
+        conn_fname = conn_fname.substr(0, idx).append("/HommeMapping.nc");
+      else
+        conn_fname = "HommeMapping.nc";
+    }
 #ifdef PNETCDF_FILE
 #ifdef USE_MPI
-  if (isParallel) {
-    ParallelComm*& myPcomm = _readNC->myPcomm;
-    success = NCFUNC(open)(myPcomm->proc_config().proc_comm(), conn_fname.c_str(), 0, MPI_INFO_NULL, &connectId);
-  }
-  else
-    success = NCFUNC(open)(MPI_COMM_SELF, conn_fname.c_str(), 0, MPI_INFO_NULL, &connectId);
+    if (isParallel) {
+      ParallelComm*& myPcomm = _readNC->myPcomm;
+      success = NCFUNC(open)(myPcomm->proc_config().proc_comm(), conn_fname.c_str(), 0, MPI_INFO_NULL, &connectId);
+    }
+    else
+      success = NCFUNC(open)(MPI_COMM_SELF, conn_fname.c_str(), 0, MPI_INFO_NULL, &connectId);
 #endif
 #else
-  success = NCFUNC(open)(conn_fname.c_str(), 0, &connectId);
+    success = NCFUNC(open)(conn_fname.c_str(), 0, &connectId);
 #endif
-  ERRORS(success, "Failed on open.");
+    ERRORS(success, "Failed on open.");
+  }
 
   std::vector<std::string> conn_names;
   std::vector<int> conn_vals;
@@ -286,7 +326,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
     ERRORR(MB_FAILURE, "Failed to get number of quads.");
   }
   int num_quads = conn_vals[idx];
-  if (num_quads != nCells) {
+  if (!isConnFile && num_quads != nCells) {
     dbgOut.tprintf(1, "Warning: number of quads from %s and cells from %s are inconsistent; num_quads = %d, nCells = %d.\n",
         conn_fname.c_str(), fileName.c_str(), num_quads, nCells);
   }
@@ -300,8 +340,13 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
   std::vector<int> tmp_conn(4 * num_quads), tmp_conn2(4 * num_quads);
   success = NCFUNCAG(_vara_int)(connectId, cornerVarId, tmp_starts, tmp_counts, &tmp_conn2[0]);
   ERRORS(success, "Failed to get temporary connectivity.");
-  success = NCFUNC(close)(connectId);
-  ERRORS(success, "Failed on close.");
+  if (isConnFile) {
+    // This data/connectivity file will be closed later in ReadNC::load_file()
+  }
+  else {
+    success = NCFUNC(close)(connectId);
+    ERRORS(success, "Failed on close.");
+  }
   // Permute the connectivity
   for (int i = 0; i < num_quads; i++) {
     tmp_conn[4 * i] = tmp_conn2[i];
@@ -383,12 +428,12 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
 
   // Convert lon/lat/rad to x/y/z
   const double pideg = acos(-1.0) / 180.0;
+  double rad = (isConnFile) ? 8000.0 : 8000.0 + levVals[0];
   for (i = 0; i < nLocalVertices; i++) {
     double cosphi = cos(pideg * yptr[i]);
     double zmult = sin(pideg * yptr[i]);
     double xmult = cosphi * cos(xptr[i] * pideg);
     double ymult = cosphi * sin(xptr[i] * pideg);
-    double rad = 8000.0 + levVals[0];
     xptr[i] = rad * xmult;
     yptr[i] = rad * ymult;
     zptr[i] = rad * zmult;
@@ -463,7 +508,6 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
       double zmult = sin(pideg * yVertVals[i]);
       double xmult = cosphi * cos(xVertVals[i] * pideg);
       double ymult = cosphi * sin(xVertVals[i] * pideg);
-      double rad = 8000.0 + levVals[0];
       xptr[i] = rad * xmult;
       yptr[i] = rad * ymult;
       zptr[i] = rad * zmult;

diff --git a/src/io/NCHelperHOMME.hpp b/src/io/NCHelperHOMME.hpp
index 82ba90e..a6d50f0 100644
--- a/src/io/NCHelperHOMME.hpp
+++ b/src/io/NCHelperHOMME.hpp
@@ -46,6 +46,7 @@ private:
 private:
   int _spectralOrder; // Read from variable 'np'
   int connectId; // For connectivity file
+  bool isConnFile; // Is the data file being read actually a connectivity file in disguise?
 };
 
 } // namespace moab

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;
 

diff --git a/src/parallel/CMakeLists.txt b/src/parallel/CMakeLists.txt
index 7583885..9021ee2 100644
--- a/src/parallel/CMakeLists.txt
+++ b/src/parallel/CMakeLists.txt
@@ -4,7 +4,6 @@ set( moab_PARALLEL_SRCS
   ParallelData.cpp
   ReadParallel.cpp
   gs.cpp
-  TupleList.cpp
   SharedSetData.cpp
 )
 

diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 58f6063..f440f6a 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -26,7 +26,7 @@ else
 endif
 
 if HAVE_CGM
-  CGM_TEST = read_cgm_test
+  CGM_TEST = read_cgm_load_test read_cgm_basic_test
 else
   CGM_TEST = 
 endif
@@ -71,8 +71,10 @@ ideas_test_SOURCES = $(srcdir)/../TestUtil.hpp ideas_test.cc
 stl_test_SOURCES = $(srcdir)/../TestUtil.hpp stl_test.cc
 smf_test_SOURCES = $(srcdir)/../TestUtil.hpp smf_test.cc
 ccmio_test_SOURCES = $(srcdir)/../TestUtil.hpp ccmio_test.cpp
-read_cgm_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_test.cpp
-read_cgm_test_CXXFLAGS = $(CGM_CPPFLAGS)  $(CXXFLAGS)
+read_cgm_load_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_load_test.cpp
+read_cgm_load_test_CXXFLAGS = $(CGM_CPPFLAGS)  $(CXXFLAGS)
+read_cgm_basic_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_basic_test.cpp
+read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS)  $(CXXFLAGS)
 readutil_test_SOURCES = $(srcdir)/../TestUtil.hpp readutil_test.cpp
 cgns_test_SOURCES=$(srcdir)/../TestUtil.hpp cgns_test.cpp
 

diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
new file mode 100644
index 0000000..7a2d07d
--- /dev/null
+++ b/test/io/read_cgm_basic_test.cpp
@@ -0,0 +1,70 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+#include "MBTagConventions.hpp"
+
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+
+#ifdef MESHDIR
+#ifdef HAVE_OCC_STEP
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.stp";
+#else
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cube[] = "cube.stp";
+#else
+static const char input_cube[] = "cube.sat";
+#endif
+#endif
+
+void read_cube_test()
+{
+  Core mb;
+ 
+  ErrorCode rval = mb.load_file(input_cube); CHECK_ERR(rval);
+
+  Tag geom_tag;
+
+  rval = mb.tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+                                  geom_tag, MB_TAG_SPARSE|MB_TAG_CREAT); 
+  CHECK_ERR(rval);
+   
+  int number_of_tris;
+
+  rval = mb.get_number_entities_by_type(0, MBTRI , number_of_tris);
+  std::cout << "Number of Triangles = " << number_of_tris << std::endl;
+  CHECK_ERR(rval);
+
+  int number_of_vertices;
+  rval = mb.get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+  CHECK_ERR(rval);
+
+
+  if( number_of_tris != 12) rval = MB_FAILURE; CHECK_ERR(rval);
+   
+  if( number_of_vertices !=8) rval = MB_FAILURE; CHECK_ERR(rval);
+
+}
+  
+int main(int /* argc */, char** /* argv */)
+{
+  int result = 0;
+  
+  result += RUN_TEST( read_cube_test );
+      
+  return result;
+}

diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
new file mode 100644
index 0000000..5377220
--- /dev/null
+++ b/test/io/read_cgm_load_test.cpp
@@ -0,0 +1,49 @@
+
+#include <iostream>
+#include "moab/Interface.hpp"
+#ifndef IS_BUILDING_MB
+#define IS_BUILDING_MB
+#endif
+#include "TestUtil.hpp"
+#include "Internals.hpp"
+#include "moab/Core.hpp"
+
+using namespace moab;
+
+#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
+  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
+            << __LINE__ << std::endl; \
+  return A; } } while(false)
+
+#ifdef MESHDIR
+#ifdef HAVE_OCC_STEP
+static const char input_file[] = STRINGIFY(MESHDIR) "/io/dum.stp";
+#else
+static const char input_file[] = STRINGIFY(MESHDIR) "/io/dum.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_file[] = "dum.stp";
+#else
+static const char input_file[] = "dum.sat";
+#endif
+#endif
+
+void read_multiple_test() 
+{
+  Core mb;
+
+  ErrorCode rval = mb.load_file(input_file);
+  CHECK_ERR(rval);
+  // second load
+  rval = mb.load_file(input_file);
+  CHECK_ERR(rval);
+
+}
+  
+int main(int /* argc */, char** /* argv */)
+{
+  int result = RUN_TEST( read_multiple_test );
+
+  return result;
+}

diff --git a/test/io/read_cgm_test.cpp b/test/io/read_cgm_test.cpp
deleted file mode 100644
index 5377220..0000000
--- a/test/io/read_cgm_test.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-
-#include <iostream>
-#include "moab/Interface.hpp"
-#ifndef IS_BUILDING_MB
-#define IS_BUILDING_MB
-#endif
-#include "TestUtil.hpp"
-#include "Internals.hpp"
-#include "moab/Core.hpp"
-
-using namespace moab;
-
-#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
-  std::cerr << "Failure (error code " << (A) << ") at " __FILE__ ":" \
-            << __LINE__ << std::endl; \
-  return A; } } while(false)
-
-#ifdef MESHDIR
-#ifdef HAVE_OCC_STEP
-static const char input_file[] = STRINGIFY(MESHDIR) "/io/dum.stp";
-#else
-static const char input_file[] = STRINGIFY(MESHDIR) "/io/dum.sat";
-#endif
-#else
-#ifdef HAVE_OCC_STEP
-static const char input_file[] = "dum.stp";
-#else
-static const char input_file[] = "dum.sat";
-#endif
-#endif
-
-void read_multiple_test() 
-{
-  Core mb;
-
-  ErrorCode rval = mb.load_file(input_file);
-  CHECK_ERR(rval);
-  // second load
-  rval = mb.load_file(input_file);
-  CHECK_ERR(rval);
-
-}
-  
-int main(int /* argc */, char** /* argv */)
-{
-  int result = RUN_TEST( read_multiple_test );
-
-  return result;
-}

diff --git a/test/io/read_ucd_nc.cpp b/test/io/read_ucd_nc.cpp
index b6bec41..c9309c5 100644
--- a/test/io/read_ucd_nc.cpp
+++ b/test/io/read_ucd_nc.cpp
@@ -8,8 +8,10 @@ using namespace moab;
 
 #ifdef MESHDIR
 static const char example[] = STRINGIFY(MESHDIR) "/io/homme26x3458.t.3.nc";
+static const char conn_fname[] = STRINGIFY(MESHDIR) "/io/HommeMapping.nc";
 #else
 static const char example[] = "/io/homme26x3458.t.3.nc";
+static const char conn_fname[] = "io/HommeMapping.nc";
 #endif
 
 #ifdef USE_MPI
@@ -24,6 +26,7 @@ void test_read_nomesh();
 void test_read_novars();
 void test_read_dim_vars(); // Test reading dimension variables
 void test_gather_onevar(); // Test gather set with one variable
+void test_read_conn(); // Test reading connectivity file only
 
 void get_options(std::string& opts);
 
@@ -46,6 +49,7 @@ int main(int argc, char* argv[])
   result += RUN_TEST(test_read_novars);
   result += RUN_TEST(test_read_dim_vars);
   result += RUN_TEST(test_gather_onevar);
+  result += RUN_TEST(test_read_conn);
 
 #ifdef USE_MPI
   fail = MPI_Finalize();
@@ -397,6 +401,39 @@ void test_gather_onevar()
 #endif
 }
 
+void test_read_conn()
+{
+  Core moab;
+  Interface& mb = moab;
+
+  std::string opts;
+  get_options(opts);
+
+  ErrorCode rval = mb.load_file(conn_fname, NULL, opts.c_str());
+  CHECK_ERR(rval);
+
+  int procs = 1;
+#ifdef USE_MPI
+  ParallelComm* pcomm = ParallelComm::get_pcomm(&mb, 0);
+  procs = pcomm->proc_config().proc_size();
+#endif
+
+  // Make check runs this test on one processor
+  if (1 == procs) {
+    // Get vertices
+    Range verts;
+    rval = mb.get_entities_by_type(0, MBVERTEX, verts);
+    CHECK_ERR(rval);
+    CHECK_EQUAL((size_t)3458, verts.size());
+
+    // Get cells
+    Range cells;
+    rval = mb.get_entities_by_type(0, MBQUAD, cells);
+    CHECK_ERR(rval);
+    CHECK_EQUAL((size_t)3456, cells.size());
+  }
+}
+
 void get_options(std::string& opts)
 {
 #ifdef USE_MPI

diff --git a/test/parallel/mhdf_parallel.c b/test/parallel/mhdf_parallel.c
index 848619b..178d183 100644
--- a/test/parallel/mhdf_parallel.c
+++ b/test/parallel/mhdf_parallel.c
@@ -26,6 +26,8 @@
 #include <H5FDmpi.h>
 #include <H5FDmpio.h>
 
+#ifdef H5_HAVE_PARALLEL
+
 const char filename[] = "mhdf_ll.h5m";
 const char proc_tag_name[] = "proc_id";
 const char elem_handle[] = "Hex";
@@ -280,9 +282,12 @@ static herr_t handle_hdf5_error( void* data )
   assert(0);
   return result;
 }
+
+#endif // #ifdef H5_HAVE_PARALLEL
  
 int main( int argc, char* argv[] )
 {
+#ifdef H5_HAVE_PARALLEL
   int rval;
   void* data;
   herr_t err;
@@ -321,5 +326,6 @@ int main( int argc, char* argv[] )
   write_file_data();
   
   MPI_Finalize();
+#endif
   return 0;
 }

diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index fd85330..8e990a9 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -105,11 +105,6 @@
     add_subdirectory( qvdual )
   endif ( MOAB_BUILD_QVDUAL )
 
-  # CGM
-  if ( MOAB_BUILD_DAGMC )
-    add_subdirectory( dagmc )
-  endif ( MOAB_BUILD_DAGMC )
-
   # MBCoupler
   if ( MOAB_USE_MPI AND MPI_FOUND AND MOAB_BUILD_MBCOUPLER )
 #  if ( MOAB_BUILD_MBCOUPLER )

diff --git a/tools/dagmc/CMakeLists.txt b/tools/dagmc/CMakeLists.txt
index 2326f55..14974cb 100644
--- a/tools/dagmc/CMakeLists.txt
+++ b/tools/dagmc/CMakeLists.txt
@@ -2,12 +2,13 @@
 find_package( CGM )
 
 include_directories(
-  ${CMAKE_CURRENT_BINARY_DIR}
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${MOAB_BINARY_DIR}/src
-  ${MOAB_SOURCE_DIR}/src
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${MOAB_BINARY_DIR}
+    ${MOAB_SOURCE_DIR}/src
+    ${MOAB_BINARY_DIR}/src
 )
 
+
 set( MOAB_DAGMC_LIB_SRCS
   DagMC.cpp
 )

diff --git a/tools/mbcoupler/CMakeLists.txt b/tools/mbcoupler/CMakeLists.txt
index da316c8..019f939 100644
--- a/tools/mbcoupler/CMakeLists.txt
+++ b/tools/mbcoupler/CMakeLists.txt
@@ -16,7 +16,7 @@ set( MBCOUPLER_SRCS
 )
 
 set_source_files_properties( ${MBCOUPLER_SRCS}
-  COMPILE_FLAGS "${MOAB_DEFINES}"
+  COMPILE_FLAGS "${MOAB_DEFINES} -DIS_BUILDING_MB"
 )
 
 add_library( mbcoupler
@@ -30,13 +30,6 @@ endif ( MOAB_USE_MPI )
 
 enable_testing()
 
-# A test for the coupler library
-add_executable( findpt_test findpt_test.cpp )
-target_link_libraries( findpt_test mbcoupler MOAB )
-if ( MOAB_USE_MPI )
-  target_link_libraries( findpt_test MOABpar )
-endif ( MOAB_USE_MPI )
-add_test( TestMBCouplerFindPt ${EXECUTABLE_OUTPUT_PATH}/findpt_test )
 
 if ( MOAB_USE_MPI )
   # Exercise the coupler and not just findpt:

diff --git a/tools/mbcslam/CslamUtils.cpp b/tools/mbcslam/CslamUtils.cpp
index e806d61..0c8d5f3 100644
--- a/tools/mbcslam/CslamUtils.cpp
+++ b/tools/mbcslam/CslamUtils.cpp
@@ -906,16 +906,34 @@ void velocity_case1(CartVect & arrival_point, double t, CartVect & velo)
 //
 ErrorCode enforce_convexity(Interface * mb, EntityHandle lset, int my_rank)
 {
-  // look at each quad; compute all 4 angles; if one is reflex, break along that diagonal
+  // look at each polygon; compute all angles; if one is reflex, break that angle with
+  // the next triangle; put the 2 new polys in the set;
+  // still look at the next poly
   // replace it with 2 triangles, and remove from set;
   // it should work for all polygons / tested first for case 1, with dt 0.5 (too much deformation)
   // get all entities of dimension 2
   // then get the connectivity, etc
+
   Range inputRange;
   ErrorCode rval = mb->get_entities_by_dimension(lset, 2, inputRange);
   if (MB_SUCCESS != rval)
     return rval;
 
+  Tag corrTag=0;
+  EntityHandle dumH=0;
+  rval = mb->tag_get_handle(CORRTAGNAME,
+           1, MB_TYPE_HANDLE, corrTag,
+           MB_TAG_DENSE, &dumH);
+  if(rval==MB_TAG_NOT_FOUND)
+    corrTag = 0;
+
+  Tag gidTag;
+  rval = mb->tag_get_handle("GLOBAL_ID", 1, MB_TYPE_INTEGER,
+        gidTag, MB_TAG_DENSE);
+
+  if(rval!=MB_SUCCESS)
+    return rval;
+
   std::vector<double> coords;
   coords.resize(3*MAXEDGES); // at most 10 vertices per polygon
   // we should create a queue with new polygons that need processing for reflex angles
@@ -942,34 +960,49 @@ ErrorCode enforce_convexity(Interface * mb, EntityHandle lset, int my_rank)
     rval = mb->get_connectivity(eh, verts, num_nodes);
     if (MB_SUCCESS != rval)
       return rval;
-    coords.resize(3 * num_nodes);
-    if (num_nodes < 4)
+    int nsides = num_nodes;
+    // account for possible padded polygons
+    while (verts[nsides-2]==verts[nsides-1] && nsides>3)
+      nsides--;
+    EntityHandle corrHandle=0;
+    if (corrTag)
+    {
+      rval = mb->tag_get_data(corrTag, &eh, 1, &corrHandle);
+      if (MB_SUCCESS != rval)
+        return rval;
+    }
+    int gid=0;
+    rval = mb->tag_get_data(gidTag, &eh, 1, &gid);
+    if (MB_SUCCESS != rval)
+      return rval;
+    coords.resize(3 * nsides);
+    if (nsides < 4)
       continue; // if already triangles, don't bother
        // get coordinates
-    rval = mb->get_coords(verts, num_nodes, &coords[0]);
+    rval = mb->get_coords(verts, nsides, &coords[0]);
     if (MB_SUCCESS != rval)
      return rval;
     // compute each angle
     bool alreadyBroken = false;
 
-    for (int i=0; i<num_nodes; i++)
+    for (int i=0; i<nsides; i++)
     {
       double * A = &coords[3*i];
-      double * B = &coords[3*((i+1)%num_nodes)];
-      double * C = &coords[3*((i+2)%num_nodes)];
+      double * B = &coords[3*((i+1)%nsides)];
+      double * C = &coords[3*((i+2)%nsides)];
       double angle = oriented_spherical_angle(A, B, C);
       if (angle-M_PI > 0.) // even almost reflex is bad; break it!
       {
         if (alreadyBroken)
         {
           mb->list_entities(&eh, 1);
-          mb->list_entities(verts, num_nodes);
-          double * D = &coords[3*((i+3)%num_nodes)];
+          mb->list_entities(verts, nsides);
+          double * D = &coords[3*((i+3)%nsides)];
           std::cout<< "ABC: " << angle << " \n";
           std::cout<< "BCD: " << oriented_spherical_angle( B, C, D) << " \n";
           std::cout<< "CDA: " << oriented_spherical_angle( C, D, A) << " \n";
           std::cout<< "DAB: " << oriented_spherical_angle( D, A, B)<< " \n";
-          std::cout << " this quad has at least 2 angles > 180, it has serious issues\n";
+          std::cout << " this cell has at least 2 angles > 180, it has serious issues\n";
 
           return MB_FAILURE;
         }
@@ -980,15 +1013,15 @@ ErrorCode enforce_convexity(Interface * mb, EntityHandle lset, int my_rank)
         // break the next triangle, even though not optimal
         // so create the triangle i+1, i+2, i+3; remove i+2 from original list
         // even though not optimal in general, it is good enough.
-        EntityHandle conn3[3]={ verts[ (i+1)%num_nodes],
-            verts[ (i+2)%num_nodes],
-            verts[ (i+3)%num_nodes] };
+        EntityHandle conn3[3]={ verts[ (i+1)%nsides],
+            verts[ (i+2)%nsides],
+            verts[ (i+3)%nsides] };
         // create a polygon with num_nodes-1 vertices, and connectivity
         // verts[i+1], verts[i+3], (all except i+2)
-        std::vector<EntityHandle> conn(num_nodes-1);
-        for (int j=1; j<num_nodes; j++)
+        std::vector<EntityHandle> conn(nsides-1);
+        for (int j=1; j<nsides; j++)
         {
-          conn[j-1]=verts[(i+j+2)%num_nodes];
+          conn[j-1]=verts[(i+j+2)%nsides];
         }
         EntityHandle newElement;
         rval = mb->create_element(MBTRI, conn3, 3, newElement);
@@ -998,7 +1031,16 @@ ErrorCode enforce_convexity(Interface * mb, EntityHandle lset, int my_rank)
         rval = mb->add_entities(lset, &newElement, 1);
         if (MB_SUCCESS != rval)
           return rval;
-        if (num_nodes == 4)
+        if (corrTag)
+        {
+          rval = mb->tag_set_data(corrTag, &newElement, 1, &corrHandle);
+          if (MB_SUCCESS != rval)
+            return rval;
+        }
+        rval = mb->tag_set_data(gidTag, &newElement, 1, &gid);
+        if (MB_SUCCESS != rval)
+          return rval;
+        if (nsides == 4)
         {
           // create another triangle
           rval = mb->create_element(MBTRI, &conn[0], 3, newElement);
@@ -1008,7 +1050,7 @@ ErrorCode enforce_convexity(Interface * mb, EntityHandle lset, int my_rank)
         else
         {
           // create another polygon, and add it to the inputRange
-          rval = mb->create_element(MBPOLYGON, &conn[0], num_nodes-1, newElement);
+          rval = mb->create_element(MBPOLYGON, &conn[0], nsides-1, newElement);
           if (MB_SUCCESS != rval)
             return rval;
           newPolys.push(newElement); // because it has less number of edges, the
@@ -1017,6 +1059,15 @@ ErrorCode enforce_convexity(Interface * mb, EntityHandle lset, int my_rank)
         rval = mb->add_entities(lset, &newElement, 1);
         if (MB_SUCCESS != rval)
           return rval;
+        if (corrTag)
+        {
+          rval = mb->tag_set_data(corrTag, &newElement, 1, &corrHandle);
+          if (MB_SUCCESS != rval)
+            return rval;
+        }
+        rval = mb->tag_set_data(gidTag, &newElement, 1, &gid);
+         if (MB_SUCCESS != rval)
+           return rval;
         mb->remove_entities(lset, &eh, 1);
         brokenPolys++;
         /*std::cout<<"remove: " ;
@@ -1029,7 +1080,7 @@ ErrorCode enforce_convexity(Interface * mb, EntityHandle lset, int my_rank)
       }
     }
   }
-  std::cout << "on rank " << my_rank << " " <<  brokenPolys << " concave polygons were decomposed in convex ones \n";
+  std::cout << "on local process " << my_rank << " " <<  brokenPolys << " concave polygons were decomposed in convex ones \n";
   return MB_SUCCESS;
 }
 ErrorCode create_span_quads(Interface * mb, EntityHandle euler_set, int rank)

diff --git a/tools/mbcslam/Intx2Mesh.cpp b/tools/mbcslam/Intx2Mesh.cpp
index 625a442..311bfd4 100644
--- a/tools/mbcslam/Intx2Mesh.cpp
+++ b/tools/mbcslam/Intx2Mesh.cpp
@@ -110,7 +110,10 @@ ErrorCode Intx2Mesh::GetOrderedNeighbors(EntityHandle set, EntityHandle cell,
   // first cell is for nodes 0, 1, second to 1, 2, third to 2, 3, last to nnodes-1,
   const EntityHandle * conn4;
   ErrorCode rval = mb->get_connectivity(cell, conn4, nnodes);
-  int nsides = nnodes; // just keep it for historical purposes; it is indeed nnodes
+  int nsides = nnodes;
+  // account for possible padded polygons
+  while (conn4[nsides-2]==conn4[nsides-1] && nsides>3)
+    nsides--;
   ERRORR(rval, "can't get connectivity on an element");
   for (int i = 0; i < nsides; i++)
   {
@@ -800,6 +803,12 @@ ErrorCode Intx2Mesh::create_departure_mesh_2nd_alg(EntityHandle & euler_set, Ent
       ERRORR(rval, "can't set global id tag on new el");
     }
   }
+  // order the remote cells tuple list, with the global id, because we will search in it
+  //remote_cells->print("remote_cells before sorting");
+  moab::TupleList::buffer sort_buffer;
+  sort_buffer.buffer_init(n);
+  remote_cells->sort(1, &sort_buffer);
+  sort_buffer.reset();
   return MB_SUCCESS;
 }
 

diff --git a/tools/mbcslam/Intx2MeshOnSphere.cpp b/tools/mbcslam/Intx2MeshOnSphere.cpp
index ef4d219..ac33e91 100644
--- a/tools/mbcslam/Intx2MeshOnSphere.cpp
+++ b/tools/mbcslam/Intx2MeshOnSphere.cpp
@@ -45,9 +45,12 @@ int Intx2MeshOnSphere::computeIntersectionBetweenRedAndBlue(EntityHandle red, En
   if (MB_SUCCESS != rval )
     return 1;
   nsRed = num_nodes;
+  // account for possible padded polygons
+  while (redConn[nsRed-2]==redConn[nsRed-1] && nsRed>3)
+    nsRed--;
 
   //CartVect coords[4];
-  rval = mb->get_coords(redConn, num_nodes, &(redCoords[0][0]));
+  rval = mb->get_coords(redConn, nsRed, &(redCoords[0][0]));
   if (MB_SUCCESS != rval)
     return 1;
   CartVect middle = redCoords[0];
@@ -61,6 +64,9 @@ int Intx2MeshOnSphere::computeIntersectionBetweenRedAndBlue(EntityHandle red, En
   if (MB_SUCCESS != rval )
     return 1;
   nsBlue = num_nodes;
+  // account for possible padded polygons
+  while (blueConn[nsBlue-2]==blueConn[nsBlue-1] && nsBlue>3)
+    nsBlue--;
   rval = mb->get_coords(blueConn, nsBlue, &(blueCoords[0][0]));
   if (MB_SUCCESS != rval)
     return 1;
@@ -202,7 +208,7 @@ int Intx2MeshOnSphere::findNodes(EntityHandle red, int nsRed, EntityHandle blue,
   int i = 0;
   for (i = 0; i < nsRed; i++)
   {
-    EntityHandle v[2] = { redConn[i], redConn[(i + 1) % nsRed] };
+    EntityHandle v[2] = { redConn[i], redConn[(i + 1) % nsRed] };// this is fine even for padded polygons
     std::vector<EntityHandle> adj_entities;
     ErrorCode rval = mb->get_adjacencies(v, 2, 1, false, adj_entities,
         Interface::INTERSECT);

diff --git a/tools/mbcslam/create_dp.cpp b/tools/mbcslam/create_dp.cpp
index bd2459b..43e1735 100644
--- a/tools/mbcslam/create_dp.cpp
+++ b/tools/mbcslam/create_dp.cpp
@@ -185,10 +185,11 @@ int main(int argc, char **argv)
 
   if (argc < 3)
   {
-    std::cout << " usage: create_dp <input><output> -t <time>  -dt <delta_t> -h \n";
+    std::cout << " usage: create_dp <input><output> -t <time>  -dt <delta_t> [-skipdp] -f <field> -h \n";
     return 1;
   }
 
+  bool skip= false;
   double dt=0.1;
   double t=0.1; // corresponding to diffusion first step
 
@@ -208,9 +209,18 @@ int main(int argc, char **argv)
 
     if (!strcmp(argv[index], "-h"))
     {
-      std::cout << " usage: create_dp <input><output> -t <time>  -dt <delta_t> -h \n";
+      std::cout << " usage: create_dp <input><output> -t <time>  -dt <delta_t>  [-skipdp] -f <field>  -h \n";
       return 1;
     }
+    if (!strcmp(argv[index], "-f")) // delete partition sets
+    {
+      field_type = atoi(argv[++index]);
+    }
+
+    if (!strcmp(argv[index], "-skipdp") )
+    {
+      skip = true;
+    }
     index++;
   }
 
@@ -224,43 +234,50 @@ int main(int argc, char **argv)
   std::cout  << " -t " << t <<  " -dt " << dt << " input: " << input_mesh1 <<
       "  output: " << output << "\n";
 
-  Range verts;
-  rval = mb.get_entities_by_dimension(0, 0, verts);
-  if (MB_SUCCESS != rval)
-    return 1;
-
-  double *x_ptr, *y_ptr, *z_ptr;
-  int count;
-  rval = mb.coords_iterate(verts.begin(), verts.end(), x_ptr, y_ptr, z_ptr, count);
-  if (MB_SUCCESS != rval)
+  // skip if we need for DP (already existing)
+  if (skip)
+  {
+    std::cout<<" do not add DP tag \n";
+  }
+  else
+  {
+    Range verts;
+    rval = mb.get_entities_by_dimension(0, 0, verts);
+    if (MB_SUCCESS != rval)
       return 1;
-  assert(count == (int) verts.size()); // should end up with just one contiguous chunk of vertices
 
-  Tag tagh = 0;
-  std::string tag_name("DP");
-  rval = mb.tag_get_handle(tag_name.c_str(), 3, MB_TYPE_DOUBLE, tagh, MB_TAG_DENSE | MB_TAG_CREAT);
-  CHECK_ERR(rval);
-  void *data; // pointer to the LOC in memory, for each vertex
-  int count_tag;
+    double *x_ptr, *y_ptr, *z_ptr;
+    int count;
+    rval = mb.coords_iterate(verts.begin(), verts.end(), x_ptr, y_ptr, z_ptr, count);
+    if (MB_SUCCESS != rval)
+        return 1;
+    assert(count == (int) verts.size()); // should end up with just one contiguous chunk of vertices
 
-  rval = mb.tag_iterate(tagh, verts.begin(), verts.end(), count_tag, data);
-  CHECK_ERR(rval);
-  // here we are checking contiguity
-  assert(count_tag == (int) verts.size());
-  double * ptr_DP=(double*)data;
+    Tag tagh = 0;
+    std::string tag_name("DP");
+    rval = mb.tag_get_handle(tag_name.c_str(), 3, MB_TYPE_DOUBLE, tagh, MB_TAG_DENSE | MB_TAG_CREAT);
+    CHECK_ERR(rval);
+    void *data; // pointer to the LOC in memory, for each vertex
+    int count_tag;
 
-  for (int v = 0; v < count; v++) {
-     //EntityHandle v = verts[v];
-     CartVect pos( x_ptr[v], y_ptr[v] , z_ptr[v]);
-     CartVect newPos;
-     departure_point_case1(pos, t, dt, newPos);
-     ptr_DP[0]=newPos[0];
-     ptr_DP[1]=newPos[1];
-     ptr_DP[2]=newPos[2];
-     ptr_DP+=3; // increment to the next vertex
+    rval = mb.tag_iterate(tagh, verts.begin(), verts.end(), count_tag, data);
+    CHECK_ERR(rval);
+    // here we are checking contiguity
+    assert(count_tag == (int) verts.size());
+    double * ptr_DP=(double*)data;
+
+    for (int v = 0; v < count; v++) {
+       //EntityHandle v = verts[v];
+       CartVect pos( x_ptr[v], y_ptr[v] , z_ptr[v]);
+       CartVect newPos;
+       departure_point_case1(pos, t, dt, newPos);
+       ptr_DP[0]=newPos[0];
+       ptr_DP[1]=newPos[1];
+       ptr_DP[2]=newPos[2];
+       ptr_DP+=3; // increment to the next vertex
+    }
   }
 
-
   rval = add_field_value(mb);
 
   mb.write_file(output);

diff --git a/tools/mbcslam/diffusion.cpp b/tools/mbcslam/diffusion.cpp
index 378473e..be70cd6 100644
--- a/tools/mbcslam/diffusion.cpp
+++ b/tools/mbcslam/diffusion.cpp
@@ -397,17 +397,28 @@ ErrorCode compute_tracer_case1(Interface * mb, Intx2MeshOnSphere & worker, Entit
   // if in parallel, we have to move some elements to another proc, and receive other cells
   // from other procs
   // lagr and euler are preserved
+  if (writeFiles) // so if need to write lagr files too
+  {
+
+  }
   EntityHandle covering_set;
   rval = worker.create_departure_mesh_3rd_alg(lagr_set, covering_set);
   if (writeFiles) // so if write
   {
+    std::stringstream departureMesh;
+    departureMesh << "Departure" << rank << "_" << tStep << ".vtk";
+    rval = mb->write_file(departureMesh.str().c_str(), 0, 0, &lagr_set, 1);
+    CHECK_ERR(rval);
+
     std::stringstream newTracer;
     newTracer << "Tracer" << rank << "_" << tStep << ".vtk";
     rval = mb->write_file(newTracer.str().c_str(), 0, 0, &euler_set, 1);
+    CHECK_ERR(rval);
 
     std::stringstream lagr_cover;
     lagr_cover << "Cover" << rank << "_" << tStep << ".vtk";
     rval = mb->write_file(lagr_cover.str().c_str(), 0, 0, &covering_set, 1);
+    CHECK_ERR(rval);
 
   }
   // so we have now the departure at the previous time

diff --git a/tools/mbcslam/intx_mpas.cpp b/tools/mbcslam/intx_mpas.cpp
index 570c97f..b3d49d9 100644
--- a/tools/mbcslam/intx_mpas.cpp
+++ b/tools/mbcslam/intx_mpas.cpp
@@ -22,6 +22,7 @@
 #include "moab/ParallelComm.hpp"
 
 #include "CslamUtils.hpp"
+#include <time.h>
 
 #ifdef MESHDIR
 std::string TestDir( STRINGIFY(MESHDIR) );
@@ -43,6 +44,7 @@ double radius = 1.;// in m:  6371220.
 
 double t = 0.1, delta_t = 0.05; // check the script
 bool Verbose = false;
+double rot= M_PI/10;
 
 ErrorCode manufacture_lagrange_mesh_on_sphere(Interface * mb,
     EntityHandle euler_set)
@@ -84,7 +86,7 @@ ErrorCode manufacture_lagrange_mesh_on_sphere(Interface * mb,
   //int vix=0; // vertex index in new array
   double T=5;// check the script
 
-  double rot= M_PI/10;
+
   for (Range::iterator vit=connecVerts.begin();vit!=connecVerts.end(); vit++ )
   {
     EntityHandle oldV=*vit;
@@ -152,12 +154,23 @@ int main(int argc, char **argv)
       if (!strcmp(argv[index], "-FF"))
       {
         flux_form= true;
-        index++;
       }
       if (!strcmp(argv[index], "-v"))
       {
         Verbose = true;
-        index++;
+      }
+      if (!strcmp(argv[index], "-t"))
+      {
+        t = atof(argv[++index]);
+      }
+      if (!strcmp(argv[index], "-t"))
+      {
+        t = atof(argv[++index]);
+      }
+      if (!strcmp(argv[index], "-rot"))
+      {
+        rot = atof(argv[++index]);
+        rot = M_PI/rot; // so rot 50 means rotate with M_PI/50 radians
       }
 
       index++;
@@ -165,7 +178,7 @@ int main(int argc, char **argv)
   }
   // start copy
   std::string opts = std::string("PARALLEL=READ_PART;PARTITION_METHOD=RCBZOLTAN")+
-            std::string(";PARALLEL_RESOLVE_SHARED_ENTS;VARIABLE=;")+extra_read_opts;
+            std::string(";PARALLEL_RESOLVE_SHARED_ENTS;VARIABLE=;NO_EDGES;")+extra_read_opts;
   Core moab;
   Interface & mb = moab;
   EntityHandle euler_set;
@@ -173,20 +186,30 @@ int main(int argc, char **argv)
   rval = mb.create_meshset(MESHSET_SET, euler_set);
   CHECK_ERR(rval);
 
+  clock_t tt = clock();
 
   rval = mb.load_file(filename_mesh1, &euler_set, opts.c_str());
+  CHECK_ERR(rval);
 
   ParallelComm* pcomm = ParallelComm::get_pcomm(&mb, 0);
   CHECK_ERR(rval);
 
-  rval = pcomm->check_all_shared_handles();
-  CHECK_ERR(rval);
+  /*rval = pcomm->check_all_shared_handles();
+  CHECK_ERR(rval);*/
   // end copy
   int rank = pcomm->proc_config().proc_rank();
+  int procs = pcomm->proc_config().proc_size();
 
   if (0==rank)
     std::cout << " case 1: use -gtol " << gtol << " -dt " << delta_t <<
-        " -R " << radius << " -input " << filename_mesh1 << "\n";
+        " -R " << radius << " -input " << filename_mesh1 << " -t " << t << " -rot " << rot <<  "\n";
+
+  if (0==rank)
+  {
+      std::cout << "load mesh from " << filename_mesh1 << "\n  on " << procs << " processors in "
+            << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+      tt = clock();
+  }
 
   rval = manufacture_lagrange_mesh_on_sphere(&mb, euler_set);
   if (MB_SUCCESS != rval)
@@ -208,15 +231,27 @@ int main(int argc, char **argv)
   //double radius = 1.; // input
 
   worker.SetRadius(radius);
-
+  if (0==rank)
+  {
+     std::cout << "manufacture departure mesh " << filename_mesh1 << "\n  on " << procs << " processors in "
+              << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+     tt = clock();
+  }
   worker.SetErrorTolerance(gtol);
   rval = worker.create_departure_mesh_2nd_alg(euler_set, covering_lagr_set);
   CHECK_ERR(rval);
 
+  if (0==rank)
+  {
+     std::cout << "communicate covering mesh on " << procs << " processors in "
+              << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+     tt = clock();
+  }
+
   if (Verbose)
   {
     std::stringstream lagrIni;
-    lagrIni<<"def0" << rank<<".h5m";
+    lagrIni<<"lagr0" << rank<<".h5m";
     rval = mb.write_file(lagrIni.str().c_str(), 0, 0, &covering_lagr_set, 1);
   }
 
@@ -226,7 +261,7 @@ int main(int argc, char **argv)
   if (Verbose)
   {
     std::stringstream ste;
-    ste<<"lagr0" << rank<<".h5m";
+    ste<<"euler0" << rank<<".h5m";
     rval = mb.write_file(ste.str().c_str(), 0, 0, &euler_set, 1);
   }
 
@@ -240,8 +275,13 @@ int main(int argc, char **argv)
   rval = worker.intersect_meshes(covering_lagr_set, euler_set, outputSet);
   if (MB_SUCCESS != rval)
     return 1;
-
-  if (rank<=4)
+  if (0==rank)
+  {
+     std::cout << "intersect meshes in " << procs << " processors in "
+              << (clock() - tt) / (double) CLOCKS_PER_SEC << " seconds" << std::endl;
+     tt = clock();
+  }
+  if (Verbose && rank<=4)
   {
     std::string opts_write("");
     std::stringstream outf;
@@ -250,11 +290,15 @@ int main(int argc, char **argv)
     if (MB_SUCCESS != rval)
       std::cout << "can't write output\n";
   }
-  double intx_area = area_on_sphere_lHuiller(&mb, outputSet, radius);
-  double arrival_area = area_on_sphere_lHuiller(&mb, euler_set, radius);
-  std::cout << " Arrival area: " << arrival_area
-      << "  intersection area:" << intx_area << " rel error: "
-      << fabs((intx_area - arrival_area) / arrival_area) << "\n";
+
+  if (rank <= 4)
+  {
+    double intx_area = area_on_sphere_lHuiller(&mb, outputSet, radius);
+    double arrival_area = area_on_sphere_lHuiller(&mb, euler_set, radius);
+    std::cout << "On proc " << rank << "  arrival area: " << arrival_area
+        << "  intersection area:" << intx_area << " rel error: "
+        << fabs((intx_area - arrival_area) / arrival_area) << "\n";
+  }
 
   MPI_Finalize();
   if (MB_SUCCESS != rval)

diff --git a/tools/mbcslam/wrap_intx.cpp b/tools/mbcslam/wrap_intx.cpp
index b973acf..878a832 100644
--- a/tools/mbcslam/wrap_intx.cpp
+++ b/tools/mbcslam/wrap_intx.cpp
@@ -17,7 +17,7 @@
 using namespace moab;
 double radius = 1.;
 double gtol = 1.e-9;
-bool debug = false;
+bool debug = true;
 
 #ifdef __cplusplus
 extern "C" {
@@ -52,6 +52,10 @@ void update_tracer( iMesh_Instance instance, iBase_EntitySetHandle imesh_euler_s
     ERRORV(rval , "can't write covering set ");
   }
 
+  //
+  rval = enforce_convexity(mb, covering_lagr_set);
+  ERRORV(rval , "can't write covering set ");
+
   EntityHandle outputSet;
   rval = mb->create_meshset(MESHSET_SET, outputSet);
   ERRORV(rval , "can't create output set ");

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