moab-dev
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
March 2014
- 17 participants
- 82 discussions
commit/MOAB: danwu: Merged master into error_handling_enhancement
by commits-noreplyï¼ bitbucket.org 26 Mar '14
by commits-noreplyï¼ bitbucket.org 26 Mar '14
26 Mar '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/bba4b3597e00/
Changeset: bba4b3597e00
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-26 17:57:19
Summary: Merged master into error_handling_enhancement
Affected #: 8 files
diff --git a/MeshFiles/unittest/io/cylcube.sat b/MeshFiles/unittest/io/cylcube.sat
new file mode 100644
index 0000000..0b65976
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.sat
@@ -0,0 +1,202 @@
+1900 0 2 0
+10 Cubit 12.2 17 ACIS 19.0.2 Linux 24 Thu Feb 6 08:36:54 2014
+1 9.9999999999999995e-07 1e-10
+body $2 -1 -1 $-1 $3 $-1 $4 T 25 -5 -5 35 5 5 #
+body $5 -1 -1 $-1 $6 $-1 $-1 T -5 -5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $7 $-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 $8 -1 -1 $-1 $-1 $9 $0 T 25 -5 -5 35 5 5 #
+transform $-1 -1 1 0 0 0 1 0 0 0 1 0 0 0 1 no_rotate no_reflect no_shear #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $10 $-1 $1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+lump $11 -1 -1 $-1 $-1 $12 $1 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $-1 $2 $0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $13 $-1 $3 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 $14 $-1 $3 T 25 -5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $5 $1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $15 $-1 $6 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+shell $-1 -1 -1 $-1 $-1 $-1 $16 $-1 $6 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $17 $8 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+face $18 -1 -1 $-1 $19 $20 $9 $-1 $21 forward single T 25 -5 5 35 5 5 F #
+simple-snl-attrib $-1 -1 $22 $11 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+face $23 -1 -1 $-1 $24 $25 $12 $-1 $26 forward single T -5 -5 -5 5 5 5 F #
+simple-snl-attrib $-1 -1 $27 $13 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 2 0 7 1 2 618932362 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $28 $-1 $14 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+face $29 -1 -1 $-1 $30 $31 $9 $-1 $32 reversed single T 25 -5 -5 35 5 -5 F #
+loop $-1 -1 -1 $-1 $-1 $33 $14 T 25 -5 5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 5 0 0 1 1 0 0 forward_v I I I I #
+simple-snl-attrib $-1 -1 $34 $15 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 3 0 7 1 3 885205176 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $35 $-1 $16 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+face $36 -1 -1 $-1 $37 $38 $12 $-1 $39 forward single T -5 -5 -5 5 5 -5 F #
+loop $-1 -1 -1 $-1 $40 $41 $16 T -5 -5 -5 5 5 -5 unknown #
+cone-surface $-1 -1 -1 $-1 0 0 0 0 0 1 5 0 0 1 I I 0 1 5 forward I I I I #
+simple-snl-attrib $-1 -1 $-1 $17 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 4 4 1 1 0 0 #
+simple-snl-attrib $-1 -1 $42 $18 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $43 $-1 $19 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+face $44 -1 -1 $-1 $45 $46 $9 $-1 $47 reversed single T 25 -5 -5 35 -5 5 F #
+loop $-1 -1 -1 $-1 $-1 $48 $19 T 25 -5 -5 35 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 -5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $49 $50 $51 $52 forward $20 $-1 #
+simple-snl-attrib $-1 -1 $-1 $22 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 5 5 1 1 0 0 #
+simple-snl-attrib $-1 -1 $53 $23 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $54 $-1 $24 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+face $55 -1 -1 $-1 $-1 $56 $12 $-1 $57 forward single T -5 -5 5 5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $58 $24 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 #
+loop $-1 -1 -1 $-1 $-1 $59 $16 T -5 -5 5 5 5 5 unknown #
+coedge $-1 -1 -1 $-1 $41 $41 $58 $60 reversed $25 $-1 #
+simple-snl-attrib $-1 -1 $-1 $28 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $61 $29 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $62 $-1 $30 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+face $63 -1 -1 $-1 $64 $65 $9 $-1 $66 reversed single T 25 -5 -5 25 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $67 $30 T 25 -5 -5 35 -5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 -5 0 0 1 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $68 $69 $70 $71 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $72 $33 $73 $74 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $33 $72 $75 $76 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $77 $78 $33 $52 reversed $79 $-1 #
+edge $80 -1 -1 $-1 $81 -5 $82 5 $51 $83 forward @7 unknown T 35 -5 5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $35 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $84 $36 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $85 $-1 $37 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+loop $-1 -1 -1 $-1 $-1 $86 $37 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 $58 $58 $41 $60 forward $38 $-1 #
+coedge $-1 -1 -1 $-1 $59 $59 $86 $87 reversed $40 $-1 #
+edge $88 -1 -1 $-1 $89 0 $89 6.2831853071795862 $58 $90 forward @7 unknown T -5 -5 -5 5 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $43 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $91 $44 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $92 $-1 $45 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+face $93 -1 -1 $-1 $94 $95 $9 $-1 $96 reversed single T 25 5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $97 $45 T 25 -5 -5 25 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 25 0 0 1 0 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $98 $75 $99 $100 forward $46 $-1 #
+coedge $-1 -1 -1 $-1 $101 $48 $98 $102 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $48 $101 $103 $104 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $78 $77 $48 $71 reversed $79 $-1 #
+edge $105 -1 -1 $-1 $106 -5 $107 5 $70 $108 forward @7 unknown T 35 -5 -5 35 5 -5 #
+coedge $-1 -1 -1 $-1 $50 $49 $109 $110 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $111 $112 $49 $74 reversed $95 $-1 #
+edge $113 -1 -1 $-1 $82 -5 $114 5 $73 $115 forward @7 unknown T 25 5 5 35 5 5 #
+coedge $-1 -1 -1 $-1 $67 $116 $50 $76 reversed $46 $-1 #
+edge $117 -1 -1 $-1 $118 -5 $81 5 $75 $119 forward @7 unknown T 25 -5 5 35 -5 5 #
+coedge $-1 -1 -1 $-1 $70 $51 $116 $120 forward $79 $-1 #
+coedge $-1 -1 -1 $-1 $51 $70 $111 $121 reversed $79 $-1 #
+loop $-1 -1 -1 $-1 $-1 $77 $94 T 35 -5 -5 35 5 5 unknown #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $122 $-1 $52 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+vertex $123 -1 -1 $-1 $52 $124 #
+vertex $125 -1 -1 $-1 $52 $126 #
+straight-curve $-1 -1 -1 $-1 35 0 5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $54 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $127 $55 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+coedge $-1 -1 -1 $-1 $86 $86 $59 $87 forward $56 $-1 #
+edge $128 -1 -1 $-1 $129 0 $129 6.2831853071795862 $86 $130 forward @7 unknown T -5 -5 5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $131 $-1 $60 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 13 #
+vertex $132 -1 -1 $-1 $60 $133 #
+ellipse-curve $-1 -1 -1 $-1 0 0 -5 0 0 -1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $62 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $134 $63 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $135 $-1 $64 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+face $136 -1 -1 $-1 $-1 $79 $9 $-1 $137 reversed single T 35 -5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $111 $64 T 25 5 -5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 5 0 0 -1 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $138 $109 $112 $139 forward $65 $-1 #
+coedge $-1 -1 -1 $-1 $116 $67 $68 $102 reversed $46 $-1 #
+coedge $-1 -1 -1 $-1 $109 $138 $67 $100 reversed $65 $-1 #
+edge $140 -1 -1 $-1 $118 -5 $141 5 $99 $142 forward @7 unknown T 25 -5 -5 25 -5 5 #
+coedge $-1 -1 -1 $-1 $69 $68 $138 $143 forward $31 $-1 #
+edge $144 -1 -1 $-1 $107 -5 $141 5 $98 $145 forward @7 unknown T 25 -5 -5 35 -5 -5 #
+coedge $-1 -1 -1 $-1 $112 $111 $69 $104 reversed $95 $-1 #
+edge $146 -1 -1 $-1 $147 -5 $106 5 $103 $148 forward @7 unknown T 25 5 -5 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $149 $-1 $71 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+vertex $150 -1 -1 $-1 $71 $151 #
+vertex $152 -1 -1 $-1 $120 $153 #
+straight-curve $-1 -1 -1 $-1 35 0 -5 0 -1 0 I I #
+coedge $-1 -1 -1 $-1 $97 $99 $72 $110 reversed $65 $-1 #
+edge $154 -1 -1 $-1 $114 -5 $118 5 $109 $155 forward @7 unknown T 25 -5 5 25 5 5 #
+coedge $-1 -1 -1 $-1 $103 $73 $78 $121 forward $95 $-1 #
+coedge $-1 -1 -1 $-1 $73 $103 $97 $139 reversed $95 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $156 $-1 $74 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+vertex $157 -1 -1 $-1 $74 $158 #
+straight-curve $-1 -1 -1 $-1 30 5 5 -1 0 0 I I #
+coedge $-1 -1 -1 $-1 $75 $98 $77 $120 reversed $46 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $159 $-1 $76 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+vertex $160 -1 -1 $-1 $110 $161 #
+straight-curve $-1 -1 -1 $-1 30 -5 5 1 0 0 I I #
+edge $162 -1 -1 $-1 $81 -5 $107 5 $77 $163 forward @7 unknown T 35 -5 -5 35 -5 5 #
+edge $164 -1 -1 $-1 $82 -5 $106 5 $78 $165 forward @7 unknown T 35 5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $80 $52 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $166 $-1 $81 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 35 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $167 $-1 $82 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 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $85 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $168 $-1 $87 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 14 #
+vertex $169 -1 -1 $-1 $87 $170 #
+ellipse-curve $-1 -1 -1 $-1 0 0 5 0 0 1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $88 $60 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 13 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $171 $-1 $89 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+point $-1 -1 -1 $-1 5 0 -5 #
+simple-snl-attrib $-1 -1 $-1 $92 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $172 $93 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $173 $-1 $94 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 35 0 0 -1 0 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $99 $97 $101 $143 reversed $65 $-1 #
+edge $174 -1 -1 $-1 $114 -5 $147 5 $112 $175 forward @7 unknown T 25 5 -5 25 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $176 $-1 $100 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+vertex $177 -1 -1 $-1 $143 $178 #
+straight-curve $-1 -1 -1 $-1 25 -5 0 0 0 -1 I I #
+edge $179 -1 -1 $-1 $141 -5 $147 5 $138 $180 forward @7 unknown T 25 -5 -5 25 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $181 $-1 $102 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 30 -5 -5 -1 0 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $182 $-1 $104 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+vertex $183 -1 -1 $-1 $104 $184 #
+straight-curve $-1 -1 -1 $-1 30 5 -5 1 0 0 I I #
+simple-snl-attrib $-1 -1 $-1 $105 $71 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $185 $-1 $106 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 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $186 $-1 $107 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 35 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $187 $-1 $110 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 25 0 5 0 -1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $113 $74 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $188 $-1 $114 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 25 5 5 #
+simple-snl-attrib $-1 -1 $-1 $117 $76 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $189 $-1 $118 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 25 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $190 $-1 $120 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 35 -5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $191 $-1 $121 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 35 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $123 $81 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $125 $82 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $128 $87 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 14 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $192 $-1 $129 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+point $-1 -1 -1 $-1 5 0 5 #
+simple-snl-attrib $-1 -1 $-1 $132 $89 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $135 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $193 $136 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $194 $-1 $139 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 25 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $140 $100 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $195 $-1 $141 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 25 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $196 $-1 $143 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 25 0 -5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $144 $102 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $146 $104 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $197 $-1 $147 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 25 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $150 $106 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $152 $107 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $154 $110 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $157 $114 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $160 $118 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $162 $120 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $164 $121 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 12 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $169 $129 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $173 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $-1 $174 $139 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 11 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $177 $141 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $179 $143 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $183 $147 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+End-of-ACIS-data
\ No newline at end of file
diff --git a/MeshFiles/unittest/io/cylcube.stp b/MeshFiles/unittest/io/cylcube.stp
new file mode 100644
index 0000000..bc4ec64
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.stp
@@ -0,0 +1,290 @@
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('STEP AP214'),'1');
+FILE_NAME('/home/user/cylcube.stp','2014-02-15T18:13:39',(' '),(' '),'Spatial InterOp 3D',' ',' ');
+FILE_SCHEMA(('automotive_design'));
+ENDSEC;
+DATA;
+#1=PRODUCT_DEFINITION_CONTEXT('',#13,'design');
+#2=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#13);
+#3=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#14,#15);
+#4=SHAPE_DEFINITION_REPRESENTATION(#16,#17);
+#5=PRODUCT_DEFINITION_CONTEXT('',#18,'design');
+#6=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#18);
+#7=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#19,#20);
+#8=SHAPE_DEFINITION_REPRESENTATION(#21,#22);
+#9= (GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#25))GLOBAL_UNIT_ASSIGNED_CONTEXT((#27,#28,#29))REPRESENTATION_CONTEXT('NONE','WORKSPACE'));
+#13=APPLICATION_CONTEXT(' ');
+#14=PRODUCT_CATEGORY('part','NONE');
+#15=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#31));
+#16=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#32);
+#17=ADVANCED_BREP_SHAPE_REPRESENTATION('1',(#33,#34),#9);
+#18=APPLICATION_CONTEXT(' ');
+#19=PRODUCT_CATEGORY('part','NONE');
+#20=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#35));
+#21=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#36);
+#22=ADVANCED_BREP_SHAPE_REPRESENTATION('2',(#37,#38),#9);
+#25=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-06),#27,'','');
+#27= (CONVERSION_BASED_UNIT('MILLIMETRE',#41)LENGTH_UNIT()NAMED_UNIT(#44));
+#28= (NAMED_UNIT(#46)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#29= (NAMED_UNIT(#46)SOLID_ANGLE_UNIT()SI_UNIT($,.STERADIAN.));
+#31=PRODUCT('1','1','PART-1-DESC',(#52));
+#32=PRODUCT_DEFINITION('NONE','NONE',#53,#1);
+#33=MANIFOLD_SOLID_BREP('1',#54);
+#34=AXIS2_PLACEMENT_3D('',#55,#56,#57);
+#35=PRODUCT('2','2','PART-2-DESC',(#58));
+#36=PRODUCT_DEFINITION('NONE','NONE',#59,#5);
+#37=MANIFOLD_SOLID_BREP('2',#60);
+#38=AXIS2_PLACEMENT_3D('',#61,#62,#63);
+#41=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0),#64);
+#44=DIMENSIONAL_EXPONENTS(1.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#46=DIMENSIONAL_EXPONENTS(0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#52=PRODUCT_CONTEXT('',#13,'mechanical');
+#53=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#31,.NOT_KNOWN.);
+#54=CLOSED_SHELL('',(#65,#66,#67,#68,#69,#70));
+#55=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#56=DIRECTION('',(0.0,0.0,1.0));
+#57=DIRECTION('',(1.0,0.0,0.0));
+#58=PRODUCT_CONTEXT('',#18,'mechanical');
+#59=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#35,.NOT_KNOWN.);
+#60=CLOSED_SHELL('',(#71,#72,#73,#74));
+#61=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#62=DIRECTION('',(0.0,0.0,1.0));
+#63=DIRECTION('',(1.0,0.0,0.0));
+#64= (NAMED_UNIT(#44)LENGTH_UNIT()SI_UNIT(.MILLI.,.METRE.));
+#65=ADVANCED_FACE('',(#76),#77,.T.);
+#66=ADVANCED_FACE('',(#78),#79,.F.);
+#67=ADVANCED_FACE('',(#80),#81,.F.);
+#68=ADVANCED_FACE('',(#82),#83,.F.);
+#69=ADVANCED_FACE('',(#84),#85,.F.);
+#70=ADVANCED_FACE('',(#86),#87,.F.);
+#71=ADVANCED_FACE('',(#88),#89,.T.);
+#72=ADVANCED_FACE('',(#90),#91,.T.);
+#73=ADVANCED_FACE('',(#92),#93,.T.);
+#74=ADVANCED_FACE('',(#94),#95,.T.);
+#76=FACE_OUTER_BOUND('',#96,.T.);
+#77=PLANE('',#97);
+#78=FACE_OUTER_BOUND('',#98,.T.);
+#79=PLANE('',#99);
+#80=FACE_OUTER_BOUND('',#100,.T.);
+#81=PLANE('',#101);
+#82=FACE_OUTER_BOUND('',#102,.T.);
+#83=PLANE('',#103);
+#84=FACE_OUTER_BOUND('',#104,.T.);
+#85=PLANE('',#105);
+#86=FACE_OUTER_BOUND('',#106,.T.);
+#87=PLANE('',#107);
+#88=FACE_OUTER_BOUND('',#108,.T.);
+#89=CYLINDRICAL_SURFACE('',#109,5.0);
+#90=FACE_OUTER_BOUND('',#110,.T.);
+#91=CYLINDRICAL_SURFACE('',#111,5.0);
+#92=FACE_OUTER_BOUND('',#112,.T.);
+#93=PLANE('',#113);
+#94=FACE_OUTER_BOUND('',#114,.T.);
+#95=PLANE('',#115);
+#96=EDGE_LOOP('',(#116,#117,#118,#119));
+#97=AXIS2_PLACEMENT_3D('',#120,#121,#122);
+#98=EDGE_LOOP('',(#123,#124,#125,#126));
+#99=AXIS2_PLACEMENT_3D('',#127,#128,#129);
+#100=EDGE_LOOP('',(#130,#131,#132,#133));
+#101=AXIS2_PLACEMENT_3D('',#134,#135,#136);
+#102=EDGE_LOOP('',(#137,#138,#139,#140));
+#103=AXIS2_PLACEMENT_3D('',#141,#142,#143);
+#104=EDGE_LOOP('',(#144,#145,#146,#147));
+#105=AXIS2_PLACEMENT_3D('',#148,#149,#150);
+#106=EDGE_LOOP('',(#151,#152,#153,#154));
+#107=AXIS2_PLACEMENT_3D('',#155,#156,#157);
+#108=EDGE_LOOP('',(#158,#159,#160,#161));
+#109=AXIS2_PLACEMENT_3D('',#162,#163,#164);
+#110=EDGE_LOOP('',(#165,#166,#167,#168));
+#111=AXIS2_PLACEMENT_3D('',#169,#170,#171);
+#112=EDGE_LOOP('',(#172,#173));
+#113=AXIS2_PLACEMENT_3D('',#174,#175,#176);
+#114=EDGE_LOOP('',(#177,#178));
+#115=AXIS2_PLACEMENT_3D('',#179,#180,#181);
+#116=ORIENTED_EDGE('',*,*,#182,.T.);
+#117=ORIENTED_EDGE('',*,*,#183,.T.);
+#118=ORIENTED_EDGE('',*,*,#184,.T.);
+#119=ORIENTED_EDGE('',*,*,#185,.T.);
+#120=CARTESIAN_POINT('',(30.0,0.0,5.0));
+#121=DIRECTION('',(0.0,0.0,1.0));
+#122=DIRECTION('',(1.0,0.0,0.0));
+#123=ORIENTED_EDGE('',*,*,#186,.T.);
+#124=ORIENTED_EDGE('',*,*,#187,.T.);
+#125=ORIENTED_EDGE('',*,*,#188,.T.);
+#126=ORIENTED_EDGE('',*,*,#189,.T.);
+#127=CARTESIAN_POINT('',(30.0,0.0,-5.0));
+#128=DIRECTION('',(0.0,0.0,1.0));
+#129=DIRECTION('',(1.0,0.0,0.0));
+#130=ORIENTED_EDGE('',*,*,#190,.T.);
+#131=ORIENTED_EDGE('',*,*,#187,.F.);
+#132=ORIENTED_EDGE('',*,*,#191,.F.);
+#133=ORIENTED_EDGE('',*,*,#185,.F.);
+#134=CARTESIAN_POINT('',(30.0,-5.0,0.0));
+#135=DIRECTION('',(0.0,1.0,0.0));
+#136=DIRECTION('',(0.0,0.0,1.0));
+#137=ORIENTED_EDGE('',*,*,#192,.T.);
+#138=ORIENTED_EDGE('',*,*,#188,.F.);
+#139=ORIENTED_EDGE('',*,*,#190,.F.);
+#140=ORIENTED_EDGE('',*,*,#184,.F.);
+#141=CARTESIAN_POINT('',(25.0,0.0,0.0));
+#142=DIRECTION('',(1.0,0.0,0.0));
+#143=DIRECTION('',(0.0,0.0,-1.0));
+#144=ORIENTED_EDGE('',*,*,#193,.T.);
+#145=ORIENTED_EDGE('',*,*,#189,.F.);
+#146=ORIENTED_EDGE('',*,*,#192,.F.);
+#147=ORIENTED_EDGE('',*,*,#183,.F.);
+#148=CARTESIAN_POINT('',(30.0,5.0,0.0));
+#149=DIRECTION('',(0.0,-1.0,0.0));
+#150=DIRECTION('',(0.0,0.0,-1.0));
+#151=ORIENTED_EDGE('',*,*,#191,.T.);
+#152=ORIENTED_EDGE('',*,*,#186,.F.);
+#153=ORIENTED_EDGE('',*,*,#193,.F.);
+#154=ORIENTED_EDGE('',*,*,#182,.F.);
+#155=CARTESIAN_POINT('',(35.0,0.0,0.0));
+#156=DIRECTION('',(-1.0,0.0,0.0));
+#157=DIRECTION('',(0.0,0.0,1.0));
+#158=ORIENTED_EDGE('',*,*,#194,.F.);
+#159=ORIENTED_EDGE('',*,*,#195,.F.);
+#160=ORIENTED_EDGE('',*,*,#196,.F.);
+#161=ORIENTED_EDGE('',*,*,#197,.F.);
+#162=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#163=DIRECTION('',(0.0,0.0,1.0));
+#164=DIRECTION('',(1.0,0.0,0.0));
+#165=ORIENTED_EDGE('',*,*,#194,.T.);
+#166=ORIENTED_EDGE('',*,*,#198,.F.);
+#167=ORIENTED_EDGE('',*,*,#196,.T.);
+#168=ORIENTED_EDGE('',*,*,#199,.F.);
+#169=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#170=DIRECTION('',(0.0,0.0,1.0));
+#171=DIRECTION('',(1.0,0.0,0.0));
+#172=ORIENTED_EDGE('',*,*,#199,.T.);
+#173=ORIENTED_EDGE('',*,*,#195,.T.);
+#174=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#175=DIRECTION('',(0.0,0.0,-1.0));
+#176=DIRECTION('',(-1.0,0.0,0.0));
+#177=ORIENTED_EDGE('',*,*,#197,.T.);
+#178=ORIENTED_EDGE('',*,*,#198,.T.);
+#179=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#180=DIRECTION('',(0.0,0.0,1.0));
+#181=DIRECTION('',(1.0,0.0,0.0));
+#182=EDGE_CURVE('',#200,#201,#202,.T.);
+#183=EDGE_CURVE('',#201,#203,#204,.T.);
+#184=EDGE_CURVE('',#203,#205,#206,.T.);
+#185=EDGE_CURVE('',#205,#200,#207,.T.);
+#186=EDGE_CURVE('',#208,#209,#210,.T.);
+#187=EDGE_CURVE('',#209,#211,#212,.T.);
+#188=EDGE_CURVE('',#211,#213,#214,.T.);
+#189=EDGE_CURVE('',#213,#208,#215,.T.);
+#190=EDGE_CURVE('',#205,#211,#216,.T.);
+#191=EDGE_CURVE('',#200,#209,#217,.T.);
+#192=EDGE_CURVE('',#203,#213,#218,.T.);
+#193=EDGE_CURVE('',#201,#208,#219,.T.);
+#194=EDGE_CURVE('',#220,#221,#222,.T.);
+#195=EDGE_CURVE('',#223,#220,#224,.T.);
+#196=EDGE_CURVE('',#225,#223,#226,.T.);
+#197=EDGE_CURVE('',#221,#225,#227,.T.);
+#198=EDGE_CURVE('',#225,#221,#228,.T.);
+#199=EDGE_CURVE('',#220,#223,#229,.T.);
+#200=VERTEX_POINT('',#230);
+#201=VERTEX_POINT('',#231);
+#202=LINE('',#232,#233);
+#203=VERTEX_POINT('',#234);
+#204=LINE('',#235,#236);
+#205=VERTEX_POINT('',#237);
+#206=LINE('',#238,#239);
+#207=LINE('',#240,#241);
+#208=VERTEX_POINT('',#242);
+#209=VERTEX_POINT('',#243);
+#210=LINE('',#244,#245);
+#211=VERTEX_POINT('',#246);
+#212=LINE('',#247,#248);
+#213=VERTEX_POINT('',#249);
+#214=LINE('',#250,#251);
+#215=LINE('',#252,#253);
+#216=LINE('',#254,#255);
+#217=LINE('',#256,#257);
+#218=LINE('',#258,#259);
+#219=LINE('',#260,#261);
+#220=VERTEX_POINT('',#262);
+#221=VERTEX_POINT('',#263);
+#222=LINE('',#264,#265);
+#223=VERTEX_POINT('',#266);
+#224=CIRCLE('',#267,5.0);
+#225=VERTEX_POINT('',#268);
+#226=LINE('',#269,#270);
+#227=CIRCLE('',#271,5.0);
+#228=CIRCLE('',#272,5.0);
+#229=CIRCLE('',#273,5.0);
+#230=CARTESIAN_POINT('',(35.0,-5.0,5.0));
+#231=CARTESIAN_POINT('',(35.0,5.0,5.0));
+#232=CARTESIAN_POINT('',(35.0,0.0,5.0));
+#233=VECTOR('',#274,1.0);
+#234=CARTESIAN_POINT('',(25.0,5.0,5.0));
+#235=CARTESIAN_POINT('',(30.0,5.0,5.0));
+#236=VECTOR('',#275,1.0);
+#237=CARTESIAN_POINT('',(25.0,-5.0,5.0));
+#238=CARTESIAN_POINT('',(25.0,0.0,5.0));
+#239=VECTOR('',#276,1.0);
+#240=CARTESIAN_POINT('',(30.0,-5.0,5.0));
+#241=VECTOR('',#277,1.0);
+#242=CARTESIAN_POINT('',(35.0,5.0,-5.0));
+#243=CARTESIAN_POINT('',(35.0,-5.0,-5.0));
+#244=CARTESIAN_POINT('',(35.0,0.0,-5.0));
+#245=VECTOR('',#278,1.0);
+#246=CARTESIAN_POINT('',(25.0,-5.0,-5.0));
+#247=CARTESIAN_POINT('',(30.0,-5.0,-5.0));
+#248=VECTOR('',#279,1.0);
+#249=CARTESIAN_POINT('',(25.0,5.0,-5.0));
+#250=CARTESIAN_POINT('',(25.0,0.0,-5.0));
+#251=VECTOR('',#280,1.0);
+#252=CARTESIAN_POINT('',(30.0,5.0,-5.0));
+#253=VECTOR('',#281,1.0);
+#254=CARTESIAN_POINT('',(25.0,-5.0,0.0));
+#255=VECTOR('',#282,1.0);
+#256=CARTESIAN_POINT('',(35.0,-5.0,0.0));
+#257=VECTOR('',#283,1.0);
+#258=CARTESIAN_POINT('',(25.0,5.0,0.0));
+#259=VECTOR('',#284,1.0);
+#260=CARTESIAN_POINT('',(35.0,5.0,0.0));
+#261=VECTOR('',#285,1.0);
+#262=CARTESIAN_POINT('',(5.0,0.0,-5.0));
+#263=CARTESIAN_POINT('',(5.0,0.0,5.0));
+#264=CARTESIAN_POINT('',(5.0,-6.12303176911189E-16,0.0));
+#265=VECTOR('',#286,1.0);
+#266=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,-5.0));
+#267=AXIS2_PLACEMENT_3D('',#287,#288,#289);
+#268=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,5.0));
+#269=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,0.0));
+#270=VECTOR('',#290,1.0);
+#271=AXIS2_PLACEMENT_3D('',#291,#292,#293);
+#272=AXIS2_PLACEMENT_3D('',#294,#295,#296);
+#273=AXIS2_PLACEMENT_3D('',#297,#298,#299);
+#274=DIRECTION('',(0.0,1.0,0.0));
+#275=DIRECTION('',(-1.0,0.0,0.0));
+#276=DIRECTION('',(0.0,-1.0,0.0));
+#277=DIRECTION('',(1.0,0.0,0.0));
+#278=DIRECTION('',(0.0,-1.0,0.0));
+#279=DIRECTION('',(-1.0,0.0,0.0));
+#280=DIRECTION('',(0.0,1.0,0.0));
+#281=DIRECTION('',(1.0,0.0,0.0));
+#282=DIRECTION('',(0.0,0.0,-1.0));
+#283=DIRECTION('',(0.0,0.0,-1.0));
+#284=DIRECTION('',(0.0,0.0,-1.0));
+#285=DIRECTION('',(0.0,0.0,-1.0));
+#286=DIRECTION('',(0.0,0.0,1.0));
+#287=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#288=DIRECTION('',(0.0,0.0,-1.0));
+#289=DIRECTION('',(1.0,0.0,0.0));
+#290=DIRECTION('',(-0.0,-0.0,-1.0));
+#291=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#292=DIRECTION('',(0.0,0.0,1.0));
+#293=DIRECTION('',(1.0,0.0,0.0));
+#294=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#295=DIRECTION('',(0.0,0.0,1.0));
+#296=DIRECTION('',(1.0,0.0,0.0));
+#297=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#298=DIRECTION('',(0.0,0.0,-1.0));
+#299=DIRECTION('',(1.0,0.0,0.0));
+ENDSEC;
+END-ISO-10303-21;
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index f440f6a..cb362c9 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -26,7 +26,8 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test \
+ read_cgm_group_test
else
CGM_TEST =
endif
@@ -74,7 +75,13 @@ ccmio_test_SOURCES = $(srcdir)/../TestUtil.hpp ccmio_test.cpp
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)
+read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cpp
+read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_connectivity_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_connectivity_test.cpp
+read_cgm_connectivity_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_group_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_group_test.cpp
+read_cgm_group_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(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
index 7a2d07d..75dcd1e 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -8,6 +8,8 @@
#include "Internals.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
using namespace moab;
@@ -31,40 +33,299 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
-void read_cube_test()
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void read_cube_verts_test();
+void read_cube_curves_test();
+void read_cube_tris_test();
+void read_cube_surfs_test();
+void read_cube_vols_test();
+void read_cube_vertex_pos_test();
+//void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
{
- Core mb;
+ int result = 0;
- ErrorCode rval = mb.load_file(input_cube); CHECK_ERR(rval);
+ result += RUN_TEST(read_cube_verts_test);
+ result += RUN_TEST(read_cube_curves_test);
+ result += RUN_TEST(read_cube_tris_test);
+ result += RUN_TEST(read_cube_surfs_test);
+ result += RUN_TEST(read_cube_vols_test);
+ result += RUN_TEST(read_cube_vertex_pos_test);
+
+ return result;
+}
+
- Tag geom_tag;
- rval = mb.tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
- geom_tag, MB_TAG_SPARSE|MB_TAG_CREAT);
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
+}
+
+// Gets the vertex entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_verts_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ int number_of_vertices;
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_vertices );
+ CHECK_ERR(rval);
+ //For a cube there should be exactly 8 vertices
+ CHECK_EQUAL( 8, number_of_vertices );
+}
+
+// Gets the triangle entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_tris_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
int number_of_tris;
- rval = mb.get_number_entities_by_type(0, MBTRI , 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);
+ //For a cube, there should be exactly 2 triangles per face
+ CHECK_EQUAL( 12, number_of_tris );
+}
- int number_of_vertices;
- rval = mb.get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+// Gets the curve entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_curves_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+ //Get the geometry tag handle from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
+ //Get the curves from the mesh
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ //For a cube, there should be exactly 12 curves loaded from the file
+ CHECK_EQUAL( 12, number_of_curves );
+}
- if( number_of_tris != 12) rval = MB_FAILURE; CHECK_ERR(rval);
-
- if( number_of_vertices !=8) rval = MB_FAILURE; CHECK_ERR(rval);
+// Gets the surface entities from a simple cube file load and checks that the
+// correct number of them exist.
+void read_cube_surfs_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the number of surface from the mesh geometry data
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+ //For a cube, there should be exactly 6 surfaces
+ CHECK_EQUAL( 6, number_of_surfs );
}
+
+void read_cube_vols_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
-int main(int /* argc */, char** /* argv */)
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the number of volumes from the mesh geometry data
+ int dim = 3;
+ void *val[] = {&dim};
+ int number_of_vols;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_vols );
+ CHECK_ERR(rval);
+ CHECK_EQUAL( 1, number_of_vols );
+}
+
+// Gets the vertex eitities from a simple cube file load and checks that
+// they are in the correct locations.
+void read_cube_vertex_pos_test()
{
- int result = 0;
- result += RUN_TEST( read_cube_test );
-
- return result;
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Retrieve all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR( rval );
+
+ int number_of_verts = verts.size();
+ CHECK_EQUAL( 8, number_of_verts );
+ //Get the vertex coordinates
+ double x[8];
+ double y[8];
+ double z[8];
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
+ CHECK_ERR(rval);
+
+ //Check against known locations of the vertices
+
+ std::vector<double> x_ref;
+ std::vector<double> y_ref;
+ std::vector<double> z_ref;
+
+ // Vertex 1
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 2
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 3
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 4
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 5
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 6
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 7
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 8
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ std::cout << verts.size() << std::endl;
+ std::cout << x_ref.size() << std::endl;
+
+ for(unsigned int i=0; i<verts.size(); i++)
+ {
+ for(unsigned int j=0; j<x_ref.size(); j++)
+ {
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j] )
+ {
+ x_ref.erase( x_ref.begin()+j );
+ y_ref.erase( y_ref.begin()+j );
+ z_ref.erase( z_ref.begin()+j );
+ }
+ }
+ }
+
+ //After looping through each vertex loaded from the mesh
+ //there should be no entities left in the reference vector
+ int leftovers = x_ref.size();
+ CHECK_EQUAL( 0, leftovers );
+
}
+
+//Superfluous test for ReadCGM, but perhaps better
+//than the test in place for moab::delete_geometry()
+
+
+/*
+void delete_mesh_test()
+{
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ ErrorCode rval;
+
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range geom_sets[4];
+
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, geom_sets[dim] );
+ CHECK_ERR(rval);
+
+ if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
+
+ }
+
+ mb->delete_mesh();
+
+ Range geom_sets_after[4];
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val_after[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val_after, 1, geom_sets_after[dim] );
+ CHECK_ERR(rval);
+
+ if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
+
+ CHECK_ERR(rval);
+ }
+
+}
+
+*/
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
new file mode 100644
index 0000000..b750cbc
--- /dev/null
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -0,0 +1,252 @@
+
+#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"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+#include "moab/MeshTopoUtil.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
+
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void cube_verts_connectivity_test();
+void cube_tris_connectivity_test();
+void cube_tri_curve_coincidence_test();
+void cube_edge_adjacencies_test();
+void cube_tri_vertex_test();
+
+//Other functions
+void match_tri_edges_w_curve( Range tri_edges, Range curves );
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST(cube_verts_connectivity_test);
+ result += RUN_TEST(cube_tris_connectivity_test);
+ result += RUN_TEST(cube_tri_curve_coincidence_test);
+ result += RUN_TEST(cube_tri_vertex_test);
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+// Checks the adjacency of each vertex entity in a simple cube file load
+// to make sure it isn't adjacent to too many or too few triangles.
+void cube_verts_connectivity_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR(rval);
+
+ //Check that each vertex connects to at least 4 and no more than 6 triangles
+ for(Range::const_iterator i = verts.begin(); i!=verts.end(); i++)
+ {
+ std::vector<EntityHandle> adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
+ CHECK_ERR(rval);
+
+ int adj_size = adj_tris.size();
+ CHECK( adj_size >= 4 && adj_size <= 6 );
+ }
+
+}
+
+// Check that each triangle in the mesh is adjacent to
+// exactly three other triangles
+void cube_tris_connectivity_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ int expected_num_of_adj_tris = 3;
+
+ for(Range::const_iterator i = tris.begin()+1; i!=tris.end(); i++)
+ {
+ Range adj_tris;
+ moab::MeshTopoUtil mu(mb);
+ //Use Triangle edges to get all adjacent triangles
+ rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris );
+ CHECK_ERR(rval);
+ CHECK_EQUAL( expected_num_of_adj_tris, (int)adj_tris.size() );
+
+ //Check that the entities we found from bridge_adjacencies
+ //are triangles
+ Range adj_tri_test = adj_tris.subset_by_type( MBTRI );
+ CHECK_EQUAL( (int)adj_tris.size(), (int) adj_tri_test.size() );
+
+ }
+
+}
+
+
+// Takes triangle edges and makes sure they match the EntityHandles of
+// curves in the case of a cube mesh
+void cube_tri_curve_coincidence_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get curves from the mesh
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
+ CHECK_ERR(rval);
+ curves.print();
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get the any curve edges that are a part of the triangle
+ Range tri_edges;
+ rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges );
+ CHECK_ERR(rval);
+ //Check that we've retrieved two edges from get_adjacencies
+ //For a this file (cube), each triangle should have two curve
+ //edges
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL( 2, num_of_tri_edges );
+ match_tri_edges_w_curve( tri_edges, curves );
+ CHECK_ERR(rval);
+ }
+}
+
+void match_tri_edges_w_curve( Range tri_edges, Range curves )
+{
+ int match_counter=0;
+ int num_of_tri_edges = tri_edges.size();
+ CHECK(num_of_tri_edges);
+ for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
+ {
+ for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
+ {
+ // If the edge handle matches a curve handle, increment the number
+ // matches
+ if( *i == *j ) match_counter++;
+ }
+ }
+ //Make sure that each edge returned from triangle edges
+ //has been matched to a curve
+ CHECK_EQUAL( num_of_tri_edges, match_counter );
+}
+
+// Ensures that each triangle edge is adjacent to no more than
+// two triangles.
+void cube_edge_adjacencies_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get the curves
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=curves.begin(); i!=curves.end(); i++)
+ {
+ //Get triangle adjacent to each edge
+ Range adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
+ CHECK_ERR(rval);
+
+ int num_adj_tris = adj_tris.size();
+ //Ensure that no edge is adjacent to more than two triangles
+ CHECK( num_adj_tris <= 2 );
+ }
+
+}
+
+// Checks, for each triangle, that none of the verices are the same
+void cube_tri_vertex_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all triangles
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get all triangle vertices
+ Range verts;
+ rval = mb->get_connectivity( &(*i), 1, verts );
+ CHECK_ERR(rval);
+ //Make sure that each vertex making up
+ //the triangle is different
+ int number_of_verts = verts.size();
+ CHECK( 3 == number_of_verts );
+ CHECK( verts[0]!=verts[1] );
+ CHECK( verts[1]!=verts[2] );
+ CHECK( verts[2]!=verts[0] );
+ }
+}
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
new file mode 100644
index 0000000..1098457
--- /dev/null
+++ b/test/io/read_cgm_group_test.cpp
@@ -0,0 +1,207 @@
+
+#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"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.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_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+#else
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+//Function for getting entity ids
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+//Function for checking retrieved group data
+void check_group_data( std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids );
+
+//Function for loading all reference data
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids);
+
+// List of tests in this file
+void read_cylcube_groups_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result+=RUN_TEST(read_cylcube_groups_test);
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+// Checks that group information is being read correctly if MOAB is
+// being build with CGM. If MOAB is built with OCC, it makes sure
+// no erroneous group data is loaded as STEP files do not hold
+// information about groups.
+void read_cylcube_groups_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube);
+
+ //Get (or create) the name and category tags
+ Tag name_tag, category_tag;
+
+ rval = mb->tag_get_handle( NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
+ name_tag, moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ rval = mb->tag_get_handle( CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE,
+ MB_TYPE_OPAQUE, category_tag,
+ moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the group entity handles
+ Range group_sets;
+ char query[CATEGORY_TAG_SIZE] = "Group\0";
+ //Has to be this way because of the way tags are created
+ void* val[] = {&query};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
+ CHECK_ERR(rval);
+ //Get group names and IDs
+ std::vector<int> g_ids;
+ std::vector<std::string> g_names;
+ std::vector<int> g_ent_ids;
+
+ for(Range::iterator i=group_sets.begin(); i!=group_sets.end(); i++)
+ {
+ int group_id = geom_id_by_handle( mb, *i );
+ g_ids.push_back(group_id);
+ //Get the group name
+ char group_name[NAME_TAG_SIZE+1];
+ rval = mb->tag_get_data( name_tag, &(*i), 1, &group_name);
+ CHECK_ERR(rval);
+ //Store group name
+ std::string temp(group_name);
+ g_names.push_back(temp);
+ //Get all entities in the group
+ Range group_ents;
+ rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false );
+ CHECK_ERR(rval);
+ if( group_ents.size() != 1) CHECK(false);
+ int grp_ent_id = geom_id_by_handle( mb, group_ents[0] );
+ g_ent_ids.push_back(grp_ent_id);
+
+ }
+ check_group_data( g_ids, g_names, g_ent_ids );
+}
+
+
+void check_group_data(std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids )
+{
+
+ // Step files do not contain group data, MOAB shouldn't return errors when trying to access
+ // this data but there shouldn't be any found.
+#ifdef HAVE_OCC_STEP
+ int num_g_ids = group_ids.size();
+ int num_g_names = group_names.size();
+
+ CHECK_EQUAL( 0, num_g_ids );
+ CHECK_EQUAL( 0, num_g_names );
+#else
+
+
+ //Initialize reference data
+ std::vector<int> group_ref_ids;
+ std::vector<std::string> group_ref_names;
+ std::vector<int> group_ref_ent_ids;
+ load_group_references( group_ref_ids, group_ref_names, group_ref_ent_ids );
+
+ // check that the correct number of entities were found
+ CHECK_EQUAL ( group_ref_ids.size(), group_ids.size() );
+ CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
+ CHECK_EQUAL ( group_ref_ent_ids.size(), group_ent_ids.size() );
+
+ //now make sure that each group has a matching group
+ for(unsigned int i=0 ; i<group_ids.size(); i++)
+ {
+ for(unsigned int j=0; j<group_ref_ids.size(); j++)
+ {
+ if( group_ids[i]==group_ref_ids[j]
+ && group_names[i] == group_ref_names[j]
+ && group_ent_ids[i]==group_ref_ent_ids[j])
+ {
+ group_ref_ids.erase(group_ref_ids.begin()+j);
+ group_ref_names.erase(group_ref_names.begin()+j);
+ group_ref_ent_ids.erase(group_ref_ent_ids.begin()+j);
+ continue;
+ }
+ }
+ }
+
+ // Check sizes of reference vectors after matching
+ // (all should be zero)
+ int leftovers = group_ref_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_names.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_ent_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+#endif
+}
+
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids )
+{
+ //First set of group info
+ names.push_back("Group 3"); ids.push_back(3); ent_ids.push_back(2);
+
+ //Second set of group info
+ names.push_back("Group 2"); ids.push_back(2); ent_ids.push_back(1);
+}
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ CHECK_ERR(rval);
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
index 5377220..0a0f8ee 100644
--- a/test/io/read_cgm_load_test.cpp
+++ b/test/io/read_cgm_load_test.cpp
@@ -29,20 +29,22 @@ static const char input_file[] = "dum.sat";
#endif
#endif
+// Checks that a file can be loaded twice without errors
void read_multiple_test()
{
Core mb;
- ErrorCode rval = mb.load_file(input_file);
+ ErrorCode rval = mb.load_file( input_file );
CHECK_ERR(rval);
// second load
- rval = mb.load_file(input_file);
+ 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_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
new file mode 100644
index 0000000..26f3632
--- /dev/null
+++ b/test/io/read_cgm_senses_test.cpp
@@ -0,0 +1,584 @@
+
+#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"
+#include "moab/GeomTopoTool.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
+#define SENSE_FORWARD 1
+#define SENSE_REVERSE -1
+#define SENSE_UNKNOWN 0
+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_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+#else
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// Functions containing known sense data
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+
+// Functions used to compare sense information found in
+// the model to reference information
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses );
+
+//Function used to get id's from entity handles
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+// List of tests in this file
+void read_cylcube_curve_senses_test();
+void read_cylcube_surf_senses_test();
+void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST(read_cylcube_curve_senses_test);
+ result += RUN_TEST(read_cylcube_surf_senses_test);
+
+ return result;
+}
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+// Gets the sense data for each curve from a file
+// containing a cube and a cylinder. It then checks
+// that this sense data matches the reference
+// sense data from prior file reads.
+void read_cylcube_curve_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube );
+
+ //Get all curve handles
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of curves exist
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ //Step format adds a surface on the barrel of the cylinder.
+ //This created 4 extra surfaces in comparison to the .sat format from Cubit.
+ //(New surface breaks the barrel of the cylinder into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 18, number_of_curves );
+#else
+ CHECK_EQUAL( 14, number_of_curves );
+#endif
+
+ //Get curve handles
+ Range curves;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, curves );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get curve data
+ moab::GeomTopoTool gt( mb, false );
+ // Initialize vectors for sense checking
+ std::vector<EntityHandle> surfs;
+ std::vector<int> senses;
+ std::vector<int> known_surf_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < curves.size() ; i++)
+ {
+
+ //Clean data from previous curve
+ surfs.clear();
+ senses.clear();
+ //Get sense info for the current curve
+ gt.get_senses( curves[i], surfs, senses );
+ CHECK_ERR(rval);
+
+ //Clear reference data from previous curve
+ known_surf_ids.clear();
+ known_senses.clear();
+ //Load known curve-sense ID data
+#ifdef HAVE_OCC_STEP
+ rval = load_stp_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
+#else
+ rval = load_sat_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
+#endif
+
+ //Check that each surf and sense has a match in the references
+ check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
+ }
+}
+
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ CHECK_ERR(rval);
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
+
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses )
+{
+
+ //Get ID's of the wrt entities
+ std::vector<int> wrt_ent_ids;
+ for(unsigned int i=0 ; i<wrt_ents.size() ; i++)
+ {
+ wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ) );
+ }
+
+ for(unsigned int i=0; i< wrt_ent_ids.size() ; i++)
+ {
+ for(unsigned int j=0; j< known_wrt_ids.size(); j++)
+ {
+ if( wrt_ent_ids[i] == known_wrt_ids [j] )
+ {
+ // Make sure the senses of the matching wrt entities
+ // are correct
+ CHECK_EQUAL( senses[i], known_senses[j] );
+ //Once a wrt entity is matched with a known entity,
+ // remove it from the list
+ wrt_ent_ids.erase( wrt_ent_ids.begin()+i );
+ senses.erase( senses.begin()+i );
+ }
+ }
+ }
+
+ // After both loops are complete, known_wrt_ents should be empty
+ int leftovers = wrt_ent_ids.size();
+ CHECK_EQUAL( leftovers, 0 );
+
+}
+
+//Loads two vectors with reference curve and curve_sense data
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
+
+ int curve_id = geom_id_by_handle( moab, curve );
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+//Loads two vectors with reference curve and curve_sense data
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
+
+ int curve_id = geom_id_by_handle( moab, curve );
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 15:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 16:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 17:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 18:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+// SURFACE SENSE CHECKING
+// Gets the sense data for each surface from a file
+// containing a cube and a cylinder. It then checks
+// that this sense data matches the reference
+// sense data from prior file reads.
+void read_cylcube_surf_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube );
+
+ //Get geometry tag for gathering surface information from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of surfaces exist
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+ //Step format adds a surface on barrel of the cylinder.
+ // (Breaks it into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 10, number_of_surfs );
+#else
+ CHECK_EQUAL( 9, number_of_surfs );
+#endif
+ // Get surface handles
+ Range surfs;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, surfs );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get surf data
+ moab::GeomTopoTool gt( mb, false );
+ std::vector<EntityHandle> vols;
+ std::vector<int> senses;
+ std::vector<int> known_vol_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < surfs.size(); i++)
+ {
+ //Clean data from previous surface
+ vols.clear();
+ senses.clear();
+ // Get sense information for the current
+ // surface from the mesh
+ gt.get_senses( surfs[i], vols, senses );
+ CHECK_ERR(rval);
+ //Clear previous reverence data
+ known_vol_ids.clear();
+ known_senses.clear();
+ // Load known surface-volume data
+ // for this surface and check that it's correct
+#ifdef HAVE_OCC_STEP
+ rval = load_stp_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
+#else
+ rval = load_sat_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
+#endif
+ // Check sense information from the loaded mesh against
+ // reference sense information
+ check_sense_data( mb, vols, senses, known_vol_ids, known_senses );
+
+ }
+
+}
+
+//Loads reference surface to volume sense data into the reference vectors
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf );
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+//Loads reference surface to volume sense data into the reference vectors
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf );
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 10:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ std::cout << "Failure to find surface sense reference data. Returning failure..." << std::endl;
+ return MB_FAILURE;
+ }
+ return MB_SUCCESS;
+}
+
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.
1
0
77 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/c6acfd1636cc/
Changeset: c6acfd1636cc
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: Created a new file for basic tests on ReadCGM using a simple geometry. Old ReadCGM test filed renamed to reduce confusion.
Affected #: 2 files
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 7a2d07d..a79c84a 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -31,6 +31,7 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
+
void read_cube_test()
{
Core mb;
diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
index 5377220..9704ee7 100644
--- a/test/io/read_cgm_load_test.cpp
+++ b/test/io/read_cgm_load_test.cpp
@@ -43,7 +43,8 @@ void read_multiple_test()
int main(int /* argc */, char** /* argv */)
{
- int result = RUN_TEST( read_multiple_test );
+
+ int result = RUN_TEST( read_multiple_test ) ;
return result;
}
https://bitbucket.org/fathomteam/moab/commits/4d060258cf98/
Changeset: 4d060258cf98
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: Removed unused tag_get_handle call in read_cgm testing
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index a79c84a..301881d 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -38,10 +38,6 @@ void read_cube_test()
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;
https://bitbucket.org/fathomteam/moab/commits/e72329531d60/
Changeset: e72329531d60
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: Attempt at fixing the problem with loading a file multiple times in clean MOAB instances.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 301881d..e0f7a3b 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -31,23 +31,32 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
+void read_file( Interface* moab, const char* input_file );
+void read_cube_test();
-void read_cube_test()
-{
- Core mb;
-
- ErrorCode rval = mb.load_file(input_cube); CHECK_ERR(rval);
+void read_file( Interface* moab, const char* input_file )
+{
+ ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
+}
+
+void read_cube_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ mb->delete_mesh();
+ read_file( mb, input_cube );
int number_of_tris;
- rval = mb.get_number_entities_by_type(0, MBTRI , 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);
+ rval = mb->get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
CHECK_ERR(rval);
@@ -55,13 +64,15 @@ void read_cube_test()
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 );
result += RUN_TEST( read_cube_test );
-
+
return result;
}
https://bitbucket.org/fathomteam/moab/commits/48e1819a1808/
Changeset: 48e1819a1808
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: More changes to decypher how to create new moab instances.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index e0f7a3b..b4dea11 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -46,7 +46,6 @@ void read_cube_test()
ErrorCode rval;
Core moab;
Interface* mb = &moab;
- mb->delete_mesh();
read_file( mb, input_cube );
int number_of_tris;
@@ -66,12 +65,57 @@ void read_cube_test()
}
+
+void delete_mesh_test()
+{
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ ErrorCode rval;
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range geom_sets[4];
+
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, geom_sets[dim] );
+ CHECK_ERR(rval);
+
+ if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
+
+ }
+
+ mb->delete_mesh();
+
+ Range geom_sets_after[4];
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val_after[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val_after, 1, geom_sets_after[dim] );
+ CHECK_ERR(rval);
+
+ if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
+
+ CHECK_ERR(rval);
+ }
+
+}
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_test );
+ result += RUN_TEST( read_cube_test );
+ result += RUN_TEST( delete_mesh_test );
result += RUN_TEST( read_cube_test );
return result;
https://bitbucket.org/fathomteam/moab/commits/c4c630513af8/
Changeset: c4c630513af8
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: Separated test for cube verts and test for cube triangles. Updated method of value comparison.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index b4dea11..5dd4615 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -41,7 +41,22 @@ void read_file( Interface* moab, const char* input_file )
CHECK_ERR(rval);
}
-void read_cube_test()
+void read_cube_verts_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ int number_of_vertices;
+ rval = mb->get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+ CHECK_ERR(rval);
+
+ CHECK_EQUAL( 8, number_of_vertices);
+}
+
+
+void read_cube_tris_test()
{
ErrorCode rval;
Core moab;
@@ -54,18 +69,20 @@ void read_cube_test()
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);
-
+ CHECK_EQUAL( 12, number_of_tris);
- 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_tris_test );
+ return result;
}
+
void delete_mesh_test()
{
Core moab;
@@ -109,14 +126,4 @@ void delete_mesh_test()
}
}
-
-int main(int /* argc */, char** /* argv */)
-{
- int result = 0;
-
- result += RUN_TEST( read_cube_test );
- result += RUN_TEST( delete_mesh_test );
- result += RUN_TEST( read_cube_test );
-
- return result;
-}
+
https://bitbucket.org/fathomteam/moab/commits/badf6a41d71d/
Changeset: badf6a41d71d
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: Added multiple new tests for the correct number of geometric entities in read_cgm_basic_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 5dd4615..d487a48 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -32,7 +32,6 @@ static const char input_cube[] = "cube.sat";
#endif
void read_file( Interface* moab, const char* input_file );
-void read_cube_test();
void read_file( Interface* moab, const char* input_file )
@@ -72,12 +71,90 @@ void read_cube_tris_test()
CHECK_EQUAL( 12, number_of_tris);
}
-
+
+void read_cube_curves_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range curves;
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+
+
+ CHECK_EQUAL( 12, number_of_curves);
+
+}
+
+void read_cube_surfs_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range curves;
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+
+
+ CHECK_EQUAL( 6, number_of_surfs);
+
+}
+
+void read_cube_vols_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range curves;
+ int dim = 3;
+ void *val[] = {&dim};
+ int number_of_vols;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_vols );
+ CHECK_ERR(rval);
+
+
+ CHECK_EQUAL( 1, number_of_vols);
+
+}
+
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_tris_test );
+ result += RUN_TEST( read_cube_vols_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/3ce6611b059b/
Changeset: 3ce6611b059b
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: Added a function to verify that mesh vertices are in the correct locations.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index d487a48..94e6f7c 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -150,11 +150,81 @@ void read_cube_vols_test()
}
+void read_cube_vertex_pos_test()
+{
+ ErrorCode rval;
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //First check that the correct number of vertices are present
+ int number_of_verts;
+ rval = mb->get_number_entities_by_type( 0 , MBVERTEX , number_of_verts);
+ CHECK_ERR(rval);
+
+ CHECK_EQUAL(8, number_of_verts);
+
+ //Retrieve all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
+ CHECK_ERR(rval);
+
+ //Get the vertex coordinates
+ double x[verts.size()];
+ double y[verts.size()];
+ double z[verts.size()];
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0]);
+ CHECK_ERR(rval);
+
+ //Check against known locations of the vertices
+
+ // Vertex 1
+ CHECK_EQUAL( x[0], 5);
+ CHECK_EQUAL( y[0], -5);
+ CHECK_EQUAL( z[0], 5);
+
+ // Vertex 2
+ CHECK_EQUAL( x[1], 5);
+ CHECK_EQUAL( y[1], 5);
+ CHECK_EQUAL( z[1], 5);
+
+ // Vertex 3
+ CHECK_EQUAL( x[2], -5);
+ CHECK_EQUAL( y[2], 5);
+ CHECK_EQUAL( z[2], 5);
+
+ // Vertex 4
+ CHECK_EQUAL( x[3], -5);
+ CHECK_EQUAL( y[3], -5);
+ CHECK_EQUAL( z[3], 5);
+
+ // Vertex 5
+ CHECK_EQUAL( x[4], 5);
+ CHECK_EQUAL( y[4], 5);
+ CHECK_EQUAL( z[4], -5);
+
+ // Vertex 6
+ CHECK_EQUAL( x[5], 5);
+ CHECK_EQUAL( y[5], -5);
+ CHECK_EQUAL( z[5], -5);
+
+ // Vertex 7
+ CHECK_EQUAL( x[6], -5);
+ CHECK_EQUAL( y[6], -5);
+ CHECK_EQUAL( z[6], -5);
+
+ // Vertex 8
+ CHECK_EQUAL( x[7], -5);
+ CHECK_EQUAL( y[7], 5);
+ CHECK_EQUAL( z[7], -5);
+
+}
+
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_vols_test );
+ result += RUN_TEST( read_cube_vertex_pos_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/44ee45e7b20d/
Changeset: 44ee45e7b20d
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:00
Summary: Added some comments to read_cgm_basic_test.cpp for clarity.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 94e6f7c..1f7c479 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -43,6 +43,7 @@ void read_file( Interface* moab, const char* input_file )
void read_cube_verts_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -58,6 +59,7 @@ void read_cube_verts_test()
void read_cube_tris_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -75,6 +77,7 @@ void read_cube_tris_test()
void read_cube_curves_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -92,7 +95,6 @@ void read_cube_curves_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
CHECK_ERR(rval);
-
CHECK_EQUAL( 12, number_of_curves);
@@ -101,6 +103,7 @@ void read_cube_curves_test()
void read_cube_surfs_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
@@ -127,12 +130,12 @@ void read_cube_surfs_test()
void read_cube_vols_test()
{
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
Tag geom_tag;
-
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
@@ -152,7 +155,9 @@ void read_cube_vols_test()
void read_cube_vertex_pos_test()
{
+
ErrorCode rval;
+ //Open the test file
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
https://bitbucket.org/fathomteam/moab/commits/ccc0b4a7216b/
Changeset: ccc0b4a7216b
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:01
Summary: Restructured the read_cgm_basic_test file. Added comments for clarity.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 1f7c479..06c54ab 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -31,8 +31,29 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
+// Function used to load the test file
void read_file( Interface* moab, const char* input_file );
+// List of tests in this file
+void read_cube_verts_test();
+void read_cube_curves_test();
+void read_cube_surfs_test();
+void read_cube_vols_test();
+void read_cube_vertes_pos_test();
+void read_cube_curve_senses_test();
+void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST( read_cube_curve_senses_test );
+
+ return result;
+}
+
+
void read_file( Interface* moab, const char* input_file )
{
@@ -225,16 +246,6 @@ void read_cube_vertex_pos_test()
}
-int main(int /* argc */, char** /* argv */)
-{
- int result = 0;
-
- result += RUN_TEST( read_cube_vertex_pos_test );
-
- return result;
-}
-
-
void delete_mesh_test()
{
Core moab;
https://bitbucket.org/fathomteam/moab/commits/d9ac9e301790/
Changeset: d9ac9e301790
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:01
Summary: Created a new file for testing the loading of sense data with READ_CGM.
This was done for a simple cube geometry. Cleanup of the code is needed.
Affected #: 2 files
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 6cf835a..31049a1 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -25,7 +25,7 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test
else
CGM_TEST =
endif
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
new file mode 100644
index 0000000..f42abed
--- /dev/null
+++ b/test/io/read_cgm_senses_test.cpp
@@ -0,0 +1,233 @@
+
+#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"
+#include "moab/GeomTopoTool.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
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#else
+static const char input_cube[] = "/io/cube.sat";
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// Functions containing known sense data
+void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+
+// Functions used to compare sense information found in
+// the model to reference information
+
+void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses);
+
+//Function used to get id's from entity handles
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+// List of tests in this file
+void read_cube_curve_senses_test();
+void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST( read_cube_curve_senses_test );
+
+ return result;
+}
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+void read_cube_curve_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all curve handles
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of curves exist
+
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ CHECK_EQUAL(12 , number_of_curves);
+
+ // Get curve handles
+ Range curves;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, curves );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get curve data
+ moab::GeomTopoTool gt(mb, false);
+ std::vector<EntityHandle> surfs;
+ std::vector<int> senses;
+ std::vector<int> known_surf_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < curves.size() ; i++)
+ {
+
+ surfs.clear();
+ senses.clear();
+ //Curve 1
+ gt.get_senses( curves[i], surfs, senses);
+ CHECK_ERR(rval);
+
+ //Load known curve-sense data
+
+ known_surf_ids.clear();
+ known_senses.clear();
+ load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+
+ check_curve_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
+ }
+
+}
+
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set ) {
+
+ErrorCode rval;
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE);
+ assert(MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result);
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ assert(MB_SUCCESS == result);
+ return id;
+ }
+
+void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses)
+{
+
+ std::vector<int> wrt_ent_ids;
+ for( unsigned int i=0 ; i<wrt_ents.size() ; i++)
+ {
+ wrt_ent_ids.push_back(geom_id_by_handle(moab, wrt_ents[i]));
+ }
+
+ for (unsigned int i=0; i< wrt_ent_ids.size() ; i++)
+ {
+ for(unsigned int j=0; j< known_wrt_ids.size(); j++)
+ {
+ if(wrt_ent_ids[i] == known_wrt_ids [j])
+ {
+ CHECK_EQUAL(senses[i],known_senses[j]);
+ known_wrt_ids.erase(known_wrt_ids.begin()+j);
+ known_senses.erase(known_senses.begin()+j);
+ }
+ }
+ }
+
+ int leftovers = known_wrt_ids.size();
+
+ CHECK_EQUAL(leftovers, 0 );
+
+}
+void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
+
+ int curve_id = geom_id_by_handle( moab, curve);
+
+ std::cout << curve_id << std::endl;
+
+
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(-1); senses_out.push_back(1);
+
+ break;
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(1); senses_out.push_back(-1);
+
+ break;
+ }
+
+}
+
https://bitbucket.org/fathomteam/moab/commits/e4945426e8bb/
Changeset: e4945426e8bb
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:01
Summary: Removed curve sense test from read_cgm_basic_test.
This was still there from before the creation of the new file read_cgm_senses_test where this function now lives.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 06c54ab..64ee56b 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -40,7 +40,6 @@ void read_cube_curves_test();
void read_cube_surfs_test();
void read_cube_vols_test();
void read_cube_vertes_pos_test();
-void read_cube_curve_senses_test();
void delete_mesh_test();
@@ -48,7 +47,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_curve_senses_test );
+ result += RUN_TEST( read_cube_verts_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/b25147998ab5/
Changeset: b25147998ab5
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:01
Summary: Added a new test to check the sense loading of a simple cube geometry using READ_CGM.
Again, this new function read_cgm_surf_senses_test along with read_cgm_curve_senses_test needs some cleanup.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index f42abed..fcc2281 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -28,11 +28,11 @@ void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
-
+void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
// the model to reference information
-void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
std::vector<int> known_wrt_ids, std::vector<int> known_senses);
//Function used to get id's from entity handles
@@ -40,6 +40,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set );
// List of tests in this file
void read_cube_curve_senses_test();
+void read_cube_surf_senses_test();
void delete_mesh_test();
@@ -47,7 +48,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_curve_senses_test );
+ result += RUN_TEST( read_cube_surf_senses_test );
return result;
}
@@ -112,7 +113,7 @@ for(unsigned int i = 0; i < curves.size() ; i++)
known_senses.clear();
load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
- check_curve_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
+ check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
}
}
@@ -130,7 +131,7 @@ ErrorCode rval;
return id;
}
-void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
std::vector<int> known_wrt_ids, std::vector<int> known_senses)
{
@@ -158,6 +159,7 @@ void check_curve_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents
CHECK_EQUAL(leftovers, 0 );
}
+
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
int curve_id = geom_id_by_handle( moab, curve);
@@ -231,3 +233,113 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
}
+
+
+
+///SURFACE SENSE CHECKING
+
+void read_cube_surf_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all curve handles
+ Tag geom_tag;
+
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of curves exist
+
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ CHECK_EQUAL(6 , number_of_curves);
+
+ // Get curve handles
+ Range surfs;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, surfs );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get curve data
+ moab::GeomTopoTool gt(mb, false);
+ std::vector<EntityHandle> vols;
+ std::vector<int> senses;
+ std::vector<int> known_vol_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < surfs.size() ; i++)
+ {
+
+ vols.clear();
+ senses.clear();
+ //Curve 1
+ gt.get_senses( surfs[i], vols, senses);
+ CHECK_ERR(rval);
+
+ //Load known curve-sense data
+
+ known_vol_ids.clear();
+ known_senses.clear();
+ load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+
+ check_sense_data( mb, vols, senses, known_vol_ids, known_senses);
+ }
+
+}
+
+void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf);
+
+
+
+
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(1);
+
+ break;
+ }
+
+}
+
+
+
+
https://bitbucket.org/fathomteam/moab/commits/63ce05829f9d/
Changeset: 63ce05829f9d
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:01
Summary: Cleaned up read_cgm_basic_tests.cpp.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 64ee56b..c5e4283 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -127,11 +127,11 @@ void read_cube_surfs_test()
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
-
+
+ //Get geometry tag for pulling curve data from the mesh
Tag geom_tag;
-
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
Range curves;
@@ -140,10 +140,10 @@ void read_cube_surfs_test()
int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
- CHECK_EQUAL( 6, number_of_surfs);
+ CHECK_EQUAL( 6, number_of_surfs );
}
@@ -154,11 +154,12 @@ void read_cube_vols_test()
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
-
+
+ //Get geometry tag for pulling curve data from the mesh
Tag geom_tag;
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR(rval);
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR( rval );
Range curves;
int dim = 3;
@@ -166,10 +167,10 @@ void read_cube_vols_test()
int number_of_vols;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_vols );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
- CHECK_EQUAL( 1, number_of_vols);
+ CHECK_EQUAL( 1, number_of_vols );
}
@@ -184,64 +185,64 @@ void read_cube_vertex_pos_test()
//First check that the correct number of vertices are present
int number_of_verts;
- rval = mb->get_number_entities_by_type( 0 , MBVERTEX , number_of_verts);
- CHECK_ERR(rval);
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
+ CHECK_ERR( rval );
- CHECK_EQUAL(8, number_of_verts);
+ CHECK_EQUAL( 8, number_of_verts );
//Retrieve all vertex handles from the mesh
Range verts;
- rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
- CHECK_ERR(rval);
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR( rval );
//Get the vertex coordinates
double x[verts.size()];
double y[verts.size()];
double z[verts.size()];
- rval = mb-> get_coords( verts, &x[0], &y[0], &z[0]);
- CHECK_ERR(rval);
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
+ CHECK_ERR( rval );
//Check against known locations of the vertices
// Vertex 1
- CHECK_EQUAL( x[0], 5);
- CHECK_EQUAL( y[0], -5);
- CHECK_EQUAL( z[0], 5);
+ CHECK_EQUAL( x[0], 5 );
+ CHECK_EQUAL( y[0], -5 );
+ CHECK_EQUAL( z[0], 5 );
// Vertex 2
- CHECK_EQUAL( x[1], 5);
- CHECK_EQUAL( y[1], 5);
- CHECK_EQUAL( z[1], 5);
+ CHECK_EQUAL( x[1], 5 );
+ CHECK_EQUAL( y[1], 5 );
+ CHECK_EQUAL( z[1], 5 );
// Vertex 3
- CHECK_EQUAL( x[2], -5);
- CHECK_EQUAL( y[2], 5);
- CHECK_EQUAL( z[2], 5);
+ CHECK_EQUAL( x[2], -5 );
+ CHECK_EQUAL( y[2], 5 );
+ CHECK_EQUAL( z[2], 5 );
// Vertex 4
- CHECK_EQUAL( x[3], -5);
- CHECK_EQUAL( y[3], -5);
- CHECK_EQUAL( z[3], 5);
+ CHECK_EQUAL( x[3], -5 );
+ CHECK_EQUAL( y[3], -5 );
+ CHECK_EQUAL( z[3], 5 );
// Vertex 5
- CHECK_EQUAL( x[4], 5);
- CHECK_EQUAL( y[4], 5);
- CHECK_EQUAL( z[4], -5);
+ CHECK_EQUAL( x[4], 5 );
+ CHECK_EQUAL( y[4], 5 );
+ CHECK_EQUAL( z[4], -5 );
// Vertex 6
- CHECK_EQUAL( x[5], 5);
- CHECK_EQUAL( y[5], -5);
- CHECK_EQUAL( z[5], -5);
+ CHECK_EQUAL( x[5], 5 );
+ CHECK_EQUAL( y[5], -5 );
+ CHECK_EQUAL( z[5], -5 );
// Vertex 7
- CHECK_EQUAL( x[6], -5);
- CHECK_EQUAL( y[6], -5);
- CHECK_EQUAL( z[6], -5);
+ CHECK_EQUAL( x[6], -5 );
+ CHECK_EQUAL( y[6], -5 );
+ CHECK_EQUAL( z[6], -5 );
// Vertex 8
- CHECK_EQUAL( x[7], -5);
- CHECK_EQUAL( y[7], 5);
- CHECK_EQUAL( z[7], -5);
+ CHECK_EQUAL( x[7], -5 );
+ CHECK_EQUAL( y[7], 5 );
+ CHECK_EQUAL( z[7], -5 );
}
@@ -253,10 +254,10 @@ void delete_mesh_test()
ErrorCode rval;
+ //Get geometry tag for pulling curve data from the mesh
Tag geom_tag;
-
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
Range geom_sets[4];
@@ -266,7 +267,7 @@ void delete_mesh_test()
void *val[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, geom_sets[dim] );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
@@ -280,11 +281,11 @@ void delete_mesh_test()
void *val_after[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val_after, 1, geom_sets_after[dim] );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
}
}
https://bitbucket.org/fathomteam/moab/commits/e155ae5cdc78/
Changeset: e155ae5cdc78
Branch: None
User: pshriwise
Date: 2014-02-13 23:49:01
Summary: Clean up of read_cgm_senses_test.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index fcc2281..aa11cae 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -33,7 +33,7 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
// the model to reference information
void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
- std::vector<int> known_wrt_ids, std::vector<int> known_senses);
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses );
//Function used to get id's from entity handles
int geom_id_by_handle( Interface* moab, const EntityHandle set );
@@ -57,7 +57,7 @@ int main(int /* argc */, char** /* argv */)
void read_file( Interface* moab, const char* input_file )
{
ErrorCode rval = moab->load_file( input_file );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
}
void read_cube_curve_senses_test()
@@ -73,7 +73,7 @@ void read_cube_curve_senses_test()
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
// Check that the proper number of curves exist
@@ -82,17 +82,17 @@ void read_cube_curve_senses_test()
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR(rval);
- CHECK_EQUAL(12 , number_of_curves);
+ CHECK_ERR( rval );
+ CHECK_EQUAL( 12 , number_of_curves );
// Get curve handles
Range curves;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, curves );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
// Establish GeomTopoTool instance needed to get curve data
- moab::GeomTopoTool gt(mb, false);
+ moab::GeomTopoTool gt( mb, false );
std::vector<EntityHandle> surfs;
std::vector<int> senses;
std::vector<int> known_surf_ids;
@@ -100,17 +100,18 @@ void read_cube_curve_senses_test()
for(unsigned int i = 0; i < curves.size() ; i++)
{
-
- surfs.clear();
- senses.clear();
- //Curve 1
- gt.get_senses( curves[i], surfs, senses);
- CHECK_ERR(rval);
- //Load known curve-sense data
+ //Clean data from previous curve
+ surfs.clear();
+ senses.clear();
+ //Get sense info for the current curve
+ gt.get_senses( curves[i], surfs, senses);
+ CHECK_ERR(rval);
+ //Clear reference data from previous curve
known_surf_ids.clear();
known_senses.clear();
+ //Load known curve-sense data
load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
@@ -119,52 +120,58 @@ for(unsigned int i = 0; i < curves.size() ; i++)
}
-int geom_id_by_handle( Interface* moab, const EntityHandle set ) {
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
-ErrorCode rval;
+ ErrorCode rval;
+
Tag id_tag;
- rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE);
- assert(MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result);
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
- assert(MB_SUCCESS == result);
+ CHECK_ERR( rval );
return id;
}
void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
- std::vector<int> known_wrt_ids, std::vector<int> known_senses)
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses )
{
+ //Get ID's of the wrt entities
std::vector<int> wrt_ent_ids;
- for( unsigned int i=0 ; i<wrt_ents.size() ; i++)
+ for( unsigned int i=0 ; i<wrt_ents.size() ; i++ )
{
- wrt_ent_ids.push_back(geom_id_by_handle(moab, wrt_ents[i]));
+ wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ));
}
- for (unsigned int i=0; i< wrt_ent_ids.size() ; i++)
+ for ( unsigned int i=0; i< wrt_ent_ids.size() ; i++ )
{
- for(unsigned int j=0; j< known_wrt_ids.size(); j++)
+ for( unsigned int j=0; j< known_wrt_ids.size(); j++ )
{
- if(wrt_ent_ids[i] == known_wrt_ids [j])
+ if( wrt_ent_ids[i] == known_wrt_ids [j] )
{
- CHECK_EQUAL(senses[i],known_senses[j]);
- known_wrt_ids.erase(known_wrt_ids.begin()+j);
- known_senses.erase(known_senses.begin()+j);
+ // Make sure the senses of the matching wrt entities
+ // are correct
+ CHECK_EQUAL( senses[i],known_senses[j] );
+ //Once a wrt entity is matched with a known entity,
+ // remove it from the list
+ known_wrt_ids.erase( known_wrt_ids.begin()+j );
+ known_senses.erase( known_senses.begin()+j );
}
}
}
+ // After both loops are complete, known_wrt_ents should be empty
int leftovers = known_wrt_ids.size();
-
- CHECK_EQUAL(leftovers, 0 );
+ CHECK_EQUAL( leftovers, 0 );
}
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
- int curve_id = geom_id_by_handle( moab, curve);
-
- std::cout << curve_id << std::endl;
+ int curve_id = geom_id_by_handle( moab, curve );
switch(curve_id)
@@ -233,11 +240,7 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
}
-
-
-
///SURFACE SENSE CHECKING
-
void read_cube_surf_senses_test()
{
ErrorCode rval;
@@ -246,62 +249,59 @@ void read_cube_surf_senses_test()
Interface* mb = &moab;
read_file( mb, input_cube );
- //Get all curve handles
+ //Get geometry tag for gathering surface information from the mesh
Tag geom_tag;
-
- rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR(rval);
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR( rval );
// Check that the proper number of curves exist
-
int dim = 2;
void *val[] = {&dim};
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR(rval);
- CHECK_EQUAL(6 , number_of_curves);
+ CHECK_ERR( rval );
+ CHECK_EQUAL( 6, number_of_curves );
// Get curve handles
Range surfs;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, surfs );
- CHECK_ERR(rval);
+ CHECK_ERR( rval );
// Establish GeomTopoTool instance needed to get curve data
- moab::GeomTopoTool gt(mb, false);
+ moab::GeomTopoTool gt( mb, false );
std::vector<EntityHandle> vols;
std::vector<int> senses;
std::vector<int> known_vol_ids;
std::vector<int> known_senses;
-for(unsigned int i = 0; i < surfs.size() ; i++)
+for( unsigned int i = 0; i < surfs.size() ; i++ )
{
-
- vols.clear();
- senses.clear();
- //Curve 1
- gt.get_senses( surfs[i], vols, senses);
- CHECK_ERR(rval);
-
- //Load known curve-sense data
-
+ //Clean data from previous surface
+ vols.clear();
+ senses.clear();
+ // Get sense information for the current
+ // surface from the mesh
+ gt.get_senses( surfs[i], vols, senses);
+ CHECK_ERR(rval);
+
+ //Load known curve-sense data
known_vol_ids.clear();
known_senses.clear();
load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
-
+ // Check sense information from the loaded mesh against
+ // reference sense information
check_sense_data( mb, vols, senses, known_vol_ids, known_senses);
+
}
}
void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
- int surf_id = geom_id_by_handle( moab, surf);
-
-
-
+ int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
{
@@ -329,17 +329,12 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
case 5:
vol_ids_out.push_back(1);
senses_out.push_back(1);
-
break;
case 6:
vol_ids_out.push_back(1);
senses_out.push_back(1);
-
break;
}
}
-
-
-
https://bitbucket.org/fathomteam/moab/commits/e4dc3ac0d25c/
Changeset: e4dc3ac0d25c
Branch: None
User: pshriwise
Date: 2014-02-13 23:50:45
Summary: Added cgm flags to read_cgm_basic_test
Affected #: 2 files
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index bb9eb9a..e854a2e 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -16,7 +16,7 @@
#pragma warning(disable:4786)
#endif
-#include "cgm_version.h"
+//#include "cgm_version.h"
#include "GeometryQueryTool.hpp"
#include "ModelQueryEngine.hpp"
#include "RefEntityName.hpp"
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index c5e4283..de5d7e1 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -8,6 +8,8 @@
#include "Internals.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
using namespace moab;
@@ -56,6 +58,8 @@ int main(int /* argc */, char** /* argv */)
void read_file( Interface* moab, const char* input_file )
{
+ InitCGMA::initialize_cgma();
+
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
}
https://bitbucket.org/fathomteam/moab/commits/c4f6901e62c0/
Changeset: c4f6901e62c0
Branch: None
User: pshriwise
Date: 2014-02-13 23:50:45
Summary: Finished fix for building ReadCGM tests with linked CGM libs.
Affected #: 3 files
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 31049a1..4389075 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -73,7 +73,9 @@ ccmio_test_SOURCES = $(srcdir)/../TestUtil.hpp ccmio_test.cpp
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)
+read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cpp
+read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(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
index de5d7e1..12b4b29 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -59,6 +59,7 @@ int main(int /* argc */, char** /* argv */)
void read_file( Interface* moab, const char* input_file )
{
InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index aa11cae..9fa9cd9 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -9,6 +9,9 @@
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
#include "moab/GeomTopoTool.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
using namespace moab;
#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
@@ -49,13 +52,17 @@ int main(int /* argc */, char** /* argv */)
int result = 0;
result += RUN_TEST( read_cube_surf_senses_test );
-
+
return result;
}
void read_file( Interface* moab, const char* input_file )
{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR( rval );
}
https://bitbucket.org/fathomteam/moab/commits/2097173fbf69/
Changeset: 2097173fbf69
Branch: None
User: pshriwise
Date: 2014-02-13 23:50:45
Summary: Added all tests back into the read_cgm test files after fixing problems with the CGM instance's persistent geometry.
Affected #: 2 files
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 12b4b29..9e1854c 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -39,18 +39,24 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_verts_test();
void read_cube_curves_test();
+void read_cube_tris_test();
void read_cube_surfs_test();
void read_cube_vols_test();
-void read_cube_vertes_pos_test();
+void read_cube_vertex_pos_test();
void delete_mesh_test();
int main(int /* argc */, char** /* argv */)
{
int result = 0;
-
+
+ result += RUN_TEST( read_cube_vertex_pos_test );
result += RUN_TEST( read_cube_verts_test );
-
+ result += RUN_TEST( read_cube_curves_test );
+ result += RUN_TEST( read_cube_tris_test );
+ result += RUN_TEST( read_cube_surfs_test );
+ result += RUN_TEST( read_cube_vols_test );
+
return result;
}
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 9fa9cd9..3b0072e 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -51,6 +51,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
+ result += RUN_TEST( read_cube_curve_senses_test );
result += RUN_TEST( read_cube_surf_senses_test );
return result;
@@ -62,7 +63,6 @@ void read_file( Interface* moab, const char* input_file )
InitCGMA::initialize_cgma();
GeometryQueryTool::instance()->delete_geometry();
-
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR( rval );
}
https://bitbucket.org/fathomteam/moab/commits/1d3c8bc9e78c/
Changeset: 1d3c8bc9e78c
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:40
Summary: Updated the ReadCGM test for vertex positions so it doesn't rely on a load order.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 9e1854c..05e11f3 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -50,12 +50,12 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_vertex_pos_test );
result += RUN_TEST( read_cube_verts_test );
result += RUN_TEST( read_cube_curves_test );
result += RUN_TEST( read_cube_tris_test );
result += RUN_TEST( read_cube_surfs_test );
result += RUN_TEST( read_cube_vols_test );
+ result += RUN_TEST( read_cube_vertex_pos_test );
return result;
}
@@ -215,45 +215,71 @@ void read_cube_vertex_pos_test()
//Check against known locations of the vertices
+ std::vector<double> x_ref;
+ std::vector<double> y_ref;
+ std::vector<double> z_ref;
+
// Vertex 1
- CHECK_EQUAL( x[0], 5 );
- CHECK_EQUAL( y[0], -5 );
- CHECK_EQUAL( z[0], 5 );
+
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
// Vertex 2
- CHECK_EQUAL( x[1], 5 );
- CHECK_EQUAL( y[1], 5 );
- CHECK_EQUAL( z[1], 5 );
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
// Vertex 3
- CHECK_EQUAL( x[2], -5 );
- CHECK_EQUAL( y[2], 5 );
- CHECK_EQUAL( z[2], 5 );
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
// Vertex 4
- CHECK_EQUAL( x[3], -5 );
- CHECK_EQUAL( y[3], -5 );
- CHECK_EQUAL( z[3], 5 );
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
// Vertex 5
- CHECK_EQUAL( x[4], 5 );
- CHECK_EQUAL( y[4], 5 );
- CHECK_EQUAL( z[4], -5 );
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
// Vertex 6
- CHECK_EQUAL( x[5], 5 );
- CHECK_EQUAL( y[5], -5 );
- CHECK_EQUAL( z[5], -5 );
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
// Vertex 7
- CHECK_EQUAL( x[6], -5 );
- CHECK_EQUAL( y[6], -5 );
- CHECK_EQUAL( z[6], -5 );
-
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
// Vertex 8
- CHECK_EQUAL( x[7], -5 );
- CHECK_EQUAL( y[7], 5 );
- CHECK_EQUAL( z[7], -5 );
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+
+ std::cout << verts.size() << std::endl;
+ std::cout << x_ref.size() << std::endl;
+
+ for (unsigned int i=0; i<verts.size(); i++)
+ {
+ for (unsigned int j=0; j<x_ref.size(); j++)
+ {
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
+ {
+ x_ref.erase( x_ref.begin()+j );
+ y_ref.erase( y_ref.begin()+j );
+ z_ref.erase( z_ref.begin()+j );
+
+ }
+ }
+ }
+
+ int leftovers = x_ref.size();
+ CHECK_EQUAL(0, leftovers );
}
https://bitbucket.org/fathomteam/moab/commits/42faffb1051e/
Changeset: 42faffb1051e
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:40
Summary: Created new file for testing that ReadCGM is loading entities with the correct connectivity.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
new file mode 100644
index 0000000..cbd0849
--- /dev/null
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -0,0 +1,193 @@
+
+#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"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.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
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#else
+static const char input_cube[] = "/io/cube.sat";
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void read_cube_tris_test();
+
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST( read_cube_verts_test );
+ result += RUN_TEST( read_cube_curves_test );
+ result += RUN_TEST( read_cube_tris_test );
+ result += RUN_TEST( read_cube_surfs_test );
+ result += RUN_TEST( read_cube_vols_test );
+ result += RUN_TEST( read_cube_vertex_pos_test );
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+void read_cube_tris_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ 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);
+
+ CHECK_EQUAL( 12, number_of_tris);
+
+}
+
+
+void read_cube_vertex_pos_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //First check that the correct number of vertices are present
+ int number_of_verts;
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
+ CHECK_ERR( rval );
+
+ CHECK_EQUAL( 8, number_of_verts );
+
+ //Retrieve all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR( rval );
+
+ //Get the vertex coordinates
+ double x[verts.size()];
+ double y[verts.size()];
+ double z[verts.size()];
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
+ CHECK_ERR( rval );
+
+ //Check against known locations of the vertices
+
+ std::vector<double> x_ref;
+ std::vector<double> y_ref;
+ std::vector<double> z_ref;
+
+ // Vertex 1
+
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 2
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 3
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 4
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 5
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 6
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 7
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 8
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+
+ std::cout << verts.size() << std::endl;
+ std::cout << x_ref.size() << std::endl;
+
+ for (unsigned int i=0; i<verts.size(); i++)
+ {
+ for (unsigned int j=0; j<x_ref.size(); j++)
+ {
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
+ {
+ x_ref.erase( x_ref.begin()+j );
+ y_ref.erase( y_ref.begin()+j );
+ z_ref.erase( z_ref.begin()+j );
+
+ }
+ }
+ }
+
+ int leftovers = x_ref.size();
+ CHECK_EQUAL(0, leftovers );
+
+}
+
+
+void read_cube_connectivity_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all triangles from the mesh
+ std::vector<EntityHandle> tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+}
https://bitbucket.org/fathomteam/moab/commits/22efd87de07f/
Changeset: 22efd87de07f
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:40
Summary: Removed non-existant test calls from read_cgm_connectivity_test.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index cbd0849..e297bfa 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -37,12 +37,7 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_verts_test );
- result += RUN_TEST( read_cube_curves_test );
- result += RUN_TEST( read_cube_tris_test );
- result += RUN_TEST( read_cube_surfs_test );
- result += RUN_TEST( read_cube_vols_test );
- result += RUN_TEST( read_cube_vertex_pos_test );
+
return result;
}
https://bitbucket.org/fathomteam/moab/commits/133937ca1463/
Changeset: 133937ca1463
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:40
Summary: Added read_cgm_connectivity_test to the MOAB make check system.
Affected #: 1 file
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 4389075..e9a73b3 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -25,7 +25,7 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test
else
CGM_TEST =
endif
@@ -76,6 +76,8 @@ read_cgm_basic_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_basic_test.cpp
read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cpp
read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_connectivity_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_connectivity_test.cpp
+read_cgm_connectivity_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
readutil_test_SOURCES = $(srcdir)/../TestUtil.hpp readutil_test.cpp
cgns_test_SOURCES=$(srcdir)/../TestUtil.hpp cgns_test.cpp
https://bitbucket.org/fathomteam/moab/commits/1ed5d04bdc3a/
Changeset: 1ed5d04bdc3a
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:40
Summary: Updates to read_cgm_connectivity_test
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index e297bfa..843f2db 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -30,14 +30,18 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_tris_test();
+void read_cube_connectivity_test();
+//Function used to match triangle connectivity and verts
+void match_tri_connectivity( Range connectivity,
+ std::vector<EntityHandle> &reference_verts);
int main(int /* argc */, char** /* argv */)
{
int result = 0;
-
+ RUN_TEST(read_cube_connectivity_test);
return result;
}
@@ -180,9 +184,57 @@ void read_cube_connectivity_test()
Interface* mb = &moab;
read_file( mb, input_cube );
+ //Get all vertex handles from the mesh
+ std::vector<EntityHandle> verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
+ CHECK_ERR(rval);
+
+ //Duplicate the vertex handles to match the number of tris
+ //they should be connected to upon a correct load
+ std::vector<EntityHandle> ref_verts=verts;
+ int copy_count = 0;
+ while (copy_count<4)
+ {
+ copy(verts.begin(),verts.end(),back_inserter(ref_verts));
+ copy_count++;
+ }
+
+ //Make sure everything duplicated without a problem
+ if( ref_verts.size()!=40 ) CHECK_ERR(MB_FAILURE);
+
//Get all triangles from the mesh
- std::vector<EntityHandle> tris;
+ Range tris;
rval = mb->get_entities_by_type( 0, MBTRI, tris);
CHECK_ERR(rval);
+
+ //Test connectivity
+ for (Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get the connectivity of a triangle
+ Range connect;
+ rval = mb->get_connectivity( &(*i), 1, connect);
+ CHECK_ERR(rval);
+
+ match_tri_connectivity( connect, ref_verts);
+ std::cout << "ref_verts size = " << ref_verts.size() << std::endl;
+ }
+
+
+}
+
+void match_tri_connectivity( Range connectivity, std::vector<EntityHandle> &reference_verts)
+{
+
+ for(Range::const_iterator i=connectivity.begin(); i!=connectivity.end(); i++)
+ {
+
+ for(unsigned int j=0; j<reference_verts.size(); j++)
+ {
+
+ std::cout << "Triangle Vert Handle = " << *i << std::endl;
+ if( *i == reference_verts[j]) reference_verts.erase(reference_verts.begin()+j);
+
+ }
+ }
}
https://bitbucket.org/fathomteam/moab/commits/77669a61d166/
Changeset: 77669a61d166
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:40
Summary: Added a new test to check that the cube vertices are connected reasonable numbers of triangles.
Updated int main so that it is properly connected to the testing framework.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 843f2db..8d5f103 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -30,18 +30,19 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_tris_test();
-void read_cube_connectivity_test();
+void cube_verts_connectivity_test();
//Function used to match triangle connectivity and verts
-void match_tri_connectivity( Range connectivity,
- std::vector<EntityHandle> &reference_verts);
+//void match_tri_connectivity( Range connectivity,
+// std::vector<EntityHandle> &reference_verts);
int main(int /* argc */, char** /* argv */)
{
int result = 0;
- RUN_TEST(read_cube_connectivity_test);
+ result += RUN_TEST(cube_verts_connectivity_test);
+ result += RUN_TEST(read_cube_tris_test);
return result;
}
@@ -76,165 +77,34 @@ void read_cube_tris_test()
}
-void read_cube_vertex_pos_test()
+void cube_verts_connectivity_test()
{
-
- ErrorCode rval;
- //Open the test file
- Core moab;
- Interface* mb = &moab;
- read_file( mb, input_cube );
-
- //First check that the correct number of vertices are present
- int number_of_verts;
- rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
- CHECK_ERR( rval );
-
- CHECK_EQUAL( 8, number_of_verts );
-
- //Retrieve all vertex handles from the mesh
- Range verts;
- rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
- CHECK_ERR( rval );
-
- //Get the vertex coordinates
- double x[verts.size()];
- double y[verts.size()];
- double z[verts.size()];
- rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
- CHECK_ERR( rval );
-
- //Check against known locations of the vertices
-
- std::vector<double> x_ref;
- std::vector<double> y_ref;
- std::vector<double> z_ref;
-
- // Vertex 1
-
- x_ref.push_back( 5 );
- y_ref.push_back( -5 );
- z_ref.push_back( 5 );
-
- // Vertex 2
- x_ref.push_back( 5 );
- y_ref.push_back( 5 );
- z_ref.push_back( 5 );
-
- // Vertex 3
- x_ref.push_back( -5 );
- y_ref.push_back( 5 );
- z_ref.push_back( 5 );
-
- // Vertex 4
- x_ref.push_back( -5 );
- y_ref.push_back( -5 );
- z_ref.push_back( 5 );
-
- // Vertex 5
- x_ref.push_back( 5 );
- y_ref.push_back( 5 );
- z_ref.push_back( -5 );
-
- // Vertex 6
- x_ref.push_back( 5 );
- y_ref.push_back( -5 );
- z_ref.push_back( -5 );
-
- // Vertex 7
- x_ref.push_back( -5 );
- y_ref.push_back( -5 );
- z_ref.push_back( -5 );
-
- // Vertex 8
- x_ref.push_back( -5 );
- y_ref.push_back( 5 );
- z_ref.push_back( -5 );
-
-
- std::cout << verts.size() << std::endl;
- std::cout << x_ref.size() << std::endl;
-
- for (unsigned int i=0; i<verts.size(); i++)
- {
- for (unsigned int j=0; j<x_ref.size(); j++)
- {
- if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
- {
- x_ref.erase( x_ref.begin()+j );
- y_ref.erase( y_ref.begin()+j );
- z_ref.erase( z_ref.begin()+j );
-
- }
- }
- }
-
- int leftovers = x_ref.size();
- CHECK_EQUAL(0, leftovers );
-}
-
-
-void read_cube_connectivity_test()
-{
-
- ErrorCode rval;
+ ErrorCode rval;
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cube);
//Get all vertex handles from the mesh
- std::vector<EntityHandle> verts;
+ Range verts;
rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
CHECK_ERR(rval);
-
- //Duplicate the vertex handles to match the number of tris
- //they should be connected to upon a correct load
- std::vector<EntityHandle> ref_verts=verts;
- int copy_count = 0;
- while (copy_count<4)
- {
- copy(verts.begin(),verts.end(),back_inserter(ref_verts));
- copy_count++;
- }
-
- //Make sure everything duplicated without a problem
- if( ref_verts.size()!=40 ) CHECK_ERR(MB_FAILURE);
- //Get all triangles from the mesh
- Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
- CHECK_ERR(rval);
+ //Check that each vertex connects to less than 4 triangles and no more than 6
-
- //Test connectivity
- for (Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ for(Range::const_iterator i = verts.begin(); i!=verts.end(); i++)
{
- //Get the connectivity of a triangle
- Range connect;
- rval = mb->get_connectivity( &(*i), 1, connect);
+ std::vector<EntityHandle> adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
CHECK_ERR(rval);
-
- match_tri_connectivity( connect, ref_verts);
- std::cout << "ref_verts size = " << ref_verts.size() << std::endl;
- }
-
-
-}
-
-void match_tri_connectivity( Range connectivity, std::vector<EntityHandle> &reference_verts)
-{
- for(Range::const_iterator i=connectivity.begin(); i!=connectivity.end(); i++)
- {
+ int adj_size = adj_tris.size();
- for(unsigned int j=0; j<reference_verts.size(); j++)
- {
+ CHECK( adj_size >= 4 && adj_size <= 6);
- std::cout << "Triangle Vert Handle = " << *i << std::endl;
- if( *i == reference_verts[j]) reference_verts.erase(reference_verts.begin()+j);
-
- }
}
+
+
}
+
https://bitbucket.org/fathomteam/moab/commits/747b1a402153/
Changeset: 747b1a402153
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Corrected formatting in read_cgm_senses_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 3b0072e..9b3f038 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -32,9 +32,9 @@ void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+
// Functions used to compare sense information found in
// the model to reference information
-
void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
std::vector<int> known_wrt_ids, std::vector<int> known_senses );
https://bitbucket.org/fathomteam/moab/commits/3af7974bc063/
Changeset: 3af7974bc063
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added a test to ensure that each triangle in the loaded file is adjacent to 3 other triangles.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 8d5f103..686ebaa 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -10,7 +10,7 @@
#include "MBTagConventions.hpp"
#include "InitCGMA.hpp"
#include "GeometryQueryTool.hpp"
-
+#include "moab/MeshTopoUtil.hpp"
using namespace moab;
#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
@@ -31,6 +31,7 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void read_cube_tris_test();
void cube_verts_connectivity_test();
+void cube_tris_connectivity_test();
//Function used to match triangle connectivity and verts
//void match_tri_connectivity( Range connectivity,
@@ -43,6 +44,7 @@ int main(int /* argc */, char** /* argv */)
result += RUN_TEST(cube_verts_connectivity_test);
result += RUN_TEST(read_cube_tris_test);
+ result += RUN_TEST(cube_tris_connectivity_test);
return result;
}
@@ -100,11 +102,34 @@ void cube_verts_connectivity_test()
CHECK_ERR(rval);
int adj_size = adj_tris.size();
-
CHECK( adj_size >= 4 && adj_size <= 6);
-
}
+}
+
+void cube_tris_connectivity_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+
+ for(Range::const_iterator i = tris.begin()+1; i!=tris.end(); i++)
+ {
+ Range adj_tris;
+ moab::MeshTopoUtil mu(mb);
+ rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris);
+ CHECK_ERR(rval);
+ int number_of_adj_tris=adj_tris.size();
+ CHECK_EQUAL( 3, number_of_adj_tris);
+ }
}
https://bitbucket.org/fathomteam/moab/commits/cadd7b20c48a/
Changeset: cadd7b20c48a
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Removed read_cube_tris_test from the connectivity test file.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 686ebaa..651f635 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -29,7 +29,6 @@ static const char input_cube[] = "/io/cube.sat";
void read_file( Interface* moab, const char* input_file );
// List of tests in this file
-void read_cube_tris_test();
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
@@ -43,7 +42,6 @@ int main(int /* argc */, char** /* argv */)
int result = 0;
result += RUN_TEST(cube_verts_connectivity_test);
- result += RUN_TEST(read_cube_tris_test);
result += RUN_TEST(cube_tris_connectivity_test);
return result;
@@ -60,25 +58,6 @@ void read_file( Interface* moab, const char* input_file )
CHECK_ERR(rval);
}
-void read_cube_tris_test()
-{
- ErrorCode rval;
- //Open the test file
- Core moab;
- Interface* mb = &moab;
- read_file( mb, input_cube );
-
- 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);
-
- CHECK_EQUAL( 12, number_of_tris);
-
-}
-
-
void cube_verts_connectivity_test()
{
https://bitbucket.org/fathomteam/moab/commits/ac2418c1f79e/
Changeset: ac2418c1f79e
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Removed deprecated and commented test prototype.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 651f635..f82d8cd 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -32,10 +32,6 @@ void read_file( Interface* moab, const char* input_file );
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
-//Function used to match triangle connectivity and verts
-//void match_tri_connectivity( Range connectivity,
-// std::vector<EntityHandle> &reference_verts);
-
int main(int /* argc */, char** /* argv */)
{
https://bitbucket.org/fathomteam/moab/commits/c5a98372252c/
Changeset: c5a98372252c
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added a test for triangle-edge coincidence in the case of a cube read by ReadCGM
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index f82d8cd..903dfcb 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -31,7 +31,10 @@ void read_file( Interface* moab, const char* input_file );
// List of tests in this file
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
+void cube_tri_curve_coincidence_test();
+//Other functions
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves);
int main(int /* argc */, char** /* argv */)
{
@@ -39,6 +42,7 @@ int main(int /* argc */, char** /* argv */)
result += RUN_TEST(cube_verts_connectivity_test);
result += RUN_TEST(cube_tris_connectivity_test);
+ result += RUN_TEST(cube_tri_curve_coincidence_test);
return result;
}
@@ -84,7 +88,7 @@ void cube_verts_connectivity_test()
void cube_tris_connectivity_test()
{
- ErrorCode rval;
+ ErrorCode rval;
//Open the test file
Core moab;
Interface* mb = &moab;
@@ -108,3 +112,58 @@ void cube_tris_connectivity_test()
}
+void cube_tri_curve_coincidence_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get curves from the mesh
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves);
+ CHECK_ERR(rval);
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get the any curve edges that are a part of the triangle
+ Range tri_edges;
+ rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges);
+ CHECK_ERR(rval);
+
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL(2, num_of_tri_edges);
+ rval = match_tri_edges_w_curve( mb, tri_edges, curves);
+ CHECK_ERR(rval);
+
+ }
+
+}
+
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves)
+{
+
+ ErrorCode rval;
+ int match_counter;
+ std::cout << "Size of curves = " << curves.size() << std::endl;
+ for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
+ {
+ for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
+ {
+ std::cout << "Tri edge ID = " << *i << std::endl;
+ std::cout << "Curve edge ID = " << *j << std::endl;
+ if( *i == *j ) match_counter++;
+ }
+ }
+
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL( num_of_tri_edges, match_counter );
+ return MB_SUCCESS;
+}
https://bitbucket.org/fathomteam/moab/commits/3e9891fb06b8/
Changeset: 3e9891fb06b8
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added a test to read_cgm_connectivity_test to ensure that each triangle has three different vertices.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 903dfcb..4d4bebf 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -32,6 +32,8 @@ void read_file( Interface* moab, const char* input_file );
void cube_verts_connectivity_test();
void cube_tris_connectivity_test();
void cube_tri_curve_coincidence_test();
+void cube_edge_adjacencies_test();
+void cube_tri_vertex_test();
//Other functions
ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves);
@@ -43,6 +45,8 @@ int main(int /* argc */, char** /* argv */)
result += RUN_TEST(cube_verts_connectivity_test);
result += RUN_TEST(cube_tris_connectivity_test);
result += RUN_TEST(cube_tri_curve_coincidence_test);
+ result += RUN_TEST(cube_tri_curve_coincidence_test);
+ result += RUN_TEST(cube_tri_vertex_test);
return result;
}
@@ -167,3 +171,59 @@ ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curve
CHECK_EQUAL( num_of_tri_edges, match_counter );
return MB_SUCCESS;
}
+
+void cube_edge_adjacencies_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get the curves
+ Range curves;
+ rval = mb->get_entities_by_type(0, MBEDGE, curves);
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=curves.begin(); i!=curves.end(); i++)
+ {
+ //Get triangle adjacent to each edge
+ Range adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris);
+ CHECK_ERR(rval);
+
+ int num_adj_tris = adj_tris.size();
+ //Ensure that an edge isn't adjacent to more than two triangles
+ CHECK( num_adj_tris <= 2);
+ }
+
+}
+
+void cube_tri_vertex_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube);
+
+ //Get all triangles
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get all triangle vertices
+ Range verts;
+ rval = mb->get_connectivity( &(*i), 1, verts);
+ CHECK_ERR(rval);
+
+ int number_of_verts = verts.size();
+ CHECK( 3 == number_of_verts);
+ CHECK(verts[0]!=verts[1]);
+ CHECK(verts[1]!=verts[2]);
+ CHECK(verts[2]!=verts[0]);
+ }
+
+}
https://bitbucket.org/fathomteam/moab/commits/8ba58c12e905/
Changeset: 8ba58c12e905
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added a check that all entities in cube_tris_connectivity_test are triangles and removed deprecated print outs.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 4d4bebf..65e8237 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -108,10 +108,18 @@ void cube_tris_connectivity_test()
{
Range adj_tris;
moab::MeshTopoUtil mu(mb);
+ //Use Triangle edges to get all adjacent triangles
rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris);
CHECK_ERR(rval);
int number_of_adj_tris=adj_tris.size();
CHECK_EQUAL( 3, number_of_adj_tris);
+
+ //Check that the entities we found from bridge_adjacencies
+ //are triangles
+ Range adj_tri_test = adj_tris.subset_by_type(MBTRI);
+ int number_tris_in_adj_tris = adj_tri_test.size();
+ CHECK_EQUAL( number_of_adj_tris, number_tris_in_adj_tris);
+
}
}
@@ -155,14 +163,11 @@ ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curve
{
ErrorCode rval;
- int match_counter;
- std::cout << "Size of curves = " << curves.size() << std::endl;
+ int match_counter=0;
for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
{
for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
{
- std::cout << "Tri edge ID = " << *i << std::endl;
- std::cout << "Curve edge ID = " << *j << std::endl;
if( *i == *j ) match_counter++;
}
}
https://bitbucket.org/fathomteam/moab/commits/21be0f515a7e/
Changeset: 21be0f515a7e
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Formatting corrections for read_cgm_connectivity_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 65e8237..7137666 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -36,7 +36,7 @@ void cube_edge_adjacencies_test();
void cube_tri_vertex_test();
//Other functions
-ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves);
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves );
int main(int /* argc */, char** /* argv */)
{
@@ -69,11 +69,11 @@ void cube_verts_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get all vertex handles from the mesh
Range verts;
- rval = mb->get_entities_by_type( 0, MBVERTEX, verts);
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
CHECK_ERR(rval);
//Check that each vertex connects to less than 4 triangles and no more than 6
@@ -85,7 +85,7 @@ void cube_verts_connectivity_test()
CHECK_ERR(rval);
int adj_size = adj_tris.size();
- CHECK( adj_size >= 4 && adj_size <= 6);
+ CHECK( adj_size >= 4 && adj_size <= 6 );
}
}
@@ -96,11 +96,11 @@ void cube_tris_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get triangles from the mesh
Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
CHECK_ERR(rval);
@@ -109,16 +109,16 @@ void cube_tris_connectivity_test()
Range adj_tris;
moab::MeshTopoUtil mu(mb);
//Use Triangle edges to get all adjacent triangles
- rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris);
+ rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris );
CHECK_ERR(rval);
int number_of_adj_tris=adj_tris.size();
- CHECK_EQUAL( 3, number_of_adj_tris);
+ CHECK_EQUAL( 3, number_of_adj_tris );
//Check that the entities we found from bridge_adjacencies
//are triangles
- Range adj_tri_test = adj_tris.subset_by_type(MBTRI);
+ Range adj_tri_test = adj_tris.subset_by_type( MBTRI );
int number_tris_in_adj_tris = adj_tri_test.size();
- CHECK_EQUAL( number_of_adj_tris, number_tris_in_adj_tris);
+ CHECK_EQUAL( number_of_adj_tris, number_tris_in_adj_tris );
}
@@ -131,35 +131,35 @@ void cube_tri_curve_coincidence_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get curves from the mesh
Range curves;
- rval = mb->get_entities_by_type( 0, MBEDGE, curves);
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
CHECK_ERR(rval);
//Get triangles from the mesh
Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
CHECK_ERR(rval);
for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
{
//Get the any curve edges that are a part of the triangle
Range tri_edges;
- rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges);
+ rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges );
CHECK_ERR(rval);
int num_of_tri_edges = tri_edges.size();
- CHECK_EQUAL(2, num_of_tri_edges);
- rval = match_tri_edges_w_curve( mb, tri_edges, curves);
+ CHECK_EQUAL( 2, num_of_tri_edges );
+ rval = match_tri_edges_w_curve( mb, tri_edges, curves );
CHECK_ERR(rval);
}
}
-ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves)
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
{
ErrorCode rval;
@@ -183,23 +183,23 @@ void cube_edge_adjacencies_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get the curves
Range curves;
- rval = mb->get_entities_by_type(0, MBEDGE, curves);
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
CHECK_ERR(rval);
for(Range::const_iterator i=curves.begin(); i!=curves.end(); i++)
{
//Get triangle adjacent to each edge
Range adj_tris;
- rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris);
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
CHECK_ERR(rval);
int num_adj_tris = adj_tris.size();
//Ensure that an edge isn't adjacent to more than two triangles
- CHECK( num_adj_tris <= 2);
+ CHECK( num_adj_tris <= 2 );
}
}
@@ -210,25 +210,25 @@ void cube_tri_vertex_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube);
+ read_file( mb, input_cube );
//Get all triangles
Range tris;
- rval = mb->get_entities_by_type( 0, MBTRI, tris);
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
CHECK_ERR(rval);
for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
{
//Get all triangle vertices
Range verts;
- rval = mb->get_connectivity( &(*i), 1, verts);
+ rval = mb->get_connectivity( &(*i), 1, verts );
CHECK_ERR(rval);
int number_of_verts = verts.size();
- CHECK( 3 == number_of_verts);
- CHECK(verts[0]!=verts[1]);
- CHECK(verts[1]!=verts[2]);
- CHECK(verts[2]!=verts[0]);
+ CHECK( 3 == number_of_verts );
+ CHECK( verts[0]!=verts[1] );
+ CHECK( verts[1]!=verts[2] );
+ CHECK( verts[2]!=verts[0] );
}
}
https://bitbucket.org/fathomteam/moab/commits/abee5754a035/
Changeset: abee5754a035
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Formatting corrections for read_cgm_load_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
index 9704ee7..6791f50 100644
--- a/test/io/read_cgm_load_test.cpp
+++ b/test/io/read_cgm_load_test.cpp
@@ -33,10 +33,10 @@ void read_multiple_test()
{
Core mb;
- ErrorCode rval = mb.load_file(input_file);
+ ErrorCode rval = mb.load_file( input_file );
CHECK_ERR(rval);
// second load
- rval = mb.load_file(input_file);
+ rval = mb.load_file( input_file );
CHECK_ERR(rval);
}
@@ -44,7 +44,7 @@ void read_multiple_test()
int main(int /* argc */, char** /* argv */)
{
- int result = RUN_TEST( read_multiple_test ) ;
+ int result = RUN_TEST( read_multiple_test );
return result;
}
https://bitbucket.org/fathomteam/moab/commits/288dfea854df/
Changeset: 288dfea854df
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Formatting corrections to read_cgm_basic_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 05e11f3..aca6c7a 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -50,12 +50,12 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_verts_test );
- result += RUN_TEST( read_cube_curves_test );
- result += RUN_TEST( read_cube_tris_test );
- result += RUN_TEST( read_cube_surfs_test );
- result += RUN_TEST( read_cube_vols_test );
- result += RUN_TEST( read_cube_vertex_pos_test );
+ result += RUN_TEST(read_cube_verts_test);
+ result += RUN_TEST(read_cube_curves_test);
+ result += RUN_TEST(read_cube_tris_test);
+ result += RUN_TEST(read_cube_surfs_test);
+ result += RUN_TEST(read_cube_vols_test);
+ result += RUN_TEST(read_cube_vertex_pos_test);
return result;
}
@@ -80,10 +80,10 @@ void read_cube_verts_test()
read_file( mb, input_cube );
int number_of_vertices;
- rval = mb->get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_vertices );
CHECK_ERR(rval);
- CHECK_EQUAL( 8, number_of_vertices);
+ CHECK_EQUAL( 8, number_of_vertices );
}
@@ -97,11 +97,11 @@ void read_cube_tris_test()
int number_of_tris;
- rval = mb->get_number_entities_by_type(0, MBTRI , 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);
- CHECK_EQUAL( 12, number_of_tris);
+ CHECK_EQUAL( 12, number_of_tris );
}
@@ -127,7 +127,7 @@ void read_cube_curves_test()
val, 1, number_of_curves );
CHECK_ERR(rval);
- CHECK_EQUAL( 12, number_of_curves);
+ CHECK_EQUAL( 12, number_of_curves );
}
@@ -151,7 +151,7 @@ void read_cube_surfs_test()
int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 6, number_of_surfs );
@@ -170,7 +170,7 @@ void read_cube_vols_test()
Tag geom_tag;
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
Range curves;
int dim = 3;
@@ -178,7 +178,7 @@ void read_cube_vols_test()
int number_of_vols;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_vols );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 1, number_of_vols );
@@ -197,7 +197,7 @@ void read_cube_vertex_pos_test()
//First check that the correct number of vertices are present
int number_of_verts;
rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 8, number_of_verts );
@@ -211,7 +211,7 @@ void read_cube_vertex_pos_test()
double y[verts.size()];
double z[verts.size()];
rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
//Check against known locations of the vertices
@@ -268,7 +268,7 @@ void read_cube_vertex_pos_test()
{
for (unsigned int j=0; j<x_ref.size(); j++)
{
- if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j])
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j] )
{
x_ref.erase( x_ref.begin()+j );
y_ref.erase( y_ref.begin()+j );
@@ -279,7 +279,7 @@ void read_cube_vertex_pos_test()
}
int leftovers = x_ref.size();
- CHECK_EQUAL(0, leftovers );
+ CHECK_EQUAL( 0, leftovers );
}
@@ -304,7 +304,7 @@ void delete_mesh_test()
void *val[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, geom_sets[dim] );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
@@ -318,11 +318,11 @@ void delete_mesh_test()
void *val_after[] = {&dim};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val_after, 1, geom_sets_after[dim] );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
}
}
https://bitbucket.org/fathomteam/moab/commits/e03e08667d1f/
Changeset: e03e08667d1f
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Formatting corrections to read_cgm_senses_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 9b3f038..904477a 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -51,8 +51,8 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST( read_cube_curve_senses_test );
- result += RUN_TEST( read_cube_surf_senses_test );
+ result += RUN_TEST(read_cube_curve_senses_test);
+ result += RUN_TEST(read_cube_surf_senses_test);
return result;
}
@@ -64,7 +64,7 @@ void read_file( Interface* moab, const char* input_file )
GeometryQueryTool::instance()->delete_geometry();
ErrorCode rval = moab->load_file( input_file );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
}
void read_cube_curve_senses_test()
@@ -80,7 +80,7 @@ void read_cube_curve_senses_test()
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Check that the proper number of curves exist
@@ -89,14 +89,14 @@ void read_cube_curve_senses_test()
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 12 , number_of_curves );
// Get curve handles
Range curves;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, curves );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Establish GeomTopoTool instance needed to get curve data
moab::GeomTopoTool gt( mb, false );
@@ -112,7 +112,7 @@ for(unsigned int i = 0; i < curves.size() ; i++)
surfs.clear();
senses.clear();
//Get sense info for the current curve
- gt.get_senses( curves[i], surfs, senses);
+ gt.get_senses( curves[i], surfs, senses );
CHECK_ERR(rval);
//Clear reference data from previous curve
@@ -138,7 +138,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
return id;
}
@@ -148,20 +148,20 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
//Get ID's of the wrt entities
std::vector<int> wrt_ent_ids;
- for( unsigned int i=0 ; i<wrt_ents.size() ; i++ )
+ for(unsigned int i=0 ; i<wrt_ents.size() ; i++)
{
- wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ));
+ wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ) );
}
- for ( unsigned int i=0; i< wrt_ent_ids.size() ; i++ )
+ for(unsigned int i=0; i< wrt_ent_ids.size() ; i++)
{
- for( unsigned int j=0; j< known_wrt_ids.size(); j++ )
+ for(unsigned int j=0; j< known_wrt_ids.size(); j++)
{
if( wrt_ent_ids[i] == known_wrt_ids [j] )
{
// Make sure the senses of the matching wrt entities
// are correct
- CHECK_EQUAL( senses[i],known_senses[j] );
+ CHECK_EQUAL( senses[i], known_senses[j] );
//Once a wrt entity is matched with a known entity,
// remove it from the list
known_wrt_ids.erase( known_wrt_ids.begin()+j );
@@ -176,7 +176,8 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
}
-void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out ){
+void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
int curve_id = geom_id_by_handle( moab, curve );
@@ -260,7 +261,7 @@ void read_cube_surf_senses_test()
Tag geom_tag;
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Check that the proper number of curves exist
int dim = 2;
@@ -268,14 +269,14 @@ void read_cube_surf_senses_test()
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
CHECK_EQUAL( 6, number_of_curves );
// Get curve handles
Range surfs;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, surfs );
- CHECK_ERR( rval );
+ CHECK_ERR(rval);
// Establish GeomTopoTool instance needed to get curve data
moab::GeomTopoTool gt( mb, false );
@@ -284,14 +285,14 @@ void read_cube_surf_senses_test()
std::vector<int> known_vol_ids;
std::vector<int> known_senses;
-for( unsigned int i = 0; i < surfs.size() ; i++ )
+for(unsigned int i = 0; i < surfs.size(); i++)
{
//Clean data from previous surface
vols.clear();
senses.clear();
// Get sense information for the current
// surface from the mesh
- gt.get_senses( surfs[i], vols, senses);
+ gt.get_senses( surfs[i], vols, senses );
CHECK_ERR(rval);
//Load known curve-sense data
@@ -300,7 +301,7 @@ for( unsigned int i = 0; i < surfs.size() ; i++ )
load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
// Check sense information from the loaded mesh against
// reference sense information
- check_sense_data( mb, vols, senses, known_vol_ids, known_senses);
+ check_sense_data( mb, vols, senses, known_vol_ids, known_senses );
}
https://bitbucket.org/fathomteam/moab/commits/5d58573ff3be/
Changeset: 5d58573ff3be
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added comments to read_cgm_connectivity_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 7137666..afffbe7 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -77,7 +77,6 @@ void cube_verts_connectivity_test()
CHECK_ERR(rval);
//Check that each vertex connects to less than 4 triangles and no more than 6
-
for(Range::const_iterator i = verts.begin(); i!=verts.end(); i++)
{
std::vector<EntityHandle> adj_tris;
@@ -149,29 +148,31 @@ void cube_tri_curve_coincidence_test()
Range tri_edges;
rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges );
CHECK_ERR(rval);
-
+ //Check that we've retrieved two edges from get_adjacencies
+ //For a this file (cube), each triangle should have two curve
+ //edges
int num_of_tri_edges = tri_edges.size();
CHECK_EQUAL( 2, num_of_tri_edges );
rval = match_tri_edges_w_curve( mb, tri_edges, curves );
CHECK_ERR(rval);
-
- }
-
+ }
}
ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
{
-
ErrorCode rval;
int match_counter=0;
for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
{
for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
{
+ // If the edge handle matches a curve handle, increment the number
+ // matches
if( *i == *j ) match_counter++;
}
}
-
+ //Make sure that each edge returned from triangle edges
+ //has been matched to a curve
int num_of_tri_edges = tri_edges.size();
CHECK_EQUAL( num_of_tri_edges, match_counter );
return MB_SUCCESS;
@@ -198,7 +199,7 @@ void cube_edge_adjacencies_test()
CHECK_ERR(rval);
int num_adj_tris = adj_tris.size();
- //Ensure that an edge isn't adjacent to more than two triangles
+ //Ensure that no edge is adjacent to more than two triangles
CHECK( num_adj_tris <= 2 );
}
@@ -223,7 +224,8 @@ void cube_tri_vertex_test()
Range verts;
rval = mb->get_connectivity( &(*i), 1, verts );
CHECK_ERR(rval);
-
+ //Make sure that each vertex making up
+ //the triangle is different
int number_of_verts = verts.size();
CHECK( 3 == number_of_verts );
CHECK( verts[0]!=verts[1] );
https://bitbucket.org/fathomteam/moab/commits/7401d90b969c/
Changeset: 7401d90b969c
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Removed white space in read_cgm_connectivity_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index afffbe7..f0e67c24 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -232,5 +232,4 @@ void cube_tri_vertex_test()
CHECK( verts[1]!=verts[2] );
CHECK( verts[2]!=verts[0] );
}
-
}
https://bitbucket.org/fathomteam/moab/commits/6384fd372afe/
Changeset: 6384fd372afe
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Cleanup of read_cgm_basic_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index aca6c7a..3a68d04 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -43,7 +43,7 @@ void read_cube_tris_test();
void read_cube_surfs_test();
void read_cube_vols_test();
void read_cube_vertex_pos_test();
-void delete_mesh_test();
+//void delete_mesh_test();
int main(int /* argc */, char** /* argv */)
@@ -82,7 +82,7 @@ void read_cube_verts_test()
int number_of_vertices;
rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_vertices );
CHECK_ERR(rval);
-
+ //For a cube there should be exactly 8 vertices
CHECK_EQUAL( 8, number_of_vertices );
}
@@ -100,9 +100,8 @@ void read_cube_tris_test()
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);
-
+ //For a cube, there should be exactly 2 triangles per face
CHECK_EQUAL( 12, number_of_tris );
-
}
void read_cube_curves_test()
@@ -112,21 +111,19 @@ void read_cube_curves_test()
Core moab;
Interface* mb = &moab;
read_file( mb, input_cube );
-
+ //Get the geometry tag handle from the mesh
Tag geom_tag;
-
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
-
- Range curves;
+ //Get the curves from the mesh
int dim = 1;
void *val[] = {&dim};
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
CHECK_ERR(rval);
-
+ //For a cube, there should be exactly 12 curves loaded from the file
CHECK_EQUAL( 12, number_of_curves );
}
@@ -145,15 +142,14 @@ void read_cube_surfs_test()
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
- Range curves;
+ //Get the number of surface from the mesh geometry data
int dim = 2;
void *val[] = {&dim};
int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
CHECK_ERR(rval);
-
-
+ //For a cube, there should be exactly 6 surfaces
CHECK_EQUAL( 6, number_of_surfs );
}
@@ -172,17 +168,14 @@ void read_cube_vols_test()
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
- Range curves;
+ //Get the number of volumes from the mesh geometry data
int dim = 3;
void *val[] = {&dim};
int number_of_vols;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_vols );
CHECK_ERR(rval);
-
-
CHECK_EQUAL( 1, number_of_vols );
-
}
void read_cube_vertex_pos_test()
@@ -220,7 +213,6 @@ void read_cube_vertex_pos_test()
std::vector<double> z_ref;
// Vertex 1
-
x_ref.push_back( 5 );
y_ref.push_back( -5 );
z_ref.push_back( 5 );
@@ -260,29 +252,34 @@ void read_cube_vertex_pos_test()
y_ref.push_back( 5 );
z_ref.push_back( -5 );
-
std::cout << verts.size() << std::endl;
std::cout << x_ref.size() << std::endl;
- for (unsigned int i=0; i<verts.size(); i++)
+ for(unsigned int i=0; i<verts.size(); i++)
{
- for (unsigned int j=0; j<x_ref.size(); j++)
+ for(unsigned int j=0; j<x_ref.size(); j++)
{
if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j] )
{
x_ref.erase( x_ref.begin()+j );
y_ref.erase( y_ref.begin()+j );
z_ref.erase( z_ref.begin()+j );
-
}
}
}
+ //After looping through each vertex loaded from the mesh
+ //there should be no entities left in the reference vector
int leftovers = x_ref.size();
CHECK_EQUAL( 0, leftovers );
}
+//Superfluous test for ReadCGM, but perhaps better
+//than the test in place for moab::delete_geometry()
+
+
+/*
void delete_mesh_test()
{
Core moab;
@@ -327,3 +324,4 @@ void delete_mesh_test()
}
+*/
https://bitbucket.org/fathomteam/moab/commits/9ace8129a418/
Changeset: 9ace8129a418
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Cleanup of read_cgm_senses_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 904477a..4f0896d 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -77,22 +77,20 @@ void read_cube_curve_senses_test()
//Get all curve handles
Tag geom_tag;
-
rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
- MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
// Check that the proper number of curves exist
-
int dim = 1;
void *val[] = {&dim};
int number_of_curves;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
- val, 1, number_of_curves );
+ val, 1, number_of_curves );
CHECK_ERR(rval);
CHECK_EQUAL( 12 , number_of_curves );
- // Get curve handles
+ //Get curve handles
Range curves;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, curves );
@@ -100,6 +98,7 @@ void read_cube_curve_senses_test()
// Establish GeomTopoTool instance needed to get curve data
moab::GeomTopoTool gt( mb, false );
+ // Initialize vectors for sense checking
std::vector<EntityHandle> surfs;
std::vector<int> senses;
std::vector<int> known_surf_ids;
@@ -118,12 +117,11 @@ for(unsigned int i = 0; i < curves.size() ; i++)
//Clear reference data from previous curve
known_surf_ids.clear();
known_senses.clear();
- //Load known curve-sense data
+ //Load known curve-sense ID data
load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
-
+ //Check that each surf and sense has a match in the references
check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
}
-
}
@@ -131,11 +129,11 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
{
ErrorCode rval;
-
+ //Get the id_tag handle
Tag id_tag;
rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
-
+ //Load the ID for the EntHandle given to the function
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
CHECK_ERR(rval);
@@ -176,6 +174,7 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
}
+//Loads two vectors with reference curve and curve_sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
{
@@ -263,7 +262,7 @@ void read_cube_surf_senses_test()
geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
- // Check that the proper number of curves exist
+ // Check that the proper number of surfaces exist
int dim = 2;
void *val[] = {&dim};
int number_of_curves;
@@ -272,13 +271,13 @@ void read_cube_surf_senses_test()
CHECK_ERR(rval);
CHECK_EQUAL( 6, number_of_curves );
- // Get curve handles
+ // Get surface handles
Range surfs;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, surfs );
CHECK_ERR(rval);
- // Establish GeomTopoTool instance needed to get curve data
+ // Establish GeomTopoTool instance needed to get surf data
moab::GeomTopoTool gt( mb, false );
std::vector<EntityHandle> vols;
std::vector<int> senses;
@@ -294,10 +293,11 @@ for(unsigned int i = 0; i < surfs.size(); i++)
// surface from the mesh
gt.get_senses( surfs[i], vols, senses );
CHECK_ERR(rval);
-
- //Load known curve-sense data
+ //Clear previous reverence data
known_vol_ids.clear();
known_senses.clear();
+ // Load known surface-volume data
+ // for this surface and check that it's correct
load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
// Check sense information from the loaded mesh against
// reference sense information
@@ -307,10 +307,10 @@ for(unsigned int i = 0; i < surfs.size(); i++)
}
+//Loads reference surface to volume sense data into the reference vectors
void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
-
switch(surf_id)
{
case 1:
@@ -341,8 +341,8 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
case 6:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+
break;
}
-
}
https://bitbucket.org/fathomteam/moab/commits/de1a4366f71c/
Changeset: de1a4366f71c
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added a new file for sense checking and re-directed the ReadCGM sense tests to that file
Affected #: 2 files
diff --git a/MeshFiles/unittest/io/cylcube.sat b/MeshFiles/unittest/io/cylcube.sat
new file mode 100644
index 0000000..0b65976
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.sat
@@ -0,0 +1,202 @@
+1900 0 2 0
+10 Cubit 12.2 17 ACIS 19.0.2 Linux 24 Thu Feb 6 08:36:54 2014
+1 9.9999999999999995e-07 1e-10
+body $2 -1 -1 $-1 $3 $-1 $4 T 25 -5 -5 35 5 5 #
+body $5 -1 -1 $-1 $6 $-1 $-1 T -5 -5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $7 $-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 $8 -1 -1 $-1 $-1 $9 $0 T 25 -5 -5 35 5 5 #
+transform $-1 -1 1 0 0 0 1 0 0 0 1 0 0 0 1 no_rotate no_reflect no_shear #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $10 $-1 $1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+lump $11 -1 -1 $-1 $-1 $12 $1 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $-1 $2 $0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $13 $-1 $3 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 $14 $-1 $3 T 25 -5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $5 $1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $15 $-1 $6 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+shell $-1 -1 -1 $-1 $-1 $-1 $16 $-1 $6 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $17 $8 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+face $18 -1 -1 $-1 $19 $20 $9 $-1 $21 forward single T 25 -5 5 35 5 5 F #
+simple-snl-attrib $-1 -1 $22 $11 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+face $23 -1 -1 $-1 $24 $25 $12 $-1 $26 forward single T -5 -5 -5 5 5 5 F #
+simple-snl-attrib $-1 -1 $27 $13 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 2 0 7 1 2 618932362 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $28 $-1 $14 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+face $29 -1 -1 $-1 $30 $31 $9 $-1 $32 reversed single T 25 -5 -5 35 5 -5 F #
+loop $-1 -1 -1 $-1 $-1 $33 $14 T 25 -5 5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 5 0 0 1 1 0 0 forward_v I I I I #
+simple-snl-attrib $-1 -1 $34 $15 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 3 0 7 1 3 885205176 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $35 $-1 $16 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+face $36 -1 -1 $-1 $37 $38 $12 $-1 $39 forward single T -5 -5 -5 5 5 -5 F #
+loop $-1 -1 -1 $-1 $40 $41 $16 T -5 -5 -5 5 5 -5 unknown #
+cone-surface $-1 -1 -1 $-1 0 0 0 0 0 1 5 0 0 1 I I 0 1 5 forward I I I I #
+simple-snl-attrib $-1 -1 $-1 $17 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 4 4 1 1 0 0 #
+simple-snl-attrib $-1 -1 $42 $18 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $43 $-1 $19 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+face $44 -1 -1 $-1 $45 $46 $9 $-1 $47 reversed single T 25 -5 -5 35 -5 5 F #
+loop $-1 -1 -1 $-1 $-1 $48 $19 T 25 -5 -5 35 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 -5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $49 $50 $51 $52 forward $20 $-1 #
+simple-snl-attrib $-1 -1 $-1 $22 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 5 5 1 1 0 0 #
+simple-snl-attrib $-1 -1 $53 $23 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $54 $-1 $24 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+face $55 -1 -1 $-1 $-1 $56 $12 $-1 $57 forward single T -5 -5 5 5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $58 $24 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 #
+loop $-1 -1 -1 $-1 $-1 $59 $16 T -5 -5 5 5 5 5 unknown #
+coedge $-1 -1 -1 $-1 $41 $41 $58 $60 reversed $25 $-1 #
+simple-snl-attrib $-1 -1 $-1 $28 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $61 $29 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $62 $-1 $30 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+face $63 -1 -1 $-1 $64 $65 $9 $-1 $66 reversed single T 25 -5 -5 25 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $67 $30 T 25 -5 -5 35 -5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 -5 0 0 1 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $68 $69 $70 $71 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $72 $33 $73 $74 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $33 $72 $75 $76 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $77 $78 $33 $52 reversed $79 $-1 #
+edge $80 -1 -1 $-1 $81 -5 $82 5 $51 $83 forward @7 unknown T 35 -5 5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $35 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $84 $36 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $85 $-1 $37 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+loop $-1 -1 -1 $-1 $-1 $86 $37 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 $58 $58 $41 $60 forward $38 $-1 #
+coedge $-1 -1 -1 $-1 $59 $59 $86 $87 reversed $40 $-1 #
+edge $88 -1 -1 $-1 $89 0 $89 6.2831853071795862 $58 $90 forward @7 unknown T -5 -5 -5 5 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $43 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $91 $44 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $92 $-1 $45 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+face $93 -1 -1 $-1 $94 $95 $9 $-1 $96 reversed single T 25 5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $97 $45 T 25 -5 -5 25 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 25 0 0 1 0 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $98 $75 $99 $100 forward $46 $-1 #
+coedge $-1 -1 -1 $-1 $101 $48 $98 $102 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $48 $101 $103 $104 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $78 $77 $48 $71 reversed $79 $-1 #
+edge $105 -1 -1 $-1 $106 -5 $107 5 $70 $108 forward @7 unknown T 35 -5 -5 35 5 -5 #
+coedge $-1 -1 -1 $-1 $50 $49 $109 $110 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $111 $112 $49 $74 reversed $95 $-1 #
+edge $113 -1 -1 $-1 $82 -5 $114 5 $73 $115 forward @7 unknown T 25 5 5 35 5 5 #
+coedge $-1 -1 -1 $-1 $67 $116 $50 $76 reversed $46 $-1 #
+edge $117 -1 -1 $-1 $118 -5 $81 5 $75 $119 forward @7 unknown T 25 -5 5 35 -5 5 #
+coedge $-1 -1 -1 $-1 $70 $51 $116 $120 forward $79 $-1 #
+coedge $-1 -1 -1 $-1 $51 $70 $111 $121 reversed $79 $-1 #
+loop $-1 -1 -1 $-1 $-1 $77 $94 T 35 -5 -5 35 5 5 unknown #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $122 $-1 $52 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+vertex $123 -1 -1 $-1 $52 $124 #
+vertex $125 -1 -1 $-1 $52 $126 #
+straight-curve $-1 -1 -1 $-1 35 0 5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $54 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $127 $55 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+coedge $-1 -1 -1 $-1 $86 $86 $59 $87 forward $56 $-1 #
+edge $128 -1 -1 $-1 $129 0 $129 6.2831853071795862 $86 $130 forward @7 unknown T -5 -5 5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $131 $-1 $60 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 13 #
+vertex $132 -1 -1 $-1 $60 $133 #
+ellipse-curve $-1 -1 -1 $-1 0 0 -5 0 0 -1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $62 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $134 $63 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $135 $-1 $64 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+face $136 -1 -1 $-1 $-1 $79 $9 $-1 $137 reversed single T 35 -5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $111 $64 T 25 5 -5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 5 0 0 -1 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $138 $109 $112 $139 forward $65 $-1 #
+coedge $-1 -1 -1 $-1 $116 $67 $68 $102 reversed $46 $-1 #
+coedge $-1 -1 -1 $-1 $109 $138 $67 $100 reversed $65 $-1 #
+edge $140 -1 -1 $-1 $118 -5 $141 5 $99 $142 forward @7 unknown T 25 -5 -5 25 -5 5 #
+coedge $-1 -1 -1 $-1 $69 $68 $138 $143 forward $31 $-1 #
+edge $144 -1 -1 $-1 $107 -5 $141 5 $98 $145 forward @7 unknown T 25 -5 -5 35 -5 -5 #
+coedge $-1 -1 -1 $-1 $112 $111 $69 $104 reversed $95 $-1 #
+edge $146 -1 -1 $-1 $147 -5 $106 5 $103 $148 forward @7 unknown T 25 5 -5 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $149 $-1 $71 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+vertex $150 -1 -1 $-1 $71 $151 #
+vertex $152 -1 -1 $-1 $120 $153 #
+straight-curve $-1 -1 -1 $-1 35 0 -5 0 -1 0 I I #
+coedge $-1 -1 -1 $-1 $97 $99 $72 $110 reversed $65 $-1 #
+edge $154 -1 -1 $-1 $114 -5 $118 5 $109 $155 forward @7 unknown T 25 -5 5 25 5 5 #
+coedge $-1 -1 -1 $-1 $103 $73 $78 $121 forward $95 $-1 #
+coedge $-1 -1 -1 $-1 $73 $103 $97 $139 reversed $95 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $156 $-1 $74 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+vertex $157 -1 -1 $-1 $74 $158 #
+straight-curve $-1 -1 -1 $-1 30 5 5 -1 0 0 I I #
+coedge $-1 -1 -1 $-1 $75 $98 $77 $120 reversed $46 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $159 $-1 $76 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+vertex $160 -1 -1 $-1 $110 $161 #
+straight-curve $-1 -1 -1 $-1 30 -5 5 1 0 0 I I #
+edge $162 -1 -1 $-1 $81 -5 $107 5 $77 $163 forward @7 unknown T 35 -5 -5 35 -5 5 #
+edge $164 -1 -1 $-1 $82 -5 $106 5 $78 $165 forward @7 unknown T 35 5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $80 $52 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $166 $-1 $81 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 35 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $167 $-1 $82 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 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $85 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $168 $-1 $87 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 14 #
+vertex $169 -1 -1 $-1 $87 $170 #
+ellipse-curve $-1 -1 -1 $-1 0 0 5 0 0 1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $88 $60 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 13 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $171 $-1 $89 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+point $-1 -1 -1 $-1 5 0 -5 #
+simple-snl-attrib $-1 -1 $-1 $92 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $172 $93 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $173 $-1 $94 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 35 0 0 -1 0 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $99 $97 $101 $143 reversed $65 $-1 #
+edge $174 -1 -1 $-1 $114 -5 $147 5 $112 $175 forward @7 unknown T 25 5 -5 25 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $176 $-1 $100 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+vertex $177 -1 -1 $-1 $143 $178 #
+straight-curve $-1 -1 -1 $-1 25 -5 0 0 0 -1 I I #
+edge $179 -1 -1 $-1 $141 -5 $147 5 $138 $180 forward @7 unknown T 25 -5 -5 25 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $181 $-1 $102 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 30 -5 -5 -1 0 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $182 $-1 $104 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+vertex $183 -1 -1 $-1 $104 $184 #
+straight-curve $-1 -1 -1 $-1 30 5 -5 1 0 0 I I #
+simple-snl-attrib $-1 -1 $-1 $105 $71 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $185 $-1 $106 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 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $186 $-1 $107 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 35 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $187 $-1 $110 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 25 0 5 0 -1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $113 $74 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $188 $-1 $114 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 25 5 5 #
+simple-snl-attrib $-1 -1 $-1 $117 $76 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $189 $-1 $118 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 25 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $190 $-1 $120 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 35 -5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $191 $-1 $121 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 35 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $123 $81 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $125 $82 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $128 $87 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 14 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $192 $-1 $129 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+point $-1 -1 -1 $-1 5 0 5 #
+simple-snl-attrib $-1 -1 $-1 $132 $89 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $135 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $193 $136 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $194 $-1 $139 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 25 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $140 $100 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $195 $-1 $141 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 25 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $196 $-1 $143 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 25 0 -5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $144 $102 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $146 $104 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $197 $-1 $147 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 25 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $150 $106 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $152 $107 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $154 $110 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $157 $114 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $160 $118 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $162 $120 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $164 $121 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 12 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $169 $129 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $173 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $-1 $174 $139 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 11 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $177 $141 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $179 $143 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $183 $147 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+End-of-ACIS-data
\ No newline at end of file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 4f0896d..0b45b99 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -21,9 +21,9 @@ using namespace moab;
#ifdef MESHDIR
-static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
#else
-static const char input_cube[] = "/io/cube.sat";
+static const char input_cube[] = "/io/cylcube.sat";
#endif
// Function used to load the test file
https://bitbucket.org/fathomteam/moab/commits/241e0c4bbaa7/
Changeset: 241e0c4bbaa7
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Updated names of test functions; made a correction to a variable name in read_cylcube_surf_senses_test()
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 0b45b99..07713a9 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -42,8 +42,8 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
int geom_id_by_handle( Interface* moab, const EntityHandle set );
// List of tests in this file
-void read_cube_curve_senses_test();
-void read_cube_surf_senses_test();
+void read_cylcube_curve_senses_test();
+void read_cylcube_surf_senses_test();
void delete_mesh_test();
@@ -51,8 +51,8 @@ int main(int /* argc */, char** /* argv */)
{
int result = 0;
- result += RUN_TEST(read_cube_curve_senses_test);
- result += RUN_TEST(read_cube_surf_senses_test);
+ result += RUN_TEST(read_cylcube_curve_senses_test);
+ result += RUN_TEST(read_cylcube_surf_senses_test);
return result;
}
@@ -67,7 +67,7 @@ void read_file( Interface* moab, const char* input_file )
CHECK_ERR(rval);
}
-void read_cube_curve_senses_test()
+void read_cylcube_curve_senses_test()
{
ErrorCode rval;
//Open the test file
@@ -248,7 +248,7 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
}
///SURFACE SENSE CHECKING
-void read_cube_surf_senses_test()
+void read_cylcube_surf_senses_test()
{
ErrorCode rval;
//Open the test file
@@ -265,11 +265,11 @@ void read_cube_surf_senses_test()
// Check that the proper number of surfaces exist
int dim = 2;
void *val[] = {&dim};
- int number_of_curves;
+ int number_of_surfs;
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
- val, 1, number_of_curves );
+ val, 1, number_of_surfs );
CHECK_ERR(rval);
- CHECK_EQUAL( 6, number_of_curves );
+ CHECK_EQUAL( 6, number_of_surfs );
// Get surface handles
Range surfs;
https://bitbucket.org/fathomteam/moab/commits/5e4262a61963/
Changeset: 5e4262a61963
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Updated reference information to match the new file
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 07713a9..0ec0db7 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -88,7 +88,7 @@ void read_cylcube_curve_senses_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
CHECK_ERR(rval);
- CHECK_EQUAL( 12 , number_of_curves );
+ CHECK_EQUAL( 14, number_of_curves );
//Get curve handles
Range curves;
@@ -186,63 +186,72 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
case 1:
surf_ids_out.push_back(1); surf_ids_out.push_back(6);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 2:
surf_ids_out.push_back(1); surf_ids_out.push_back(5);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 3:
surf_ids_out.push_back(1); surf_ids_out.push_back(4);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 4:
surf_ids_out.push_back(1); surf_ids_out.push_back(3);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 5:
surf_ids_out.push_back(2); surf_ids_out.push_back(6);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 6:
surf_ids_out.push_back(2); surf_ids_out.push_back(3);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 7:
surf_ids_out.push_back(2); surf_ids_out.push_back(4);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 8:
surf_ids_out.push_back(2); surf_ids_out.push_back(5);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 9:
surf_ids_out.push_back(3); surf_ids_out.push_back(4);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 10:
surf_ids_out.push_back(3); surf_ids_out.push_back(6);
senses_out.push_back(-1); senses_out.push_back(1);
+ break;
- break;
case 11:
surf_ids_out.push_back(4); surf_ids_out.push_back(5);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
case 12:
surf_ids_out.push_back(5); surf_ids_out.push_back(6);
senses_out.push_back(1); senses_out.push_back(-1);
+ break;
- break;
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(-1); senses_out.push_back(1);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(-1); senses_out.push_back(1);
+ break;
}
}
@@ -269,7 +278,7 @@ void read_cylcube_surf_senses_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
CHECK_ERR(rval);
- CHECK_EQUAL( 6, number_of_surfs );
+ CHECK_EQUAL( 9, number_of_surfs );
// Get surface handles
Range surfs;
@@ -316,33 +325,47 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
case 1:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
- break;
case 2:
vol_ids_out.push_back(1);
senses_out.push_back(1);
-
- break;
+ break;
case 3:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
- break;
case 4:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
- break;
case 5:
vol_ids_out.push_back(1);
senses_out.push_back(1);
- break;
+ break;
+
case 6:
vol_ids_out.push_back(1);
senses_out.push_back(1);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(1);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(1);
+ break;
- break;
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(1);
+ break;
}
}
https://bitbucket.org/fathomteam/moab/commits/5dfe613e2539/
Changeset: 5dfe613e2539
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Updated sense settings to use macros in case the CGM convention ever changes again.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 0ec0db7..2dcda2e 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -12,6 +12,9 @@
#include "InitCGMA.hpp"
#include "GeometryQueryTool.hpp"
+#define SENSE_FORWARD 1
+#define SENSE_REVERSE -1
+#define SENSE_UNKNOWN 0
using namespace moab;
#define CHKERR(A) do { if (MB_SUCCESS != (A)) { \
@@ -185,72 +188,72 @@ void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int
{
case 1:
surf_ids_out.push_back(1); surf_ids_out.push_back(6);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 2:
surf_ids_out.push_back(1); surf_ids_out.push_back(5);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 3:
surf_ids_out.push_back(1); surf_ids_out.push_back(4);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 4:
surf_ids_out.push_back(1); surf_ids_out.push_back(3);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 5:
surf_ids_out.push_back(2); surf_ids_out.push_back(6);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 6:
surf_ids_out.push_back(2); surf_ids_out.push_back(3);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 7:
surf_ids_out.push_back(2); surf_ids_out.push_back(4);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 8:
surf_ids_out.push_back(2); surf_ids_out.push_back(5);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 9:
surf_ids_out.push_back(3); surf_ids_out.push_back(4);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 10:
surf_ids_out.push_back(3); surf_ids_out.push_back(6);
- senses_out.push_back(-1); senses_out.push_back(1);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
case 11:
surf_ids_out.push_back(4); surf_ids_out.push_back(5);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 12:
surf_ids_out.push_back(5); surf_ids_out.push_back(6);
- senses_out.push_back(1); senses_out.push_back(-1);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
break;
case 13:
surf_ids_out.push_back(7); surf_ids_out.push_back(8);
- senses_out.push_back(-1); senses_out.push_back(1);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
case 14:
surf_ids_out.push_back(7); surf_ids_out.push_back(9);
- senses_out.push_back(-1); senses_out.push_back(1);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
}
@@ -324,47 +327,47 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
{
case 1:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 2:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 3:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 4:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 5:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 6:
vol_ids_out.push_back(1);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 7:
vol_ids_out.push_back(2);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 8:
vol_ids_out.push_back(2);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
case 9:
vol_ids_out.push_back(2);
- senses_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
break;
}
}
https://bitbucket.org/fathomteam/moab/commits/d31d5b268fe8/
Changeset: d31d5b268fe8
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added new ReadCGM test file read_cgm_group_test.cpp. Included this in the /test/io Makefile.am
Affected #: 2 files
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index e9a73b3..61f932a 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -25,7 +25,8 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test \
+ read_cgm_group_test
else
CGM_TEST =
endif
@@ -78,6 +79,8 @@ read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cp
read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
read_cgm_connectivity_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_connectivity_test.cpp
read_cgm_connectivity_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_group_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_group_test.cpp
+read_cgm_group_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(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_group_test.cpp b/test/io/read_cgm_group_test.cpp
new file mode 100644
index 0000000..5596880
--- /dev/null
+++ b/test/io/read_cgm_group_test.cpp
@@ -0,0 +1,51 @@
+
+#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"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.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
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#else
+static const char input_cube[] = "/io/cube.sat";
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
https://bitbucket.org/fathomteam/moab/commits/d224143bbebd/
Changeset: d224143bbebd
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Added testing of groups and group names to read_cgm_group_test
Affected #: 1 file
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 5596880..04d4787 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -20,21 +20,32 @@ using namespace moab;
#ifdef MESHDIR
-static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
#else
-static const char input_cube[] = "/io/cube.sat";
+static const char input_cylcube[] = "/io/cylcube.sat";
#endif
// Function used to load the test file
void read_file( Interface* moab, const char* input_file );
-// List of tests in this file
+//Function for getting entity ids
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+//Function for checking retrieved group data
+void check_group_data( std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids );
+//Function for loading all reference data
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids);
+
+// List of tests in this file
+void read_cylcube_groups_test();
int main(int /* argc */, char** /* argv */)
{
int result = 0;
+
+ result+=RUN_TEST(read_cylcube_groups_test);
return result;
}
@@ -49,3 +60,126 @@ void read_file( Interface* moab, const char* input_file )
ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
}
+
+void read_cylcube_groups_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube);
+
+ //Get (or create) the name and category tags
+ Tag name_tag, category_tag;
+
+ rval = mb->tag_get_handle( NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
+ name_tag, moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ rval = mb->tag_get_handle( CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE,
+ MB_TYPE_OPAQUE, category_tag,
+ moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the group entity handles
+ Range group_sets;
+ char query[] = "Group\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+ //Has to be this way because of the way tags are created
+ void* val[] = {&query};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
+ CHECK_ERR(rval);
+
+ std::vector<int> g_ids;
+ std::vector<std::string> g_names;
+ std::vector<int> g_ent_ids;
+ int j = 0;
+ for(Range::iterator i=group_sets.begin(); i!=group_sets.end(); i++)
+ {
+ int group_id = geom_id_by_handle( mb, *i );
+ g_ids.push_back(group_id);
+ //Get the group name
+ char group_name[NAME_TAG_SIZE+1];
+ rval = mb->tag_get_data( name_tag, &(*i), 1, &group_name);
+ CHECK_ERR(rval);
+ //Store group name
+ std::string temp(group_name);
+ g_names.push_back(temp);
+ //Ensure the group is named correctly
+ CHECK( strcmp( group_name, "Group 2") || strcmp(group_name, "Group 3"));
+ //Get all entities in the group
+ Range group_ents;
+ rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false);
+ CHECK_ERR(rval);
+ if( group_ents.size() != 1) CHECK(false);
+ int grp_ent_id = geom_id_by_handle( mb, group_ents[0] );
+ g_ent_ids.push_back(grp_ent_id);
+
+ }
+ check_group_data(g_ids, g_names, g_ent_ids);
+}
+
+
+void check_group_data(std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids )
+{
+
+ //Initialize reference data
+ std::vector<int> group_ref_ids;
+ std::vector<std::string> group_ref_names;
+ std::vector<int> group_ref_ent_ids;
+ load_group_references( group_ref_ids, group_ref_names, group_ref_ent_ids );
+
+ // check that the correct number of entities were found
+ CHECK_EQUAL ( group_ref_ids.size(), group_ids.size() );
+ // CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
+ CHECK_EQUAL ( group_ref_ent_ids.size(), group_ent_ids.size() );
+
+ //now make sure that each group has a matching group
+ for(unsigned int i=0 ; i<group_ids.size(); i++)
+ {
+ for(unsigned int j=0; j<group_ref_ids.size(); j++)
+ {
+ if( group_ids[i]==group_ref_ids[j]
+ && group_names[i] == group_ref_names[j]
+ && group_ent_ids[i]==group_ref_ent_ids[j])
+ {
+ group_ref_ids.erase(group_ref_ids.begin()+j);
+ group_ref_names.erase(group_ref_names.begin()+j);
+ group_ref_ent_ids.erase(group_ref_ent_ids.begin()+j);
+ continue;
+ }
+ }
+ }
+
+ // Check sizes of reference vectors after matching
+ // (all should be zero)
+ int leftovers = group_ref_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_names.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_ent_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+}
+
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids )
+{
+ //First set of group info
+ names.push_back("Group 3"); ids.push_back(3); ent_ids.push_back(2);
+
+ //Second set of group info
+ names.push_back("Group 2"); ids.push_back(2); ent_ids.push_back(1);
+}
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
https://bitbucket.org/fathomteam/moab/commits/b01d729344cf/
Changeset: b01d729344cf
Branch: None
User: pshriwise
Date: 2014-02-13 23:52:41
Summary: Cleanup of read_cgm_group_test.cpp
Affected #: 1 file
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 04d4787..1357fb3 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -89,7 +89,7 @@ void read_cylcube_groups_test()
void* val[] = {&query};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
CHECK_ERR(rval);
-
+ //Get group names and IDs
std::vector<int> g_ids;
std::vector<std::string> g_names;
std::vector<int> g_ent_ids;
@@ -105,18 +105,16 @@ void read_cylcube_groups_test()
//Store group name
std::string temp(group_name);
g_names.push_back(temp);
- //Ensure the group is named correctly
- CHECK( strcmp( group_name, "Group 2") || strcmp(group_name, "Group 3"));
//Get all entities in the group
Range group_ents;
- rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false);
+ rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false );
CHECK_ERR(rval);
if( group_ents.size() != 1) CHECK(false);
int grp_ent_id = geom_id_by_handle( mb, group_ents[0] );
g_ent_ids.push_back(grp_ent_id);
}
- check_group_data(g_ids, g_names, g_ent_ids);
+ check_group_data( g_ids, g_names, g_ent_ids );
}
@@ -131,7 +129,7 @@ void check_group_data(std::vector<int> group_ids, std::vector<std::string> group
// check that the correct number of entities were found
CHECK_EQUAL ( group_ref_ids.size(), group_ids.size() );
- // CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
+ CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
CHECK_EQUAL ( group_ref_ent_ids.size(), group_ent_ids.size() );
//now make sure that each group has a matching group
https://bitbucket.org/fathomteam/moab/commits/9032edc44c70/
Changeset: 9032edc44c70
Branch: None
User: pshriwise
Date: 2014-02-15 19:38:36
Summary: Updated the ReadCGM group test to include conditions for a build w/ OCC.
Affected #: 2 files
diff --git a/MeshFiles/unittest/io/cylcube.stp b/MeshFiles/unittest/io/cylcube.stp
new file mode 100644
index 0000000..bc4ec64
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.stp
@@ -0,0 +1,290 @@
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('STEP AP214'),'1');
+FILE_NAME('/home/user/cylcube.stp','2014-02-15T18:13:39',(' '),(' '),'Spatial InterOp 3D',' ',' ');
+FILE_SCHEMA(('automotive_design'));
+ENDSEC;
+DATA;
+#1=PRODUCT_DEFINITION_CONTEXT('',#13,'design');
+#2=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#13);
+#3=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#14,#15);
+#4=SHAPE_DEFINITION_REPRESENTATION(#16,#17);
+#5=PRODUCT_DEFINITION_CONTEXT('',#18,'design');
+#6=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#18);
+#7=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#19,#20);
+#8=SHAPE_DEFINITION_REPRESENTATION(#21,#22);
+#9= (GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#25))GLOBAL_UNIT_ASSIGNED_CONTEXT((#27,#28,#29))REPRESENTATION_CONTEXT('NONE','WORKSPACE'));
+#13=APPLICATION_CONTEXT(' ');
+#14=PRODUCT_CATEGORY('part','NONE');
+#15=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#31));
+#16=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#32);
+#17=ADVANCED_BREP_SHAPE_REPRESENTATION('1',(#33,#34),#9);
+#18=APPLICATION_CONTEXT(' ');
+#19=PRODUCT_CATEGORY('part','NONE');
+#20=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#35));
+#21=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#36);
+#22=ADVANCED_BREP_SHAPE_REPRESENTATION('2',(#37,#38),#9);
+#25=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-06),#27,'','');
+#27= (CONVERSION_BASED_UNIT('MILLIMETRE',#41)LENGTH_UNIT()NAMED_UNIT(#44));
+#28= (NAMED_UNIT(#46)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#29= (NAMED_UNIT(#46)SOLID_ANGLE_UNIT()SI_UNIT($,.STERADIAN.));
+#31=PRODUCT('1','1','PART-1-DESC',(#52));
+#32=PRODUCT_DEFINITION('NONE','NONE',#53,#1);
+#33=MANIFOLD_SOLID_BREP('1',#54);
+#34=AXIS2_PLACEMENT_3D('',#55,#56,#57);
+#35=PRODUCT('2','2','PART-2-DESC',(#58));
+#36=PRODUCT_DEFINITION('NONE','NONE',#59,#5);
+#37=MANIFOLD_SOLID_BREP('2',#60);
+#38=AXIS2_PLACEMENT_3D('',#61,#62,#63);
+#41=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0),#64);
+#44=DIMENSIONAL_EXPONENTS(1.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#46=DIMENSIONAL_EXPONENTS(0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#52=PRODUCT_CONTEXT('',#13,'mechanical');
+#53=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#31,.NOT_KNOWN.);
+#54=CLOSED_SHELL('',(#65,#66,#67,#68,#69,#70));
+#55=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#56=DIRECTION('',(0.0,0.0,1.0));
+#57=DIRECTION('',(1.0,0.0,0.0));
+#58=PRODUCT_CONTEXT('',#18,'mechanical');
+#59=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#35,.NOT_KNOWN.);
+#60=CLOSED_SHELL('',(#71,#72,#73,#74));
+#61=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#62=DIRECTION('',(0.0,0.0,1.0));
+#63=DIRECTION('',(1.0,0.0,0.0));
+#64= (NAMED_UNIT(#44)LENGTH_UNIT()SI_UNIT(.MILLI.,.METRE.));
+#65=ADVANCED_FACE('',(#76),#77,.T.);
+#66=ADVANCED_FACE('',(#78),#79,.F.);
+#67=ADVANCED_FACE('',(#80),#81,.F.);
+#68=ADVANCED_FACE('',(#82),#83,.F.);
+#69=ADVANCED_FACE('',(#84),#85,.F.);
+#70=ADVANCED_FACE('',(#86),#87,.F.);
+#71=ADVANCED_FACE('',(#88),#89,.T.);
+#72=ADVANCED_FACE('',(#90),#91,.T.);
+#73=ADVANCED_FACE('',(#92),#93,.T.);
+#74=ADVANCED_FACE('',(#94),#95,.T.);
+#76=FACE_OUTER_BOUND('',#96,.T.);
+#77=PLANE('',#97);
+#78=FACE_OUTER_BOUND('',#98,.T.);
+#79=PLANE('',#99);
+#80=FACE_OUTER_BOUND('',#100,.T.);
+#81=PLANE('',#101);
+#82=FACE_OUTER_BOUND('',#102,.T.);
+#83=PLANE('',#103);
+#84=FACE_OUTER_BOUND('',#104,.T.);
+#85=PLANE('',#105);
+#86=FACE_OUTER_BOUND('',#106,.T.);
+#87=PLANE('',#107);
+#88=FACE_OUTER_BOUND('',#108,.T.);
+#89=CYLINDRICAL_SURFACE('',#109,5.0);
+#90=FACE_OUTER_BOUND('',#110,.T.);
+#91=CYLINDRICAL_SURFACE('',#111,5.0);
+#92=FACE_OUTER_BOUND('',#112,.T.);
+#93=PLANE('',#113);
+#94=FACE_OUTER_BOUND('',#114,.T.);
+#95=PLANE('',#115);
+#96=EDGE_LOOP('',(#116,#117,#118,#119));
+#97=AXIS2_PLACEMENT_3D('',#120,#121,#122);
+#98=EDGE_LOOP('',(#123,#124,#125,#126));
+#99=AXIS2_PLACEMENT_3D('',#127,#128,#129);
+#100=EDGE_LOOP('',(#130,#131,#132,#133));
+#101=AXIS2_PLACEMENT_3D('',#134,#135,#136);
+#102=EDGE_LOOP('',(#137,#138,#139,#140));
+#103=AXIS2_PLACEMENT_3D('',#141,#142,#143);
+#104=EDGE_LOOP('',(#144,#145,#146,#147));
+#105=AXIS2_PLACEMENT_3D('',#148,#149,#150);
+#106=EDGE_LOOP('',(#151,#152,#153,#154));
+#107=AXIS2_PLACEMENT_3D('',#155,#156,#157);
+#108=EDGE_LOOP('',(#158,#159,#160,#161));
+#109=AXIS2_PLACEMENT_3D('',#162,#163,#164);
+#110=EDGE_LOOP('',(#165,#166,#167,#168));
+#111=AXIS2_PLACEMENT_3D('',#169,#170,#171);
+#112=EDGE_LOOP('',(#172,#173));
+#113=AXIS2_PLACEMENT_3D('',#174,#175,#176);
+#114=EDGE_LOOP('',(#177,#178));
+#115=AXIS2_PLACEMENT_3D('',#179,#180,#181);
+#116=ORIENTED_EDGE('',*,*,#182,.T.);
+#117=ORIENTED_EDGE('',*,*,#183,.T.);
+#118=ORIENTED_EDGE('',*,*,#184,.T.);
+#119=ORIENTED_EDGE('',*,*,#185,.T.);
+#120=CARTESIAN_POINT('',(30.0,0.0,5.0));
+#121=DIRECTION('',(0.0,0.0,1.0));
+#122=DIRECTION('',(1.0,0.0,0.0));
+#123=ORIENTED_EDGE('',*,*,#186,.T.);
+#124=ORIENTED_EDGE('',*,*,#187,.T.);
+#125=ORIENTED_EDGE('',*,*,#188,.T.);
+#126=ORIENTED_EDGE('',*,*,#189,.T.);
+#127=CARTESIAN_POINT('',(30.0,0.0,-5.0));
+#128=DIRECTION('',(0.0,0.0,1.0));
+#129=DIRECTION('',(1.0,0.0,0.0));
+#130=ORIENTED_EDGE('',*,*,#190,.T.);
+#131=ORIENTED_EDGE('',*,*,#187,.F.);
+#132=ORIENTED_EDGE('',*,*,#191,.F.);
+#133=ORIENTED_EDGE('',*,*,#185,.F.);
+#134=CARTESIAN_POINT('',(30.0,-5.0,0.0));
+#135=DIRECTION('',(0.0,1.0,0.0));
+#136=DIRECTION('',(0.0,0.0,1.0));
+#137=ORIENTED_EDGE('',*,*,#192,.T.);
+#138=ORIENTED_EDGE('',*,*,#188,.F.);
+#139=ORIENTED_EDGE('',*,*,#190,.F.);
+#140=ORIENTED_EDGE('',*,*,#184,.F.);
+#141=CARTESIAN_POINT('',(25.0,0.0,0.0));
+#142=DIRECTION('',(1.0,0.0,0.0));
+#143=DIRECTION('',(0.0,0.0,-1.0));
+#144=ORIENTED_EDGE('',*,*,#193,.T.);
+#145=ORIENTED_EDGE('',*,*,#189,.F.);
+#146=ORIENTED_EDGE('',*,*,#192,.F.);
+#147=ORIENTED_EDGE('',*,*,#183,.F.);
+#148=CARTESIAN_POINT('',(30.0,5.0,0.0));
+#149=DIRECTION('',(0.0,-1.0,0.0));
+#150=DIRECTION('',(0.0,0.0,-1.0));
+#151=ORIENTED_EDGE('',*,*,#191,.T.);
+#152=ORIENTED_EDGE('',*,*,#186,.F.);
+#153=ORIENTED_EDGE('',*,*,#193,.F.);
+#154=ORIENTED_EDGE('',*,*,#182,.F.);
+#155=CARTESIAN_POINT('',(35.0,0.0,0.0));
+#156=DIRECTION('',(-1.0,0.0,0.0));
+#157=DIRECTION('',(0.0,0.0,1.0));
+#158=ORIENTED_EDGE('',*,*,#194,.F.);
+#159=ORIENTED_EDGE('',*,*,#195,.F.);
+#160=ORIENTED_EDGE('',*,*,#196,.F.);
+#161=ORIENTED_EDGE('',*,*,#197,.F.);
+#162=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#163=DIRECTION('',(0.0,0.0,1.0));
+#164=DIRECTION('',(1.0,0.0,0.0));
+#165=ORIENTED_EDGE('',*,*,#194,.T.);
+#166=ORIENTED_EDGE('',*,*,#198,.F.);
+#167=ORIENTED_EDGE('',*,*,#196,.T.);
+#168=ORIENTED_EDGE('',*,*,#199,.F.);
+#169=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#170=DIRECTION('',(0.0,0.0,1.0));
+#171=DIRECTION('',(1.0,0.0,0.0));
+#172=ORIENTED_EDGE('',*,*,#199,.T.);
+#173=ORIENTED_EDGE('',*,*,#195,.T.);
+#174=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#175=DIRECTION('',(0.0,0.0,-1.0));
+#176=DIRECTION('',(-1.0,0.0,0.0));
+#177=ORIENTED_EDGE('',*,*,#197,.T.);
+#178=ORIENTED_EDGE('',*,*,#198,.T.);
+#179=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#180=DIRECTION('',(0.0,0.0,1.0));
+#181=DIRECTION('',(1.0,0.0,0.0));
+#182=EDGE_CURVE('',#200,#201,#202,.T.);
+#183=EDGE_CURVE('',#201,#203,#204,.T.);
+#184=EDGE_CURVE('',#203,#205,#206,.T.);
+#185=EDGE_CURVE('',#205,#200,#207,.T.);
+#186=EDGE_CURVE('',#208,#209,#210,.T.);
+#187=EDGE_CURVE('',#209,#211,#212,.T.);
+#188=EDGE_CURVE('',#211,#213,#214,.T.);
+#189=EDGE_CURVE('',#213,#208,#215,.T.);
+#190=EDGE_CURVE('',#205,#211,#216,.T.);
+#191=EDGE_CURVE('',#200,#209,#217,.T.);
+#192=EDGE_CURVE('',#203,#213,#218,.T.);
+#193=EDGE_CURVE('',#201,#208,#219,.T.);
+#194=EDGE_CURVE('',#220,#221,#222,.T.);
+#195=EDGE_CURVE('',#223,#220,#224,.T.);
+#196=EDGE_CURVE('',#225,#223,#226,.T.);
+#197=EDGE_CURVE('',#221,#225,#227,.T.);
+#198=EDGE_CURVE('',#225,#221,#228,.T.);
+#199=EDGE_CURVE('',#220,#223,#229,.T.);
+#200=VERTEX_POINT('',#230);
+#201=VERTEX_POINT('',#231);
+#202=LINE('',#232,#233);
+#203=VERTEX_POINT('',#234);
+#204=LINE('',#235,#236);
+#205=VERTEX_POINT('',#237);
+#206=LINE('',#238,#239);
+#207=LINE('',#240,#241);
+#208=VERTEX_POINT('',#242);
+#209=VERTEX_POINT('',#243);
+#210=LINE('',#244,#245);
+#211=VERTEX_POINT('',#246);
+#212=LINE('',#247,#248);
+#213=VERTEX_POINT('',#249);
+#214=LINE('',#250,#251);
+#215=LINE('',#252,#253);
+#216=LINE('',#254,#255);
+#217=LINE('',#256,#257);
+#218=LINE('',#258,#259);
+#219=LINE('',#260,#261);
+#220=VERTEX_POINT('',#262);
+#221=VERTEX_POINT('',#263);
+#222=LINE('',#264,#265);
+#223=VERTEX_POINT('',#266);
+#224=CIRCLE('',#267,5.0);
+#225=VERTEX_POINT('',#268);
+#226=LINE('',#269,#270);
+#227=CIRCLE('',#271,5.0);
+#228=CIRCLE('',#272,5.0);
+#229=CIRCLE('',#273,5.0);
+#230=CARTESIAN_POINT('',(35.0,-5.0,5.0));
+#231=CARTESIAN_POINT('',(35.0,5.0,5.0));
+#232=CARTESIAN_POINT('',(35.0,0.0,5.0));
+#233=VECTOR('',#274,1.0);
+#234=CARTESIAN_POINT('',(25.0,5.0,5.0));
+#235=CARTESIAN_POINT('',(30.0,5.0,5.0));
+#236=VECTOR('',#275,1.0);
+#237=CARTESIAN_POINT('',(25.0,-5.0,5.0));
+#238=CARTESIAN_POINT('',(25.0,0.0,5.0));
+#239=VECTOR('',#276,1.0);
+#240=CARTESIAN_POINT('',(30.0,-5.0,5.0));
+#241=VECTOR('',#277,1.0);
+#242=CARTESIAN_POINT('',(35.0,5.0,-5.0));
+#243=CARTESIAN_POINT('',(35.0,-5.0,-5.0));
+#244=CARTESIAN_POINT('',(35.0,0.0,-5.0));
+#245=VECTOR('',#278,1.0);
+#246=CARTESIAN_POINT('',(25.0,-5.0,-5.0));
+#247=CARTESIAN_POINT('',(30.0,-5.0,-5.0));
+#248=VECTOR('',#279,1.0);
+#249=CARTESIAN_POINT('',(25.0,5.0,-5.0));
+#250=CARTESIAN_POINT('',(25.0,0.0,-5.0));
+#251=VECTOR('',#280,1.0);
+#252=CARTESIAN_POINT('',(30.0,5.0,-5.0));
+#253=VECTOR('',#281,1.0);
+#254=CARTESIAN_POINT('',(25.0,-5.0,0.0));
+#255=VECTOR('',#282,1.0);
+#256=CARTESIAN_POINT('',(35.0,-5.0,0.0));
+#257=VECTOR('',#283,1.0);
+#258=CARTESIAN_POINT('',(25.0,5.0,0.0));
+#259=VECTOR('',#284,1.0);
+#260=CARTESIAN_POINT('',(35.0,5.0,0.0));
+#261=VECTOR('',#285,1.0);
+#262=CARTESIAN_POINT('',(5.0,0.0,-5.0));
+#263=CARTESIAN_POINT('',(5.0,0.0,5.0));
+#264=CARTESIAN_POINT('',(5.0,-6.12303176911189E-16,0.0));
+#265=VECTOR('',#286,1.0);
+#266=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,-5.0));
+#267=AXIS2_PLACEMENT_3D('',#287,#288,#289);
+#268=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,5.0));
+#269=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,0.0));
+#270=VECTOR('',#290,1.0);
+#271=AXIS2_PLACEMENT_3D('',#291,#292,#293);
+#272=AXIS2_PLACEMENT_3D('',#294,#295,#296);
+#273=AXIS2_PLACEMENT_3D('',#297,#298,#299);
+#274=DIRECTION('',(0.0,1.0,0.0));
+#275=DIRECTION('',(-1.0,0.0,0.0));
+#276=DIRECTION('',(0.0,-1.0,0.0));
+#277=DIRECTION('',(1.0,0.0,0.0));
+#278=DIRECTION('',(0.0,-1.0,0.0));
+#279=DIRECTION('',(-1.0,0.0,0.0));
+#280=DIRECTION('',(0.0,1.0,0.0));
+#281=DIRECTION('',(1.0,0.0,0.0));
+#282=DIRECTION('',(0.0,0.0,-1.0));
+#283=DIRECTION('',(0.0,0.0,-1.0));
+#284=DIRECTION('',(0.0,0.0,-1.0));
+#285=DIRECTION('',(0.0,0.0,-1.0));
+#286=DIRECTION('',(0.0,0.0,1.0));
+#287=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#288=DIRECTION('',(0.0,0.0,-1.0));
+#289=DIRECTION('',(1.0,0.0,0.0));
+#290=DIRECTION('',(-0.0,-0.0,-1.0));
+#291=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#292=DIRECTION('',(0.0,0.0,1.0));
+#293=DIRECTION('',(1.0,0.0,0.0));
+#294=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#295=DIRECTION('',(0.0,0.0,1.0));
+#296=DIRECTION('',(1.0,0.0,0.0));
+#297=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#298=DIRECTION('',(0.0,0.0,-1.0));
+#299=DIRECTION('',(1.0,0.0,0.0));
+ENDSEC;
+END-ISO-10303-21;
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 1357fb3..4148434 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -20,9 +20,17 @@ using namespace moab;
#ifdef MESHDIR
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+#else
static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
#else
-static const char input_cylcube[] = "/io/cylcube.sat";
+static const char input_cylcube[] = "cylcube.sat";
+#endif
#endif
// Function used to load the test file
@@ -121,6 +129,17 @@ void read_cylcube_groups_test()
void check_group_data(std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids )
{
+ // Step files do not contain group data, MOAB shouldn't return errors when trying to access
+ // this data but there shouldn't be any found.
+#ifdef HAVE_OCC_STEP
+ int num_g_ids = group_ids.size();
+ int num_g_names = group_names.size();
+
+ CHECK_EQUAL( 0, num_g_ids );
+ CHECK_EQUAL( 0, num_g_names );
+#else
+
+
//Initialize reference data
std::vector<int> group_ref_ids;
std::vector<std::string> group_ref_names;
@@ -157,6 +176,7 @@ void check_group_data(std::vector<int> group_ids, std::vector<std::string> group
CHECK_EQUAL( 0, leftovers );
leftovers = group_ref_ent_ids.size();
CHECK_EQUAL( 0, leftovers );
+#endif
}
void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids )
https://bitbucket.org/fathomteam/moab/commits/91be9294b908/
Changeset: 91be9294b908
Branch: None
User: pshriwise
Date: 2014-02-15 20:26:37
Summary: Added surface to volume sense reference data function for the cylcube step file. Updated the file name for occ builds.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 2dcda2e..3bce847 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -24,17 +24,28 @@ using namespace moab;
#ifdef MESHDIR
-static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
#else
-static const char input_cube[] = "/io/cylcube.sat";
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
// Function used to load the test file
void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
-void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+void load_occ_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
// the model to reference information
@@ -76,7 +87,7 @@ void read_cylcube_curve_senses_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cylcube );
//Get all curve handles
Tag geom_tag;
@@ -91,8 +102,15 @@ void read_cylcube_curve_senses_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_curves );
CHECK_ERR(rval);
+ //Step format adds a surface on the barrel of the cylinder.
+ //This created 4 extra surfaces in comparison to the .sat format from Cubit.
+ //(New surface breaks the barrel of the cylinder into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 18, number_of_curves );
+#else
CHECK_EQUAL( 14, number_of_curves );
-
+#endif
+
//Get curve handles
Range curves;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
@@ -266,7 +284,7 @@ void read_cylcube_surf_senses_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cylcube );
//Get geometry tag for gathering surface information from the mesh
Tag geom_tag;
@@ -281,8 +299,13 @@ void read_cylcube_surf_senses_test()
rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
val, 1, number_of_surfs );
CHECK_ERR(rval);
+ //Step format adds a surface on barrel of the cylinder.
+ // (Breaks it into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 10, number_of_surfs );
+#else
CHECK_EQUAL( 9, number_of_surfs );
-
+#endif
// Get surface handles
Range surfs;
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
@@ -310,7 +333,11 @@ for(unsigned int i = 0; i < surfs.size(); i++)
known_senses.clear();
// Load known surface-volume data
// for this surface and check that it's correct
- load_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+#ifdef HAV_OCC_STEP
+ load_occ_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+#else
+ load_cubit_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+#endif
// Check sense information from the loaded mesh against
// reference sense information
check_sense_data( mb, vols, senses, known_vol_ids, known_senses );
@@ -320,7 +347,7 @@ for(unsigned int i = 0; i < surfs.size(); i++)
}
//Loads reference surface to volume sense data into the reference vectors
-void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
@@ -372,3 +399,61 @@ void load_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>&
}
}
+//Loads reference surface to volume sense data into the reference vectors
+void load_occ_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf );
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 10:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+ }
+}
+
https://bitbucket.org/fathomteam/moab/commits/214a488501fa/
Changeset: 214a488501fa
Branch: None
User: pshriwise
Date: 2014-02-15 20:31:49
Summary: Removed redundant prototype for load_cubit_vol_sense_data.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 3bce847..0c0faa2 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -44,7 +44,6 @@ void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
-void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
void load_occ_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
https://bitbucket.org/fathomteam/moab/commits/739cf67f2313/
Changeset: 739cf67f2313
Branch: None
User: pshriwise
Date: 2014-02-15 20:33:58
Summary: Changed function name from load_*_vol_sense_data to load_*_surf_sense_data
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 0c0faa2..d636e24 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -43,8 +43,8 @@ void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
-void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
-void load_occ_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+void load_cubit_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+void load_occ_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
// the model to reference information
@@ -333,9 +333,9 @@ for(unsigned int i = 0; i < surfs.size(); i++)
// Load known surface-volume data
// for this surface and check that it's correct
#ifdef HAV_OCC_STEP
- load_occ_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ load_occ_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
#else
- load_cubit_vol_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ load_cubit_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
#endif
// Check sense information from the loaded mesh against
// reference sense information
@@ -346,7 +346,7 @@ for(unsigned int i = 0; i < surfs.size(); i++)
}
//Loads reference surface to volume sense data into the reference vectors
-void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+void load_cubit_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
@@ -399,7 +399,7 @@ void load_cubit_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<
}
//Loads reference surface to volume sense data into the reference vectors
-void load_occ_vol_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+void load_occ_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
https://bitbucket.org/fathomteam/moab/commits/c661c87b96d7/
Changeset: c661c87b96d7
Branch: None
User: pshriwise
Date: 2014-02-15 20:41:25
Summary: Updated name of several load reference functions
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index d636e24..c52e14e 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -42,8 +42,8 @@ static const char input_cylcube[] = "cylcube.sat";
void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
-void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
-void load_cubit_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+void load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+void load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
void load_occ_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
@@ -138,7 +138,7 @@ for(unsigned int i = 0; i < curves.size() ; i++)
known_surf_ids.clear();
known_senses.clear();
//Load known curve-sense ID data
- load_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ load_sat_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
//Check that each surf and sense has a match in the references
check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
}
@@ -195,7 +195,7 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
}
//Loads two vectors with reference curve and curve_sense data
-void load_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+void load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
{
int curve_id = geom_id_by_handle( moab, curve );
@@ -335,7 +335,7 @@ for(unsigned int i = 0; i < surfs.size(); i++)
#ifdef HAV_OCC_STEP
load_occ_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
#else
- load_cubit_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ load_sat_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
#endif
// Check sense information from the loaded mesh against
// reference sense information
@@ -346,7 +346,7 @@ for(unsigned int i = 0; i < surfs.size(); i++)
}
//Loads reference surface to volume sense data into the reference vectors
-void load_cubit_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+void load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
https://bitbucket.org/fathomteam/moab/commits/6164b6d6c84e/
Changeset: 6164b6d6c84e
Branch: None
User: pshriwise
Date: 2014-02-15 20:53:44
Summary: Added curve sense reference information function for step format.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index c52e14e..2be31d9 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -43,8 +43,9 @@ void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
void load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+void load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
void load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
-void load_occ_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+void load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
// the model to reference information
@@ -138,7 +139,12 @@ for(unsigned int i = 0; i < curves.size() ; i++)
known_surf_ids.clear();
known_senses.clear();
//Load known curve-sense ID data
+#ifdef HAVE_OCC_STEP
+ load_stp_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+#else
load_sat_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+#endif
+
//Check that each surf and sense has a match in the references
check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
}
@@ -276,6 +282,104 @@ void load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector
}
+//Loads two vectors with reference curve and curve_sense data
+void load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
+
+ int curve_id = geom_id_by_handle( moab, curve );
+
+
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 15:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 16:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 17:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 18:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ }
+
+}
+
///SURFACE SENSE CHECKING
void read_cylcube_surf_senses_test()
{
@@ -333,7 +437,7 @@ for(unsigned int i = 0; i < surfs.size(); i++)
// Load known surface-volume data
// for this surface and check that it's correct
#ifdef HAV_OCC_STEP
- load_occ_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ load_stp_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
#else
load_sat_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
#endif
@@ -399,7 +503,7 @@ void load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<i
}
//Loads reference surface to volume sense data into the reference vectors
-void load_occ_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+void load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
https://bitbucket.org/fathomteam/moab/commits/de01bb363024/
Changeset: de01bb363024
Branch: None
User: pshriwise
Date: 2014-02-15 21:12:54
Summary: Added failure conditions to reference loading functions in ReadCGM senses test.
If the correct surface id isn't found in the reference data, the function will return MB_FAILURE.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 2be31d9..499bfa3 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -42,10 +42,10 @@ static const char input_cylcube[] = "cylcube.sat";
void read_file( Interface* moab, const char* input_file );
// Functions containing known sense data
-void load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
-void load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
-void load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
-void load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
// Functions used to compare sense information found in
// the model to reference information
@@ -140,9 +140,11 @@ for(unsigned int i = 0; i < curves.size() ; i++)
known_senses.clear();
//Load known curve-sense ID data
#ifdef HAVE_OCC_STEP
- load_stp_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ rval = load_stp_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
#else
- load_sat_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ rval = load_sat_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
#endif
//Check that each surf and sense has a match in the references
@@ -201,12 +203,10 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
}
//Loads two vectors with reference curve and curve_sense data
-void load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
{
int curve_id = geom_id_by_handle( moab, curve );
-
-
switch(curve_id)
{
case 1:
@@ -278,17 +278,18 @@ void load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector
surf_ids_out.push_back(7); surf_ids_out.push_back(9);
senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
- }
+ default:
+ return MB_FAILURE;
+ }
+ return MB_SUCCESS;
}
//Loads two vectors with reference curve and curve_sense data
-void load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
{
int curve_id = geom_id_by_handle( moab, curve );
-
-
switch(curve_id)
{
case 1:
@@ -376,8 +377,11 @@ void load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector
surf_ids_out.push_back(8); surf_ids_out.push_back(9);
senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
break;
- }
+ default:
+ return MB_FAILURE;
+ }
+ return MB_SUCCESS;
}
///SURFACE SENSE CHECKING
@@ -436,10 +440,12 @@ for(unsigned int i = 0; i < surfs.size(); i++)
known_senses.clear();
// Load known surface-volume data
// for this surface and check that it's correct
-#ifdef HAV_OCC_STEP
- load_stp_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+#ifdef HAVE_OCC_STEP
+ rval = load_stp_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
#else
- load_sat_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ rval = load_sat_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
#endif
// Check sense information from the loaded mesh against
// reference sense information
@@ -450,7 +456,7 @@ for(unsigned int i = 0; i < surfs.size(); i++)
}
//Loads reference surface to volume sense data into the reference vectors
-void load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
@@ -499,11 +505,15 @@ void load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<i
vol_ids_out.push_back(2);
senses_out.push_back(SENSE_FORWARD);
break;
+ default:
+ return MB_FAILURE;
+
}
+ return MB_SUCCESS;
}
//Loads reference surface to volume sense data into the reference vectors
-void load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
int surf_id = geom_id_by_handle( moab, surf );
switch(surf_id)
@@ -557,6 +567,10 @@ void load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<i
vol_ids_out.push_back(2);
senses_out.push_back(SENSE_FORWARD);
break;
+ default:
+ std::cout << "Failure to find surface sense reference data. Returning failure..." << std::endl;
+ return MB_FAILURE;
}
+ return MB_SUCCESS;
}
https://bitbucket.org/fathomteam/moab/commits/877a7c39f0a1/
Changeset: 877a7c39f0a1
Branch: None
User: pshriwise
Date: 2014-02-15 21:23:57
Summary: Changed the leftovers check in check_sense_data to be for data loaded from the file to make the test more robust.
Affected #: 1 file
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 499bfa3..2dda375 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -190,14 +190,14 @@ void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std:
CHECK_EQUAL( senses[i], known_senses[j] );
//Once a wrt entity is matched with a known entity,
// remove it from the list
- known_wrt_ids.erase( known_wrt_ids.begin()+j );
- known_senses.erase( known_senses.begin()+j );
+ wrt_ent_ids.erase( wrt_ent_ids.begin()+i );
+ senses.erase( senses.begin()+i );
}
}
}
// After both loops are complete, known_wrt_ents should be empty
- int leftovers = known_wrt_ids.size();
+ int leftovers = wrt_ent_ids.size();
CHECK_EQUAL( leftovers, 0 );
}
https://bitbucket.org/fathomteam/moab/commits/5956dcd3f9df/
Changeset: 5956dcd3f9df
Branch: None
User: pshriwise
Date: 2014-02-15 21:29:23
Summary: Added .stp file load (if built with occ) to read_cgm_connectivity_test.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index f0e67c24..db370cc 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -20,10 +20,19 @@ using namespace moab;
#ifdef MESHDIR
-static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
#else
-static const char input_cube[] = "/io/cube.sat";
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
// Function used to load the test file
void read_file( Interface* moab, const char* input_file );
@@ -69,7 +78,7 @@ void cube_verts_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cylcube );
//Get all vertex handles from the mesh
Range verts;
@@ -95,7 +104,7 @@ void cube_tris_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cylcube );
//Get triangles from the mesh
Range tris;
@@ -130,7 +139,7 @@ void cube_tri_curve_coincidence_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cylcube );
//Get curves from the mesh
Range curves;
@@ -184,7 +193,7 @@ void cube_edge_adjacencies_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cylcube );
//Get the curves
Range curves;
@@ -211,7 +220,7 @@ void cube_tri_vertex_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cube );
+ read_file( mb, input_cylcube );
//Get all triangles
Range tris;
https://bitbucket.org/fathomteam/moab/commits/bbc753a599f8/
Changeset: bbc753a599f8
Branch: None
User: pshriwise
Date: 2014-02-16 19:57:01
Summary: Altered the query initialization for groups in the ReadCGM group test function.
Affected #: 1 file
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 4148434..4bbc95a 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -92,7 +92,7 @@ void read_cylcube_groups_test()
//Get the group entity handles
Range group_sets;
- char query[] = "Group\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
+ char query[CATEGORY_TAG_SIZE] = "Group\0";
//Has to be this way because of the way tags are created
void* val[] = {&query};
rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
https://bitbucket.org/fathomteam/moab/commits/295167396061/
Changeset: 295167396061
Branch: None
User: pshriwise
Date: 2014-02-16 19:59:53
Summary: Removed a test that is run twice in ReadCGM connectivity tests.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index db370cc..0ebd4fc 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -54,7 +54,6 @@ int main(int /* argc */, char** /* argv */)
result += RUN_TEST(cube_verts_connectivity_test);
result += RUN_TEST(cube_tris_connectivity_test);
result += RUN_TEST(cube_tri_curve_coincidence_test);
- result += RUN_TEST(cube_tri_curve_coincidence_test);
result += RUN_TEST(cube_tri_vertex_test);
return result;
https://bitbucket.org/fathomteam/moab/commits/9b9e4d82c0f6/
Changeset: 9b9e4d82c0f6
Branch: None
User: pshriwise
Date: 2014-02-16 21:10:17
Summary: Made a correction to the filename for ReadCGM connectivity test.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 0ebd4fc..7c8d8a9 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -21,15 +21,15 @@ using namespace moab;
#ifdef MESHDIR
#ifdef HAVE_OCC_STEP
-static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.stp";
#else
-static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+static const char input_cube[] = STRINGIFY(MESHDIR) "/io/cube.sat";
#endif
#else
#ifdef HAVE_OCC_STEP
-static const char input_cylcube[] = "cylcube.stp";
+static const char input_cube[] = "cube.stp";
#else
-static const char input_cylcube[] = "cylcube.sat";
+static const char input_cube[] = "cube.sat";
#endif
#endif
@@ -77,7 +77,7 @@ void cube_verts_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cylcube );
+ read_file( mb, input_cube );
//Get all vertex handles from the mesh
Range verts;
@@ -103,7 +103,7 @@ void cube_tris_connectivity_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cylcube );
+ read_file( mb, input_cube );
//Get triangles from the mesh
Range tris;
@@ -138,12 +138,13 @@ void cube_tri_curve_coincidence_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cylcube );
+ read_file( mb, input_cube );
//Get curves from the mesh
Range curves;
rval = mb->get_entities_by_type( 0, MBEDGE, curves );
CHECK_ERR(rval);
+ curves.print();
//Get triangles from the mesh
Range tris;
@@ -192,7 +193,7 @@ void cube_edge_adjacencies_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cylcube );
+ read_file( mb, input_cube );
//Get the curves
Range curves;
@@ -219,7 +220,7 @@ void cube_tri_vertex_test()
//Open the test file
Core moab;
Interface* mb = &moab;
- read_file( mb, input_cylcube );
+ read_file( mb, input_cube );
//Get all triangles
Range tris;
https://bitbucket.org/fathomteam/moab/commits/2374b56cf00c/
Changeset: 2374b56cf00c
Branch: None
User: pshriwise
Date: 2014-02-17 21:27:23
Summary: Removed comment of cgm_version.h. Now building with versions of CGM > 12.2
Affected #: 1 file
diff --git a/src/io/ReadCGM.cpp b/src/io/ReadCGM.cpp
index e854a2e..bb9eb9a 100644
--- a/src/io/ReadCGM.cpp
+++ b/src/io/ReadCGM.cpp
@@ -16,7 +16,7 @@
#pragma warning(disable:4786)
#endif
-//#include "cgm_version.h"
+#include "cgm_version.h"
#include "GeometryQueryTool.hpp"
#include "ModelQueryEngine.hpp"
#include "RefEntityName.hpp"
https://bitbucket.org/fathomteam/moab/commits/7dc304821652/
Changeset: 7dc304821652
Branch: None
User: pshriwise
Date: 2014-02-17 21:29:00
Summary: Merge branch 'add_cgm_tests_3'
Affected #: 8 files
diff --git a/MeshFiles/unittest/io/cylcube.sat b/MeshFiles/unittest/io/cylcube.sat
new file mode 100644
index 0000000..0b65976
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.sat
@@ -0,0 +1,202 @@
+1900 0 2 0
+10 Cubit 12.2 17 ACIS 19.0.2 Linux 24 Thu Feb 6 08:36:54 2014
+1 9.9999999999999995e-07 1e-10
+body $2 -1 -1 $-1 $3 $-1 $4 T 25 -5 -5 35 5 5 #
+body $5 -1 -1 $-1 $6 $-1 $-1 T -5 -5 -5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $7 $-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 $8 -1 -1 $-1 $-1 $9 $0 T 25 -5 -5 35 5 5 #
+transform $-1 -1 1 0 0 0 1 0 0 0 1 0 0 0 1 no_rotate no_reflect no_shear #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $10 $-1 $1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+lump $11 -1 -1 $-1 $-1 $12 $1 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $-1 $2 $0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $13 $-1 $3 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 $14 $-1 $3 T 25 -5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $5 $1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $15 $-1 $6 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+shell $-1 -1 -1 $-1 $-1 $-1 $16 $-1 $6 T -5 -5 -5 5 5 5 #
+simple-snl-attrib $-1 -1 $17 $8 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+face $18 -1 -1 $-1 $19 $20 $9 $-1 $21 forward single T 25 -5 5 35 5 5 F #
+simple-snl-attrib $-1 -1 $22 $11 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+face $23 -1 -1 $-1 $24 $25 $12 $-1 $26 forward single T -5 -5 -5 5 5 5 F #
+simple-snl-attrib $-1 -1 $27 $13 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 2 0 7 1 2 618932362 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $28 $-1 $14 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+face $29 -1 -1 $-1 $30 $31 $9 $-1 $32 reversed single T 25 -5 -5 35 5 -5 F #
+loop $-1 -1 -1 $-1 $-1 $33 $14 T 25 -5 5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 5 0 0 1 1 0 0 forward_v I I I I #
+simple-snl-attrib $-1 -1 $34 $15 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 2 @5 GROUP @7 Group 3 0 7 1 3 885205176 0 0 0 0 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $35 $-1 $16 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 7 #
+face $36 -1 -1 $-1 $37 $38 $12 $-1 $39 forward single T -5 -5 -5 5 5 -5 F #
+loop $-1 -1 -1 $-1 $40 $41 $16 T -5 -5 -5 5 5 -5 unknown #
+cone-surface $-1 -1 -1 $-1 0 0 0 0 0 1 5 0 0 1 I I 0 1 5 forward I I I I #
+simple-snl-attrib $-1 -1 $-1 $17 $3 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 4 4 1 1 0 0 #
+simple-snl-attrib $-1 -1 $42 $18 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $43 $-1 $19 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+face $44 -1 -1 $-1 $45 $46 $9 $-1 $47 reversed single T 25 -5 -5 35 -5 5 F #
+loop $-1 -1 -1 $-1 $-1 $48 $19 T 25 -5 -5 35 5 -5 unknown #
+plane-surface $-1 -1 -1 $-1 30 0 -5 0 0 1 1 0 0 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $49 $50 $51 $52 forward $20 $-1 #
+simple-snl-attrib $-1 -1 $-1 $22 $6 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 7 @16 GRAPHICS_OPTIONS @14 geometry color @10 mesh color @19 geometry visibility @15 mesh visibility @11 render mode @11 transparent 0 6 5 5 1 1 0 0 #
+simple-snl-attrib $-1 -1 $53 $23 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $54 $-1 $24 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+face $55 -1 -1 $-1 $-1 $56 $12 $-1 $57 forward single T -5 -5 5 5 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $58 $24 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 #
+loop $-1 -1 -1 $-1 $-1 $59 $16 T -5 -5 5 5 5 5 unknown #
+coedge $-1 -1 -1 $-1 $41 $41 $58 $60 reversed $25 $-1 #
+simple-snl-attrib $-1 -1 $-1 $28 $14 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $61 $29 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $62 $-1 $30 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 3 #
+face $63 -1 -1 $-1 $64 $65 $9 $-1 $66 reversed single T 25 -5 -5 25 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $67 $30 T 25 -5 -5 35 -5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 -5 0 0 1 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $68 $69 $70 $71 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $72 $33 $73 $74 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $33 $72 $75 $76 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $77 $78 $33 $52 reversed $79 $-1 #
+edge $80 -1 -1 $-1 $81 -5 $82 5 $51 $83 forward @7 unknown T 35 -5 5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $35 $16 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $84 $36 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $85 $-1 $37 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+loop $-1 -1 -1 $-1 $-1 $86 $37 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 $58 $58 $41 $60 forward $38 $-1 #
+coedge $-1 -1 -1 $-1 $59 $59 $86 $87 reversed $40 $-1 #
+edge $88 -1 -1 $-1 $89 0 $89 6.2831853071795862 $58 $90 forward @7 unknown T -5 -5 -5 5 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $43 $19 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $91 $44 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $92 $-1 $45 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+face $93 -1 -1 $-1 $94 $95 $9 $-1 $96 reversed single T 25 5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $97 $45 T 25 -5 -5 25 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 25 0 0 1 0 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $98 $75 $99 $100 forward $46 $-1 #
+coedge $-1 -1 -1 $-1 $101 $48 $98 $102 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $48 $101 $103 $104 forward $31 $-1 #
+coedge $-1 -1 -1 $-1 $78 $77 $48 $71 reversed $79 $-1 #
+edge $105 -1 -1 $-1 $106 -5 $107 5 $70 $108 forward @7 unknown T 35 -5 -5 35 5 -5 #
+coedge $-1 -1 -1 $-1 $50 $49 $109 $110 forward $20 $-1 #
+coedge $-1 -1 -1 $-1 $111 $112 $49 $74 reversed $95 $-1 #
+edge $113 -1 -1 $-1 $82 -5 $114 5 $73 $115 forward @7 unknown T 25 5 5 35 5 5 #
+coedge $-1 -1 -1 $-1 $67 $116 $50 $76 reversed $46 $-1 #
+edge $117 -1 -1 $-1 $118 -5 $81 5 $75 $119 forward @7 unknown T 25 -5 5 35 -5 5 #
+coedge $-1 -1 -1 $-1 $70 $51 $116 $120 forward $79 $-1 #
+coedge $-1 -1 -1 $-1 $51 $70 $111 $121 reversed $79 $-1 #
+loop $-1 -1 -1 $-1 $-1 $77 $94 T 35 -5 -5 35 5 5 unknown #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $122 $-1 $52 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 1 #
+vertex $123 -1 -1 $-1 $52 $124 #
+vertex $125 -1 -1 $-1 $52 $126 #
+straight-curve $-1 -1 -1 $-1 35 0 5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $54 $24 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $127 $55 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+coedge $-1 -1 -1 $-1 $86 $86 $59 $87 forward $56 $-1 #
+edge $128 -1 -1 $-1 $129 0 $129 6.2831853071795862 $86 $130 forward @7 unknown T -5 -5 5 5 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $131 $-1 $60 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 13 #
+vertex $132 -1 -1 $-1 $60 $133 #
+ellipse-curve $-1 -1 -1 $-1 0 0 -5 0 0 -1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $62 $30 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $134 $63 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $135 $-1 $64 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+face $136 -1 -1 $-1 $-1 $79 $9 $-1 $137 reversed single T 35 -5 -5 35 5 5 F #
+loop $-1 -1 -1 $-1 $-1 $111 $64 T 25 5 -5 35 5 5 unknown #
+plane-surface $-1 -1 -1 $-1 30 5 0 0 -1 0 0 0 -1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $138 $109 $112 $139 forward $65 $-1 #
+coedge $-1 -1 -1 $-1 $116 $67 $68 $102 reversed $46 $-1 #
+coedge $-1 -1 -1 $-1 $109 $138 $67 $100 reversed $65 $-1 #
+edge $140 -1 -1 $-1 $118 -5 $141 5 $99 $142 forward @7 unknown T 25 -5 -5 25 -5 5 #
+coedge $-1 -1 -1 $-1 $69 $68 $138 $143 forward $31 $-1 #
+edge $144 -1 -1 $-1 $107 -5 $141 5 $98 $145 forward @7 unknown T 25 -5 -5 35 -5 -5 #
+coedge $-1 -1 -1 $-1 $112 $111 $69 $104 reversed $95 $-1 #
+edge $146 -1 -1 $-1 $147 -5 $106 5 $103 $148 forward @7 unknown T 25 5 -5 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $149 $-1 $71 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 5 #
+vertex $150 -1 -1 $-1 $71 $151 #
+vertex $152 -1 -1 $-1 $120 $153 #
+straight-curve $-1 -1 -1 $-1 35 0 -5 0 -1 0 I I #
+coedge $-1 -1 -1 $-1 $97 $99 $72 $110 reversed $65 $-1 #
+edge $154 -1 -1 $-1 $114 -5 $118 5 $109 $155 forward @7 unknown T 25 -5 5 25 5 5 #
+coedge $-1 -1 -1 $-1 $103 $73 $78 $121 forward $95 $-1 #
+coedge $-1 -1 -1 $-1 $73 $103 $97 $139 reversed $95 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $156 $-1 $74 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 2 #
+vertex $157 -1 -1 $-1 $74 $158 #
+straight-curve $-1 -1 -1 $-1 30 5 5 -1 0 0 I I #
+coedge $-1 -1 -1 $-1 $75 $98 $77 $120 reversed $46 $-1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $159 $-1 $76 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 4 #
+vertex $160 -1 -1 $-1 $110 $161 #
+straight-curve $-1 -1 -1 $-1 30 -5 5 1 0 0 I I #
+edge $162 -1 -1 $-1 $81 -5 $107 5 $77 $163 forward @7 unknown T 35 -5 -5 35 -5 5 #
+edge $164 -1 -1 $-1 $82 -5 $106 5 $78 $165 forward @7 unknown T 35 5 -5 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $80 $52 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $166 $-1 $81 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 35 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $167 $-1 $82 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 35 5 5 #
+simple-snl-attrib $-1 -1 $-1 $85 $37 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $168 $-1 $87 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 14 #
+vertex $169 -1 -1 $-1 $87 $170 #
+ellipse-curve $-1 -1 -1 $-1 0 0 5 0 0 1 5 0 0 1 I I #
+simple-snl-attrib $-1 -1 $-1 $88 $60 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 13 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $171 $-1 $89 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+point $-1 -1 -1 $-1 5 0 -5 #
+simple-snl-attrib $-1 -1 $-1 $92 $45 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $172 $93 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $173 $-1 $94 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 35 0 0 -1 0 0 0 0 1 forward_v I I I I #
+coedge $-1 -1 -1 $-1 $99 $97 $101 $143 reversed $65 $-1 #
+edge $174 -1 -1 $-1 $114 -5 $147 5 $112 $175 forward @7 unknown T 25 5 -5 25 5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $176 $-1 $100 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 9 #
+vertex $177 -1 -1 $-1 $143 $178 #
+straight-curve $-1 -1 -1 $-1 25 -5 0 0 0 -1 I I #
+edge $179 -1 -1 $-1 $141 -5 $147 5 $138 $180 forward @7 unknown T 25 -5 -5 25 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $181 $-1 $102 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 30 -5 -5 -1 0 0 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $182 $-1 $104 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 8 #
+vertex $183 -1 -1 $-1 $104 $184 #
+straight-curve $-1 -1 -1 $-1 30 5 -5 1 0 0 I I #
+simple-snl-attrib $-1 -1 $-1 $105 $71 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $185 $-1 $106 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 35 5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $186 $-1 $107 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 35 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $187 $-1 $110 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 25 0 5 0 -1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $113 $74 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $188 $-1 $114 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 25 5 5 #
+simple-snl-attrib $-1 -1 $-1 $117 $76 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $189 $-1 $118 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 25 -5 5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $190 $-1 $120 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 35 -5 0 0 0 -1 I I #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $191 $-1 $121 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 35 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $123 $81 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 1 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $125 $82 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 2 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $128 $87 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 14 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $192 $-1 $129 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 @8 CUBIT_ID 10 #
+point $-1 -1 -1 $-1 5 0 5 #
+simple-snl-attrib $-1 -1 $-1 $132 $89 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $135 $64 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $193 $136 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $194 $-1 $139 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 25 5 0 0 0 -1 I I #
+simple-snl-attrib $-1 -1 $-1 $140 $100 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 9 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $195 $-1 $141 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 25 -5 -5 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $196 $-1 $143 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 25 0 -5 0 1 0 I I #
+simple-snl-attrib $-1 -1 $-1 $144 $102 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $146 $104 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+integer_attrib-name_attrib-gen-attrib $-1 -1 $197 $-1 $147 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 25 5 -5 #
+simple-snl-attrib $-1 -1 $-1 $150 $106 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 5 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $152 $107 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 6 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $154 $110 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $157 $114 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 3 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $160 $118 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 4 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $162 $120 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $164 $121 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 12 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $169 $129 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 10 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $173 $94 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 3 @13 MESH_INTERVAL @4 LIMP @4 LIMP 2 1 0 5 1 0 0 1 1 #
+simple-snl-attrib $-1 -1 $-1 $174 $139 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 11 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $177 $141 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $179 $143 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 7 -2147483648 -1 #
+simple-snl-attrib $-1 -1 $-1 $183 $147 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 @17 NEW_SIMPLE_ATTRIB 1 @9 ENTITY_ID 0 3 8 -2147483648 -1 #
+End-of-ACIS-data
\ No newline at end of file
diff --git a/MeshFiles/unittest/io/cylcube.stp b/MeshFiles/unittest/io/cylcube.stp
new file mode 100644
index 0000000..bc4ec64
--- /dev/null
+++ b/MeshFiles/unittest/io/cylcube.stp
@@ -0,0 +1,290 @@
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('STEP AP214'),'1');
+FILE_NAME('/home/user/cylcube.stp','2014-02-15T18:13:39',(' '),(' '),'Spatial InterOp 3D',' ',' ');
+FILE_SCHEMA(('automotive_design'));
+ENDSEC;
+DATA;
+#1=PRODUCT_DEFINITION_CONTEXT('',#13,'design');
+#2=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#13);
+#3=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#14,#15);
+#4=SHAPE_DEFINITION_REPRESENTATION(#16,#17);
+#5=PRODUCT_DEFINITION_CONTEXT('',#18,'design');
+#6=APPLICATION_PROTOCOL_DEFINITION('INTERNATIONAL STANDARD','automotive_design',1994,#18);
+#7=PRODUCT_CATEGORY_RELATIONSHIP('NONE','NONE',#19,#20);
+#8=SHAPE_DEFINITION_REPRESENTATION(#21,#22);
+#9= (GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#25))GLOBAL_UNIT_ASSIGNED_CONTEXT((#27,#28,#29))REPRESENTATION_CONTEXT('NONE','WORKSPACE'));
+#13=APPLICATION_CONTEXT(' ');
+#14=PRODUCT_CATEGORY('part','NONE');
+#15=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#31));
+#16=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#32);
+#17=ADVANCED_BREP_SHAPE_REPRESENTATION('1',(#33,#34),#9);
+#18=APPLICATION_CONTEXT(' ');
+#19=PRODUCT_CATEGORY('part','NONE');
+#20=PRODUCT_RELATED_PRODUCT_CATEGORY('detail',' ',(#35));
+#21=PRODUCT_DEFINITION_SHAPE('NONE','NONE',#36);
+#22=ADVANCED_BREP_SHAPE_REPRESENTATION('2',(#37,#38),#9);
+#25=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-06),#27,'','');
+#27= (CONVERSION_BASED_UNIT('MILLIMETRE',#41)LENGTH_UNIT()NAMED_UNIT(#44));
+#28= (NAMED_UNIT(#46)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
+#29= (NAMED_UNIT(#46)SOLID_ANGLE_UNIT()SI_UNIT($,.STERADIAN.));
+#31=PRODUCT('1','1','PART-1-DESC',(#52));
+#32=PRODUCT_DEFINITION('NONE','NONE',#53,#1);
+#33=MANIFOLD_SOLID_BREP('1',#54);
+#34=AXIS2_PLACEMENT_3D('',#55,#56,#57);
+#35=PRODUCT('2','2','PART-2-DESC',(#58));
+#36=PRODUCT_DEFINITION('NONE','NONE',#59,#5);
+#37=MANIFOLD_SOLID_BREP('2',#60);
+#38=AXIS2_PLACEMENT_3D('',#61,#62,#63);
+#41=LENGTH_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0),#64);
+#44=DIMENSIONAL_EXPONENTS(1.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#46=DIMENSIONAL_EXPONENTS(0.0,0.0,0.0,0.0,0.0,0.0,0.0);
+#52=PRODUCT_CONTEXT('',#13,'mechanical');
+#53=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#31,.NOT_KNOWN.);
+#54=CLOSED_SHELL('',(#65,#66,#67,#68,#69,#70));
+#55=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#56=DIRECTION('',(0.0,0.0,1.0));
+#57=DIRECTION('',(1.0,0.0,0.0));
+#58=PRODUCT_CONTEXT('',#18,'mechanical');
+#59=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(' ','NONE',#35,.NOT_KNOWN.);
+#60=CLOSED_SHELL('',(#71,#72,#73,#74));
+#61=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#62=DIRECTION('',(0.0,0.0,1.0));
+#63=DIRECTION('',(1.0,0.0,0.0));
+#64= (NAMED_UNIT(#44)LENGTH_UNIT()SI_UNIT(.MILLI.,.METRE.));
+#65=ADVANCED_FACE('',(#76),#77,.T.);
+#66=ADVANCED_FACE('',(#78),#79,.F.);
+#67=ADVANCED_FACE('',(#80),#81,.F.);
+#68=ADVANCED_FACE('',(#82),#83,.F.);
+#69=ADVANCED_FACE('',(#84),#85,.F.);
+#70=ADVANCED_FACE('',(#86),#87,.F.);
+#71=ADVANCED_FACE('',(#88),#89,.T.);
+#72=ADVANCED_FACE('',(#90),#91,.T.);
+#73=ADVANCED_FACE('',(#92),#93,.T.);
+#74=ADVANCED_FACE('',(#94),#95,.T.);
+#76=FACE_OUTER_BOUND('',#96,.T.);
+#77=PLANE('',#97);
+#78=FACE_OUTER_BOUND('',#98,.T.);
+#79=PLANE('',#99);
+#80=FACE_OUTER_BOUND('',#100,.T.);
+#81=PLANE('',#101);
+#82=FACE_OUTER_BOUND('',#102,.T.);
+#83=PLANE('',#103);
+#84=FACE_OUTER_BOUND('',#104,.T.);
+#85=PLANE('',#105);
+#86=FACE_OUTER_BOUND('',#106,.T.);
+#87=PLANE('',#107);
+#88=FACE_OUTER_BOUND('',#108,.T.);
+#89=CYLINDRICAL_SURFACE('',#109,5.0);
+#90=FACE_OUTER_BOUND('',#110,.T.);
+#91=CYLINDRICAL_SURFACE('',#111,5.0);
+#92=FACE_OUTER_BOUND('',#112,.T.);
+#93=PLANE('',#113);
+#94=FACE_OUTER_BOUND('',#114,.T.);
+#95=PLANE('',#115);
+#96=EDGE_LOOP('',(#116,#117,#118,#119));
+#97=AXIS2_PLACEMENT_3D('',#120,#121,#122);
+#98=EDGE_LOOP('',(#123,#124,#125,#126));
+#99=AXIS2_PLACEMENT_3D('',#127,#128,#129);
+#100=EDGE_LOOP('',(#130,#131,#132,#133));
+#101=AXIS2_PLACEMENT_3D('',#134,#135,#136);
+#102=EDGE_LOOP('',(#137,#138,#139,#140));
+#103=AXIS2_PLACEMENT_3D('',#141,#142,#143);
+#104=EDGE_LOOP('',(#144,#145,#146,#147));
+#105=AXIS2_PLACEMENT_3D('',#148,#149,#150);
+#106=EDGE_LOOP('',(#151,#152,#153,#154));
+#107=AXIS2_PLACEMENT_3D('',#155,#156,#157);
+#108=EDGE_LOOP('',(#158,#159,#160,#161));
+#109=AXIS2_PLACEMENT_3D('',#162,#163,#164);
+#110=EDGE_LOOP('',(#165,#166,#167,#168));
+#111=AXIS2_PLACEMENT_3D('',#169,#170,#171);
+#112=EDGE_LOOP('',(#172,#173));
+#113=AXIS2_PLACEMENT_3D('',#174,#175,#176);
+#114=EDGE_LOOP('',(#177,#178));
+#115=AXIS2_PLACEMENT_3D('',#179,#180,#181);
+#116=ORIENTED_EDGE('',*,*,#182,.T.);
+#117=ORIENTED_EDGE('',*,*,#183,.T.);
+#118=ORIENTED_EDGE('',*,*,#184,.T.);
+#119=ORIENTED_EDGE('',*,*,#185,.T.);
+#120=CARTESIAN_POINT('',(30.0,0.0,5.0));
+#121=DIRECTION('',(0.0,0.0,1.0));
+#122=DIRECTION('',(1.0,0.0,0.0));
+#123=ORIENTED_EDGE('',*,*,#186,.T.);
+#124=ORIENTED_EDGE('',*,*,#187,.T.);
+#125=ORIENTED_EDGE('',*,*,#188,.T.);
+#126=ORIENTED_EDGE('',*,*,#189,.T.);
+#127=CARTESIAN_POINT('',(30.0,0.0,-5.0));
+#128=DIRECTION('',(0.0,0.0,1.0));
+#129=DIRECTION('',(1.0,0.0,0.0));
+#130=ORIENTED_EDGE('',*,*,#190,.T.);
+#131=ORIENTED_EDGE('',*,*,#187,.F.);
+#132=ORIENTED_EDGE('',*,*,#191,.F.);
+#133=ORIENTED_EDGE('',*,*,#185,.F.);
+#134=CARTESIAN_POINT('',(30.0,-5.0,0.0));
+#135=DIRECTION('',(0.0,1.0,0.0));
+#136=DIRECTION('',(0.0,0.0,1.0));
+#137=ORIENTED_EDGE('',*,*,#192,.T.);
+#138=ORIENTED_EDGE('',*,*,#188,.F.);
+#139=ORIENTED_EDGE('',*,*,#190,.F.);
+#140=ORIENTED_EDGE('',*,*,#184,.F.);
+#141=CARTESIAN_POINT('',(25.0,0.0,0.0));
+#142=DIRECTION('',(1.0,0.0,0.0));
+#143=DIRECTION('',(0.0,0.0,-1.0));
+#144=ORIENTED_EDGE('',*,*,#193,.T.);
+#145=ORIENTED_EDGE('',*,*,#189,.F.);
+#146=ORIENTED_EDGE('',*,*,#192,.F.);
+#147=ORIENTED_EDGE('',*,*,#183,.F.);
+#148=CARTESIAN_POINT('',(30.0,5.0,0.0));
+#149=DIRECTION('',(0.0,-1.0,0.0));
+#150=DIRECTION('',(0.0,0.0,-1.0));
+#151=ORIENTED_EDGE('',*,*,#191,.T.);
+#152=ORIENTED_EDGE('',*,*,#186,.F.);
+#153=ORIENTED_EDGE('',*,*,#193,.F.);
+#154=ORIENTED_EDGE('',*,*,#182,.F.);
+#155=CARTESIAN_POINT('',(35.0,0.0,0.0));
+#156=DIRECTION('',(-1.0,0.0,0.0));
+#157=DIRECTION('',(0.0,0.0,1.0));
+#158=ORIENTED_EDGE('',*,*,#194,.F.);
+#159=ORIENTED_EDGE('',*,*,#195,.F.);
+#160=ORIENTED_EDGE('',*,*,#196,.F.);
+#161=ORIENTED_EDGE('',*,*,#197,.F.);
+#162=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#163=DIRECTION('',(0.0,0.0,1.0));
+#164=DIRECTION('',(1.0,0.0,0.0));
+#165=ORIENTED_EDGE('',*,*,#194,.T.);
+#166=ORIENTED_EDGE('',*,*,#198,.F.);
+#167=ORIENTED_EDGE('',*,*,#196,.T.);
+#168=ORIENTED_EDGE('',*,*,#199,.F.);
+#169=CARTESIAN_POINT('',(0.0,0.0,0.0));
+#170=DIRECTION('',(0.0,0.0,1.0));
+#171=DIRECTION('',(1.0,0.0,0.0));
+#172=ORIENTED_EDGE('',*,*,#199,.T.);
+#173=ORIENTED_EDGE('',*,*,#195,.T.);
+#174=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#175=DIRECTION('',(0.0,0.0,-1.0));
+#176=DIRECTION('',(-1.0,0.0,0.0));
+#177=ORIENTED_EDGE('',*,*,#197,.T.);
+#178=ORIENTED_EDGE('',*,*,#198,.T.);
+#179=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#180=DIRECTION('',(0.0,0.0,1.0));
+#181=DIRECTION('',(1.0,0.0,0.0));
+#182=EDGE_CURVE('',#200,#201,#202,.T.);
+#183=EDGE_CURVE('',#201,#203,#204,.T.);
+#184=EDGE_CURVE('',#203,#205,#206,.T.);
+#185=EDGE_CURVE('',#205,#200,#207,.T.);
+#186=EDGE_CURVE('',#208,#209,#210,.T.);
+#187=EDGE_CURVE('',#209,#211,#212,.T.);
+#188=EDGE_CURVE('',#211,#213,#214,.T.);
+#189=EDGE_CURVE('',#213,#208,#215,.T.);
+#190=EDGE_CURVE('',#205,#211,#216,.T.);
+#191=EDGE_CURVE('',#200,#209,#217,.T.);
+#192=EDGE_CURVE('',#203,#213,#218,.T.);
+#193=EDGE_CURVE('',#201,#208,#219,.T.);
+#194=EDGE_CURVE('',#220,#221,#222,.T.);
+#195=EDGE_CURVE('',#223,#220,#224,.T.);
+#196=EDGE_CURVE('',#225,#223,#226,.T.);
+#197=EDGE_CURVE('',#221,#225,#227,.T.);
+#198=EDGE_CURVE('',#225,#221,#228,.T.);
+#199=EDGE_CURVE('',#220,#223,#229,.T.);
+#200=VERTEX_POINT('',#230);
+#201=VERTEX_POINT('',#231);
+#202=LINE('',#232,#233);
+#203=VERTEX_POINT('',#234);
+#204=LINE('',#235,#236);
+#205=VERTEX_POINT('',#237);
+#206=LINE('',#238,#239);
+#207=LINE('',#240,#241);
+#208=VERTEX_POINT('',#242);
+#209=VERTEX_POINT('',#243);
+#210=LINE('',#244,#245);
+#211=VERTEX_POINT('',#246);
+#212=LINE('',#247,#248);
+#213=VERTEX_POINT('',#249);
+#214=LINE('',#250,#251);
+#215=LINE('',#252,#253);
+#216=LINE('',#254,#255);
+#217=LINE('',#256,#257);
+#218=LINE('',#258,#259);
+#219=LINE('',#260,#261);
+#220=VERTEX_POINT('',#262);
+#221=VERTEX_POINT('',#263);
+#222=LINE('',#264,#265);
+#223=VERTEX_POINT('',#266);
+#224=CIRCLE('',#267,5.0);
+#225=VERTEX_POINT('',#268);
+#226=LINE('',#269,#270);
+#227=CIRCLE('',#271,5.0);
+#228=CIRCLE('',#272,5.0);
+#229=CIRCLE('',#273,5.0);
+#230=CARTESIAN_POINT('',(35.0,-5.0,5.0));
+#231=CARTESIAN_POINT('',(35.0,5.0,5.0));
+#232=CARTESIAN_POINT('',(35.0,0.0,5.0));
+#233=VECTOR('',#274,1.0);
+#234=CARTESIAN_POINT('',(25.0,5.0,5.0));
+#235=CARTESIAN_POINT('',(30.0,5.0,5.0));
+#236=VECTOR('',#275,1.0);
+#237=CARTESIAN_POINT('',(25.0,-5.0,5.0));
+#238=CARTESIAN_POINT('',(25.0,0.0,5.0));
+#239=VECTOR('',#276,1.0);
+#240=CARTESIAN_POINT('',(30.0,-5.0,5.0));
+#241=VECTOR('',#277,1.0);
+#242=CARTESIAN_POINT('',(35.0,5.0,-5.0));
+#243=CARTESIAN_POINT('',(35.0,-5.0,-5.0));
+#244=CARTESIAN_POINT('',(35.0,0.0,-5.0));
+#245=VECTOR('',#278,1.0);
+#246=CARTESIAN_POINT('',(25.0,-5.0,-5.0));
+#247=CARTESIAN_POINT('',(30.0,-5.0,-5.0));
+#248=VECTOR('',#279,1.0);
+#249=CARTESIAN_POINT('',(25.0,5.0,-5.0));
+#250=CARTESIAN_POINT('',(25.0,0.0,-5.0));
+#251=VECTOR('',#280,1.0);
+#252=CARTESIAN_POINT('',(30.0,5.0,-5.0));
+#253=VECTOR('',#281,1.0);
+#254=CARTESIAN_POINT('',(25.0,-5.0,0.0));
+#255=VECTOR('',#282,1.0);
+#256=CARTESIAN_POINT('',(35.0,-5.0,0.0));
+#257=VECTOR('',#283,1.0);
+#258=CARTESIAN_POINT('',(25.0,5.0,0.0));
+#259=VECTOR('',#284,1.0);
+#260=CARTESIAN_POINT('',(35.0,5.0,0.0));
+#261=VECTOR('',#285,1.0);
+#262=CARTESIAN_POINT('',(5.0,0.0,-5.0));
+#263=CARTESIAN_POINT('',(5.0,0.0,5.0));
+#264=CARTESIAN_POINT('',(5.0,-6.12303176911189E-16,0.0));
+#265=VECTOR('',#286,1.0);
+#266=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,-5.0));
+#267=AXIS2_PLACEMENT_3D('',#287,#288,#289);
+#268=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,5.0));
+#269=CARTESIAN_POINT('',(-5.0,6.12303176911189E-16,0.0));
+#270=VECTOR('',#290,1.0);
+#271=AXIS2_PLACEMENT_3D('',#291,#292,#293);
+#272=AXIS2_PLACEMENT_3D('',#294,#295,#296);
+#273=AXIS2_PLACEMENT_3D('',#297,#298,#299);
+#274=DIRECTION('',(0.0,1.0,0.0));
+#275=DIRECTION('',(-1.0,0.0,0.0));
+#276=DIRECTION('',(0.0,-1.0,0.0));
+#277=DIRECTION('',(1.0,0.0,0.0));
+#278=DIRECTION('',(0.0,-1.0,0.0));
+#279=DIRECTION('',(-1.0,0.0,0.0));
+#280=DIRECTION('',(0.0,1.0,0.0));
+#281=DIRECTION('',(1.0,0.0,0.0));
+#282=DIRECTION('',(0.0,0.0,-1.0));
+#283=DIRECTION('',(0.0,0.0,-1.0));
+#284=DIRECTION('',(0.0,0.0,-1.0));
+#285=DIRECTION('',(0.0,0.0,-1.0));
+#286=DIRECTION('',(0.0,0.0,1.0));
+#287=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#288=DIRECTION('',(0.0,0.0,-1.0));
+#289=DIRECTION('',(1.0,0.0,0.0));
+#290=DIRECTION('',(-0.0,-0.0,-1.0));
+#291=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#292=DIRECTION('',(0.0,0.0,1.0));
+#293=DIRECTION('',(1.0,0.0,0.0));
+#294=CARTESIAN_POINT('',(0.0,0.0,5.0));
+#295=DIRECTION('',(0.0,0.0,1.0));
+#296=DIRECTION('',(1.0,0.0,0.0));
+#297=CARTESIAN_POINT('',(0.0,0.0,-5.0));
+#298=DIRECTION('',(0.0,0.0,-1.0));
+#299=DIRECTION('',(1.0,0.0,0.0));
+ENDSEC;
+END-ISO-10303-21;
diff --git a/test/io/Makefile.am b/test/io/Makefile.am
index 6cf835a..61f932a 100644
--- a/test/io/Makefile.am
+++ b/test/io/Makefile.am
@@ -25,7 +25,8 @@ else
endif
if HAVE_CGM
- CGM_TEST = read_cgm_load_test read_cgm_basic_test
+ CGM_TEST = read_cgm_load_test read_cgm_basic_test read_cgm_senses_test read_cgm_connectivity_test \
+ read_cgm_group_test
else
CGM_TEST =
endif
@@ -73,7 +74,13 @@ ccmio_test_SOURCES = $(srcdir)/../TestUtil.hpp ccmio_test.cpp
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)
+read_cgm_basic_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_senses_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_senses_test.cpp
+read_cgm_senses_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_connectivity_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_connectivity_test.cpp
+read_cgm_connectivity_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(CXXFLAGS)
+read_cgm_group_test_SOURCES = $(srcdir)/../TestUtil.hpp read_cgm_group_test.cpp
+read_cgm_group_test_CXXFLAGS = $(CGM_CPPFLAGS) $(CGM_LIBS) $(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
index 7a2d07d..3a68d04 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -8,6 +8,8 @@
#include "Internals.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
using namespace moab;
@@ -31,40 +33,295 @@ static const char input_cube[] = "cube.sat";
#endif
#endif
-void read_cube_test()
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void read_cube_verts_test();
+void read_cube_curves_test();
+void read_cube_tris_test();
+void read_cube_surfs_test();
+void read_cube_vols_test();
+void read_cube_vertex_pos_test();
+//void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
{
- Core mb;
+ int result = 0;
+
+ result += RUN_TEST(read_cube_verts_test);
+ result += RUN_TEST(read_cube_curves_test);
+ result += RUN_TEST(read_cube_tris_test);
+ result += RUN_TEST(read_cube_surfs_test);
+ result += RUN_TEST(read_cube_vols_test);
+ result += RUN_TEST(read_cube_vertex_pos_test);
- ErrorCode rval = mb.load_file(input_cube); CHECK_ERR(rval);
+ return result;
+}
- Tag geom_tag;
- rval = mb.tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
- geom_tag, MB_TAG_SPARSE|MB_TAG_CREAT);
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
CHECK_ERR(rval);
+}
+
+void read_cube_verts_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ int number_of_vertices;
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_vertices );
+ CHECK_ERR(rval);
+ //For a cube there should be exactly 8 vertices
+ CHECK_EQUAL( 8, number_of_vertices );
+}
+
+
+void read_cube_tris_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
int number_of_tris;
- rval = mb.get_number_entities_by_type(0, MBTRI , 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);
+ //For a cube, there should be exactly 2 triangles per face
+ CHECK_EQUAL( 12, number_of_tris );
+}
- int number_of_vertices;
- rval = mb.get_number_entities_by_type(0, MBVERTEX, number_of_vertices);
+void read_cube_curves_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+ //Get the geometry tag handle from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
CHECK_ERR(rval);
+ //Get the curves from the mesh
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ //For a cube, there should be exactly 12 curves loaded from the file
+ CHECK_EQUAL( 12, number_of_curves );
+}
- if( number_of_tris != 12) rval = MB_FAILURE; CHECK_ERR(rval);
-
- if( number_of_vertices !=8) rval = MB_FAILURE; CHECK_ERR(rval);
+void read_cube_surfs_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the number of surface from the mesh geometry data
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+ //For a cube, there should be exactly 6 surfaces
+ CHECK_EQUAL( 6, number_of_surfs );
}
+
+void read_cube_vols_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
-int main(int /* argc */, char** /* argv */)
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the number of volumes from the mesh geometry data
+ int dim = 3;
+ void *val[] = {&dim};
+ int number_of_vols;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_vols );
+ CHECK_ERR(rval);
+ CHECK_EQUAL( 1, number_of_vols );
+}
+
+void read_cube_vertex_pos_test()
{
- int result = 0;
- result += RUN_TEST( read_cube_test );
-
- return result;
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //First check that the correct number of vertices are present
+ int number_of_verts;
+ rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
+ CHECK_ERR(rval);
+
+ CHECK_EQUAL( 8, number_of_verts );
+
+ //Retrieve all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR( rval );
+
+ //Get the vertex coordinates
+ double x[verts.size()];
+ double y[verts.size()];
+ double z[verts.size()];
+ rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
+ CHECK_ERR(rval);
+
+ //Check against known locations of the vertices
+
+ std::vector<double> x_ref;
+ std::vector<double> y_ref;
+ std::vector<double> z_ref;
+
+ // Vertex 1
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 2
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 3
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 4
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( 5 );
+
+ // Vertex 5
+ x_ref.push_back( 5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 6
+ x_ref.push_back( 5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 7
+ x_ref.push_back( -5 );
+ y_ref.push_back( -5 );
+ z_ref.push_back( -5 );
+
+ // Vertex 8
+ x_ref.push_back( -5 );
+ y_ref.push_back( 5 );
+ z_ref.push_back( -5 );
+
+ std::cout << verts.size() << std::endl;
+ std::cout << x_ref.size() << std::endl;
+
+ for(unsigned int i=0; i<verts.size(); i++)
+ {
+ for(unsigned int j=0; j<x_ref.size(); j++)
+ {
+ if( x[i]==x_ref[j] && y[i]==y_ref[j] && z[i]==z_ref[j] )
+ {
+ x_ref.erase( x_ref.begin()+j );
+ y_ref.erase( y_ref.begin()+j );
+ z_ref.erase( z_ref.begin()+j );
+ }
+ }
+ }
+
+ //After looping through each vertex loaded from the mesh
+ //there should be no entities left in the reference vector
+ int leftovers = x_ref.size();
+ CHECK_EQUAL( 0, leftovers );
+
+}
+
+//Superfluous test for ReadCGM, but perhaps better
+//than the test in place for moab::delete_geometry()
+
+
+/*
+void delete_mesh_test()
+{
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ ErrorCode rval;
+
+ //Get geometry tag for pulling curve data from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ Range geom_sets[4];
+
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, geom_sets[dim] );
+ CHECK_ERR(rval);
+
+ if( geom_sets[dim].size() == 0 ) std::cout << "Warning: No geom sets to begin with" << std::endl;
+
+ }
+
+ mb->delete_mesh();
+
+ Range geom_sets_after[4];
+ for(unsigned dim=0; dim<4; dim++)
+ {
+ void *val_after[] = {&dim};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val_after, 1, geom_sets_after[dim] );
+ CHECK_ERR(rval);
+
+ if( 0 != geom_sets_after[dim].size() ) rval = MB_FAILURE;
+
+ CHECK_ERR(rval);
+ }
+
}
+
+*/
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
new file mode 100644
index 0000000..7c8d8a9
--- /dev/null
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -0,0 +1,244 @@
+
+#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"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+#include "moab/MeshTopoUtil.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
+
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// List of tests in this file
+void cube_verts_connectivity_test();
+void cube_tris_connectivity_test();
+void cube_tri_curve_coincidence_test();
+void cube_edge_adjacencies_test();
+void cube_tri_vertex_test();
+
+//Other functions
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves );
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST(cube_verts_connectivity_test);
+ result += RUN_TEST(cube_tris_connectivity_test);
+ result += RUN_TEST(cube_tri_curve_coincidence_test);
+ result += RUN_TEST(cube_tri_vertex_test);
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+void cube_verts_connectivity_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all vertex handles from the mesh
+ Range verts;
+ rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
+ CHECK_ERR(rval);
+
+ //Check that each vertex connects to less than 4 triangles and no more than 6
+ for(Range::const_iterator i = verts.begin(); i!=verts.end(); i++)
+ {
+ std::vector<EntityHandle> adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
+ CHECK_ERR(rval);
+
+ int adj_size = adj_tris.size();
+ CHECK( adj_size >= 4 && adj_size <= 6 );
+ }
+
+}
+
+void cube_tris_connectivity_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+
+ for(Range::const_iterator i = tris.begin()+1; i!=tris.end(); i++)
+ {
+ Range adj_tris;
+ moab::MeshTopoUtil mu(mb);
+ //Use Triangle edges to get all adjacent triangles
+ rval = mu.get_bridge_adjacencies( *i, 1, 2, adj_tris );
+ CHECK_ERR(rval);
+ int number_of_adj_tris=adj_tris.size();
+ CHECK_EQUAL( 3, number_of_adj_tris );
+
+ //Check that the entities we found from bridge_adjacencies
+ //are triangles
+ Range adj_tri_test = adj_tris.subset_by_type( MBTRI );
+ int number_tris_in_adj_tris = adj_tri_test.size();
+ CHECK_EQUAL( number_of_adj_tris, number_tris_in_adj_tris );
+
+ }
+
+}
+
+void cube_tri_curve_coincidence_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get curves from the mesh
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
+ CHECK_ERR(rval);
+ curves.print();
+
+ //Get triangles from the mesh
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get the any curve edges that are a part of the triangle
+ Range tri_edges;
+ rval = mb->get_adjacencies( &(*i), 1, 1, false, tri_edges );
+ CHECK_ERR(rval);
+ //Check that we've retrieved two edges from get_adjacencies
+ //For a this file (cube), each triangle should have two curve
+ //edges
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL( 2, num_of_tri_edges );
+ rval = match_tri_edges_w_curve( mb, tri_edges, curves );
+ CHECK_ERR(rval);
+ }
+}
+
+ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
+{
+ ErrorCode rval;
+ int match_counter=0;
+ for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
+ {
+ for(Range::const_iterator j=curves.begin(); j!=curves.end(); j++)
+ {
+ // If the edge handle matches a curve handle, increment the number
+ // matches
+ if( *i == *j ) match_counter++;
+ }
+ }
+ //Make sure that each edge returned from triangle edges
+ //has been matched to a curve
+ int num_of_tri_edges = tri_edges.size();
+ CHECK_EQUAL( num_of_tri_edges, match_counter );
+ return MB_SUCCESS;
+}
+
+void cube_edge_adjacencies_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get the curves
+ Range curves;
+ rval = mb->get_entities_by_type( 0, MBEDGE, curves );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=curves.begin(); i!=curves.end(); i++)
+ {
+ //Get triangle adjacent to each edge
+ Range adj_tris;
+ rval = mb->get_adjacencies( &(*i), 1, 2, false, adj_tris );
+ CHECK_ERR(rval);
+
+ int num_adj_tris = adj_tris.size();
+ //Ensure that no edge is adjacent to more than two triangles
+ CHECK( num_adj_tris <= 2 );
+ }
+
+}
+
+void cube_tri_vertex_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cube );
+
+ //Get all triangles
+ Range tris;
+ rval = mb->get_entities_by_type( 0, MBTRI, tris );
+ CHECK_ERR(rval);
+
+ for(Range::const_iterator i=tris.begin(); i!=tris.end(); i++)
+ {
+ //Get all triangle vertices
+ Range verts;
+ rval = mb->get_connectivity( &(*i), 1, verts );
+ CHECK_ERR(rval);
+ //Make sure that each vertex making up
+ //the triangle is different
+ int number_of_verts = verts.size();
+ CHECK( 3 == number_of_verts );
+ CHECK( verts[0]!=verts[1] );
+ CHECK( verts[1]!=verts[2] );
+ CHECK( verts[2]!=verts[0] );
+ }
+}
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
new file mode 100644
index 0000000..4bbc95a
--- /dev/null
+++ b/test/io/read_cgm_group_test.cpp
@@ -0,0 +1,203 @@
+
+#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"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.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_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+#else
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+//Function for getting entity ids
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+//Function for checking retrieved group data
+void check_group_data( std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids );
+
+//Function for loading all reference data
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids);
+
+// List of tests in this file
+void read_cylcube_groups_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result+=RUN_TEST(read_cylcube_groups_test);
+
+ return result;
+}
+
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+void read_cylcube_groups_test()
+{
+
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube);
+
+ //Get (or create) the name and category tags
+ Tag name_tag, category_tag;
+
+ rval = mb->tag_get_handle( NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
+ name_tag, moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ rval = mb->tag_get_handle( CATEGORY_TAG_NAME, CATEGORY_TAG_SIZE,
+ MB_TYPE_OPAQUE, category_tag,
+ moab::MB_TAG_SPARSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ //Get the group entity handles
+ Range group_sets;
+ char query[CATEGORY_TAG_SIZE] = "Group\0";
+ //Has to be this way because of the way tags are created
+ void* val[] = {&query};
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &category_tag, val, 1, group_sets);
+ CHECK_ERR(rval);
+ //Get group names and IDs
+ std::vector<int> g_ids;
+ std::vector<std::string> g_names;
+ std::vector<int> g_ent_ids;
+ int j = 0;
+ for(Range::iterator i=group_sets.begin(); i!=group_sets.end(); i++)
+ {
+ int group_id = geom_id_by_handle( mb, *i );
+ g_ids.push_back(group_id);
+ //Get the group name
+ char group_name[NAME_TAG_SIZE+1];
+ rval = mb->tag_get_data( name_tag, &(*i), 1, &group_name);
+ CHECK_ERR(rval);
+ //Store group name
+ std::string temp(group_name);
+ g_names.push_back(temp);
+ //Get all entities in the group
+ Range group_ents;
+ rval = mb->get_entities_by_type( *i, MBENTITYSET, group_ents, false );
+ CHECK_ERR(rval);
+ if( group_ents.size() != 1) CHECK(false);
+ int grp_ent_id = geom_id_by_handle( mb, group_ents[0] );
+ g_ent_ids.push_back(grp_ent_id);
+
+ }
+ check_group_data( g_ids, g_names, g_ent_ids );
+}
+
+
+void check_group_data(std::vector<int> group_ids, std::vector<std::string> group_names, std::vector<int> group_ent_ids )
+{
+
+ // Step files do not contain group data, MOAB shouldn't return errors when trying to access
+ // this data but there shouldn't be any found.
+#ifdef HAVE_OCC_STEP
+ int num_g_ids = group_ids.size();
+ int num_g_names = group_names.size();
+
+ CHECK_EQUAL( 0, num_g_ids );
+ CHECK_EQUAL( 0, num_g_names );
+#else
+
+
+ //Initialize reference data
+ std::vector<int> group_ref_ids;
+ std::vector<std::string> group_ref_names;
+ std::vector<int> group_ref_ent_ids;
+ load_group_references( group_ref_ids, group_ref_names, group_ref_ent_ids );
+
+ // check that the correct number of entities were found
+ CHECK_EQUAL ( group_ref_ids.size(), group_ids.size() );
+ CHECK_EQUAL ( group_ref_names.size(), group_names.size() );
+ CHECK_EQUAL ( group_ref_ent_ids.size(), group_ent_ids.size() );
+
+ //now make sure that each group has a matching group
+ for(unsigned int i=0 ; i<group_ids.size(); i++)
+ {
+ for(unsigned int j=0; j<group_ref_ids.size(); j++)
+ {
+ if( group_ids[i]==group_ref_ids[j]
+ && group_names[i] == group_ref_names[j]
+ && group_ent_ids[i]==group_ref_ent_ids[j])
+ {
+ group_ref_ids.erase(group_ref_ids.begin()+j);
+ group_ref_names.erase(group_ref_names.begin()+j);
+ group_ref_ent_ids.erase(group_ref_ent_ids.begin()+j);
+ continue;
+ }
+ }
+ }
+
+ // Check sizes of reference vectors after matching
+ // (all should be zero)
+ int leftovers = group_ref_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_names.size();
+ CHECK_EQUAL( 0, leftovers );
+ leftovers = group_ref_ent_ids.size();
+ CHECK_EQUAL( 0, leftovers );
+#endif
+}
+
+void load_group_references( std::vector<int>& ids, std::vector<std::string>& names, std::vector<int>& ent_ids )
+{
+ //First set of group info
+ names.push_back("Group 3"); ids.push_back(3); ent_ids.push_back(2);
+
+ //Second set of group info
+ names.push_back("Group 2"); ids.push_back(2); ent_ids.push_back(1);
+}
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
diff --git a/test/io/read_cgm_load_test.cpp b/test/io/read_cgm_load_test.cpp
index 5377220..6791f50 100644
--- a/test/io/read_cgm_load_test.cpp
+++ b/test/io/read_cgm_load_test.cpp
@@ -33,16 +33,17 @@ void read_multiple_test()
{
Core mb;
- ErrorCode rval = mb.load_file(input_file);
+ ErrorCode rval = mb.load_file( input_file );
CHECK_ERR(rval);
// second load
- rval = mb.load_file(input_file);
+ 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_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
new file mode 100644
index 0000000..2dda375
--- /dev/null
+++ b/test/io/read_cgm_senses_test.cpp
@@ -0,0 +1,576 @@
+
+#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"
+#include "moab/GeomTopoTool.hpp"
+#include "InitCGMA.hpp"
+#include "GeometryQueryTool.hpp"
+
+#define SENSE_FORWARD 1
+#define SENSE_REVERSE -1
+#define SENSE_UNKNOWN 0
+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_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.stp";
+#else
+static const char input_cylcube[] = STRINGIFY(MESHDIR) "/io/cylcube.sat";
+#endif
+#else
+#ifdef HAVE_OCC_STEP
+static const char input_cylcube[] = "cylcube.stp";
+#else
+static const char input_cylcube[] = "cylcube.sat";
+#endif
+#endif
+
+
+// Function used to load the test file
+void read_file( Interface* moab, const char* input_file );
+
+// Functions containing known sense data
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out );
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out );
+
+// Functions used to compare sense information found in
+// the model to reference information
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses );
+
+//Function used to get id's from entity handles
+int geom_id_by_handle( Interface* moab, const EntityHandle set );
+
+// List of tests in this file
+void read_cylcube_curve_senses_test();
+void read_cylcube_surf_senses_test();
+void delete_mesh_test();
+
+
+int main(int /* argc */, char** /* argv */)
+{
+ int result = 0;
+
+ result += RUN_TEST(read_cylcube_curve_senses_test);
+ result += RUN_TEST(read_cylcube_surf_senses_test);
+
+ return result;
+}
+
+
+void read_file( Interface* moab, const char* input_file )
+{
+ InitCGMA::initialize_cgma();
+ GeometryQueryTool::instance()->delete_geometry();
+
+ ErrorCode rval = moab->load_file( input_file );
+ CHECK_ERR(rval);
+}
+
+void read_cylcube_curve_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube );
+
+ //Get all curve handles
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1,
+ MB_TYPE_INTEGER, geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of curves exist
+ int dim = 1;
+ void *val[] = {&dim};
+ int number_of_curves;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_curves );
+ CHECK_ERR(rval);
+ //Step format adds a surface on the barrel of the cylinder.
+ //This created 4 extra surfaces in comparison to the .sat format from Cubit.
+ //(New surface breaks the barrel of the cylinder into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 18, number_of_curves );
+#else
+ CHECK_EQUAL( 14, number_of_curves );
+#endif
+
+ //Get curve handles
+ Range curves;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, curves );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get curve data
+ moab::GeomTopoTool gt( mb, false );
+ // Initialize vectors for sense checking
+ std::vector<EntityHandle> surfs;
+ std::vector<int> senses;
+ std::vector<int> known_surf_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < curves.size() ; i++)
+ {
+
+ //Clean data from previous curve
+ surfs.clear();
+ senses.clear();
+ //Get sense info for the current curve
+ gt.get_senses( curves[i], surfs, senses );
+ CHECK_ERR(rval);
+
+ //Clear reference data from previous curve
+ known_surf_ids.clear();
+ known_senses.clear();
+ //Load known curve-sense ID data
+#ifdef HAVE_OCC_STEP
+ rval = load_stp_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
+#else
+ rval = load_sat_curve_sense_data( mb, curves[i], known_surf_ids, known_senses );
+ CHECK_ERR(rval);
+#endif
+
+ //Check that each surf and sense has a match in the references
+ check_sense_data( mb, surfs, senses, known_surf_ids, known_senses);
+ }
+}
+
+
+int geom_id_by_handle( Interface* moab, const EntityHandle set )
+{
+
+ ErrorCode rval;
+ //Get the id_tag handle
+ Tag id_tag;
+ rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
+ assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ //Load the ID for the EntHandle given to the function
+ int id;
+ rval = moab->tag_get_data( id_tag, &set, 1, &id );
+ CHECK_ERR(rval);
+ return id;
+ }
+
+void check_sense_data( Interface* moab, std::vector<EntityHandle> wrt_ents, std::vector<int> senses,
+ std::vector<int> known_wrt_ids, std::vector<int> known_senses )
+{
+
+ //Get ID's of the wrt entities
+ std::vector<int> wrt_ent_ids;
+ for(unsigned int i=0 ; i<wrt_ents.size() ; i++)
+ {
+ wrt_ent_ids.push_back( geom_id_by_handle( moab, wrt_ents[i] ) );
+ }
+
+ for(unsigned int i=0; i< wrt_ent_ids.size() ; i++)
+ {
+ for(unsigned int j=0; j< known_wrt_ids.size(); j++)
+ {
+ if( wrt_ent_ids[i] == known_wrt_ids [j] )
+ {
+ // Make sure the senses of the matching wrt entities
+ // are correct
+ CHECK_EQUAL( senses[i], known_senses[j] );
+ //Once a wrt entity is matched with a known entity,
+ // remove it from the list
+ wrt_ent_ids.erase( wrt_ent_ids.begin()+i );
+ senses.erase( senses.begin()+i );
+ }
+ }
+ }
+
+ // After both loops are complete, known_wrt_ents should be empty
+ int leftovers = wrt_ent_ids.size();
+ CHECK_EQUAL( leftovers, 0 );
+
+}
+
+//Loads two vectors with reference curve and curve_sense data
+ErrorCode load_sat_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
+
+ int curve_id = geom_id_by_handle( moab, curve );
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+//Loads two vectors with reference curve and curve_sense data
+ErrorCode load_stp_curve_sense_data( Interface* moab, EntityHandle curve, std::vector<int>& surf_ids_out, std::vector<int>& senses_out )
+{
+
+ int curve_id = geom_id_by_handle( moab, curve );
+ switch(curve_id)
+ {
+ case 1:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 2:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 3:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 4:
+ surf_ids_out.push_back(1); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 5:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 6:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(3);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 7:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 8:
+ surf_ids_out.push_back(2); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 9:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(4);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 10:
+ surf_ids_out.push_back(3); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 11:
+ surf_ids_out.push_back(4); surf_ids_out.push_back(5);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 12:
+ surf_ids_out.push_back(5); surf_ids_out.push_back(6);
+ senses_out.push_back(SENSE_FORWARD); senses_out.push_back(SENSE_REVERSE);
+ break;
+
+ case 13:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 14:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 15:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(8);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 16:
+ surf_ids_out.push_back(7); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 17:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(10);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ case 18:
+ surf_ids_out.push_back(8); surf_ids_out.push_back(9);
+ senses_out.push_back(SENSE_REVERSE); senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+///SURFACE SENSE CHECKING
+void read_cylcube_surf_senses_test()
+{
+ ErrorCode rval;
+ //Open the test file
+ Core moab;
+ Interface* mb = &moab;
+ read_file( mb, input_cylcube );
+
+ //Get geometry tag for gathering surface information from the mesh
+ Tag geom_tag;
+ rval = mb->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER,
+ geom_tag, moab::MB_TAG_DENSE|moab::MB_TAG_CREAT );
+ CHECK_ERR(rval);
+
+ // Check that the proper number of surfaces exist
+ int dim = 2;
+ void *val[] = {&dim};
+ int number_of_surfs;
+ rval = mb->get_number_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, number_of_surfs );
+ CHECK_ERR(rval);
+ //Step format adds a surface on barrel of the cylinder.
+ // (Breaks it into two half-pipes)
+#ifdef HAVE_OCC_STEP
+ CHECK_EQUAL( 10, number_of_surfs );
+#else
+ CHECK_EQUAL( 9, number_of_surfs );
+#endif
+ // Get surface handles
+ Range surfs;
+ rval = mb->get_entities_by_type_and_tag( 0, MBENTITYSET, &geom_tag,
+ val, 1, surfs );
+ CHECK_ERR(rval);
+
+ // Establish GeomTopoTool instance needed to get surf data
+ moab::GeomTopoTool gt( mb, false );
+ std::vector<EntityHandle> vols;
+ std::vector<int> senses;
+ std::vector<int> known_vol_ids;
+ std::vector<int> known_senses;
+
+for(unsigned int i = 0; i < surfs.size(); i++)
+ {
+ //Clean data from previous surface
+ vols.clear();
+ senses.clear();
+ // Get sense information for the current
+ // surface from the mesh
+ gt.get_senses( surfs[i], vols, senses );
+ CHECK_ERR(rval);
+ //Clear previous reverence data
+ known_vol_ids.clear();
+ known_senses.clear();
+ // Load known surface-volume data
+ // for this surface and check that it's correct
+#ifdef HAVE_OCC_STEP
+ rval = load_stp_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
+#else
+ rval = load_sat_surf_sense_data( mb, surfs[i], known_vol_ids, known_senses );
+ CHECK_ERR(rval);
+#endif
+ // Check sense information from the loaded mesh against
+ // reference sense information
+ check_sense_data( mb, vols, senses, known_vol_ids, known_senses );
+
+ }
+
+}
+
+//Loads reference surface to volume sense data into the reference vectors
+ErrorCode load_sat_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf );
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ return MB_FAILURE;
+
+ }
+ return MB_SUCCESS;
+}
+
+//Loads reference surface to volume sense data into the reference vectors
+ErrorCode load_stp_surf_sense_data( Interface* moab, EntityHandle surf, std::vector<int>& vol_ids_out, std::vector<int>& senses_out ){
+
+ int surf_id = geom_id_by_handle( moab, surf );
+ switch(surf_id)
+ {
+ case 1:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 2:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 3:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 4:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 5:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 6:
+ vol_ids_out.push_back(1);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 7:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 8:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 9:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+
+ case 10:
+ vol_ids_out.push_back(2);
+ senses_out.push_back(SENSE_FORWARD);
+ break;
+ default:
+ std::cout << "Failure to find surface sense reference data. Returning failure..." << std::endl;
+ return MB_FAILURE;
+ }
+ return MB_SUCCESS;
+}
+
https://bitbucket.org/fathomteam/moab/commits/705e69c616a7/
Changeset: 705e69c616a7
Branch: None
User: pshriwise
Date: 2014-02-18 00:14:36
Summary: Correction to the error check in geom_id_by_handle in ReadCGM senses test and group tests.
Affected #: 2 files
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 4bbc95a..b1b70ec 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -194,7 +194,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
//Get the id_tag handle
Tag id_tag;
rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
- assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ CHECK_ERR(rval);
//Load the ID for the EntHandle given to the function
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 2dda375..37ca244 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -160,7 +160,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
//Get the id_tag handle
Tag id_tag;
rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
- assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ CHECK_ERR(rval);
//Load the ID for the EntHandle given to the function
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
https://bitbucket.org/fathomteam/moab/commits/88028006dd42/
Changeset: 88028006dd42
Branch: None
User: pshriwise
Date: 2014-02-18 16:58:12
Summary: Altered init of vectors for testing vertex positions in the readCGM basic tests.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 3a68d04..5b798f6 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -199,10 +199,12 @@ void read_cube_vertex_pos_test()
rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
CHECK_ERR( rval );
+ number_of_verts = verts.size();
+ CHECK_EQUAL( 8, number_of_verts );
//Get the vertex coordinates
- double x[verts.size()];
- double y[verts.size()];
- double z[verts.size()];
+ double x[8];
+ double y[8];
+ double z[8];
rval = mb-> get_coords( verts, &x[0], &y[0], &z[0] );
CHECK_ERR(rval);
https://bitbucket.org/fathomteam/moab/commits/c75b549704b9/
Changeset: c75b549704b9
Branch: None
User: pshriwise
Date: 2014-02-18 17:00:29
Summary: Merge branch 'master' of bitbucket.org:pshriwise/moab
Affected #: 2 files
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index 4bbc95a..b1b70ec 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -194,7 +194,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
//Get the id_tag handle
Tag id_tag;
rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
- assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ CHECK_ERR(rval);
//Load the ID for the EntHandle given to the function
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
diff --git a/test/io/read_cgm_senses_test.cpp b/test/io/read_cgm_senses_test.cpp
index 2dda375..37ca244 100644
--- a/test/io/read_cgm_senses_test.cpp
+++ b/test/io/read_cgm_senses_test.cpp
@@ -160,7 +160,7 @@ int geom_id_by_handle( Interface* moab, const EntityHandle set )
//Get the id_tag handle
Tag id_tag;
rval = moab->tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, id_tag, moab::MB_TAG_DENSE );
- assert( MB_SUCCESS==result || MB_ALREADY_ALLOCATED==result );
+ CHECK_ERR(rval);
//Load the ID for the EntHandle given to the function
int id;
rval = moab->tag_get_data( id_tag, &set, 1, &id );
https://bitbucket.org/fathomteam/moab/commits/2149df91047b/
Changeset: 2149df91047b
Branch: None
User: pshriwise
Date: 2014-02-18 17:54:15
Summary: Removed ErrorCode return from match_tri_edges_with_curve in basic ReadCGM tests.
Return was removed because it really doesn't apply as no MOAB interface function is used and the CHECK_EQUAL function should return the necessary error if the test fails.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index 7c8d8a9..e2738a5 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -45,7 +45,7 @@ void cube_edge_adjacencies_test();
void cube_tri_vertex_test();
//Other functions
-ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves );
+void match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves );
int main(int /* argc */, char** /* argv */)
{
@@ -162,14 +162,13 @@ void cube_tri_curve_coincidence_test()
//edges
int num_of_tri_edges = tri_edges.size();
CHECK_EQUAL( 2, num_of_tri_edges );
- rval = match_tri_edges_w_curve( mb, tri_edges, curves );
+ match_tri_edges_w_curve( mb, tri_edges, curves );
CHECK_ERR(rval);
}
}
-ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
+void match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
{
- ErrorCode rval;
int match_counter=0;
for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
{
@@ -184,7 +183,6 @@ ErrorCode match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curve
//has been matched to a curve
int num_of_tri_edges = tri_edges.size();
CHECK_EQUAL( num_of_tri_edges, match_counter );
- return MB_SUCCESS;
}
void cube_edge_adjacencies_test()
https://bitbucket.org/fathomteam/moab/commits/fbfe5ec879b1/
Changeset: fbfe5ec879b1
Branch: None
User: pshriwise
Date: 2014-02-18 18:01:07
Summary: Removed unused variable from ReadCGM groups test.
Affected #: 1 file
diff --git a/test/io/read_cgm_group_test.cpp b/test/io/read_cgm_group_test.cpp
index b1b70ec..925c2ce 100644
--- a/test/io/read_cgm_group_test.cpp
+++ b/test/io/read_cgm_group_test.cpp
@@ -101,7 +101,7 @@ void read_cylcube_groups_test()
std::vector<int> g_ids;
std::vector<std::string> g_names;
std::vector<int> g_ent_ids;
- int j = 0;
+
for(Range::iterator i=group_sets.begin(); i!=group_sets.end(); i++)
{
int group_id = geom_id_by_handle( mb, *i );
https://bitbucket.org/fathomteam/moab/commits/9b6abfa5e714/
Changeset: 9b6abfa5e714
Branch: None
User: pshriwise
Date: 2014-02-18 20:11:44
Summary: Removed a redundant test condition in the ReadCGM basic test.
Affected #: 1 file
diff --git a/test/io/read_cgm_basic_test.cpp b/test/io/read_cgm_basic_test.cpp
index 5b798f6..1029c52 100644
--- a/test/io/read_cgm_basic_test.cpp
+++ b/test/io/read_cgm_basic_test.cpp
@@ -187,19 +187,12 @@ void read_cube_vertex_pos_test()
Interface* mb = &moab;
read_file( mb, input_cube );
- //First check that the correct number of vertices are present
- int number_of_verts;
- rval = mb->get_number_entities_by_type( 0, MBVERTEX, number_of_verts );
- CHECK_ERR(rval);
-
- CHECK_EQUAL( 8, number_of_verts );
-
//Retrieve all vertex handles from the mesh
Range verts;
rval = mb->get_entities_by_type( 0, MBVERTEX, verts );
CHECK_ERR( rval );
- number_of_verts = verts.size();
+ int number_of_verts = verts.size();
CHECK_EQUAL( 8, number_of_verts );
//Get the vertex coordinates
double x[8];
https://bitbucket.org/fathomteam/moab/commits/d5fe5af8d3c1/
Changeset: d5fe5af8d3c1
Branch: None
User: pshriwise
Date: 2014-02-18 20:12:25
Summary: Removed the moab interface parameter from match_tri_edgs_with_curve function in ReadCGM connectivity tests.
Affected #: 1 file
diff --git a/test/io/read_cgm_connectivity_test.cpp b/test/io/read_cgm_connectivity_test.cpp
index e2738a5..168ea7b 100644
--- a/test/io/read_cgm_connectivity_test.cpp
+++ b/test/io/read_cgm_connectivity_test.cpp
@@ -45,7 +45,7 @@ void cube_edge_adjacencies_test();
void cube_tri_vertex_test();
//Other functions
-void match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves );
+void match_tri_edges_w_curve( Range tri_edges, Range curves );
int main(int /* argc */, char** /* argv */)
{
@@ -162,12 +162,12 @@ void cube_tri_curve_coincidence_test()
//edges
int num_of_tri_edges = tri_edges.size();
CHECK_EQUAL( 2, num_of_tri_edges );
- match_tri_edges_w_curve( mb, tri_edges, curves );
+ match_tri_edges_w_curve( tri_edges, curves );
CHECK_ERR(rval);
}
}
-void match_tri_edges_w_curve( Interface* moab, Range tri_edges, Range curves )
+void match_tri_edges_w_curve( Range tri_edges, Range curves )
{
int match_counter=0;
for(Range::const_iterator i=tri_edges.begin(); i!=tri_edges.end(); i++)
https://bitbucket.org/fathomteam/moab/commits/9f98cceae59f/
Changeset: 9f98cceae59f
Branch: None
User: pshriwise
Date: 2014-02-21 17:06:39
Summary: Merge branch 'master' of bitbucket.org:fathomteam/moab
Affected #: 6 files
diff --git a/examples/CrystalRouterExample.cpp b/examples/CrystalRouterExample.cpp
index 200f012..83a1e7c 100644
--- a/examples/CrystalRouterExample.cpp
+++ b/examples/CrystalRouterExample.cpp
@@ -18,12 +18,14 @@
*
* the example needs to be launched in parallel.
* Every proc will build a list of tuples, that will be send to a few procs;
+ * In general, we will send to num_comms tasks, and about num_tuples to each task
+ * We vary num_comms and num_tuples for processor
*
- * every proc will send 1 tuple, to proc rank + 1 and rank + rank*(size-1)+2 , with value
- * 10000 * send + 100* rank
+ * we will send long ints of the form
+ * 100000 * send + 1000* rank +j, where j is the index of tuple
*
- * at the receive, we verify we received
- * 10000 * rank + 100 * from
+ * after routing, we verify we received
+ * 100000 * rank + 1000 * from
*
* For some reportrank we also print the tuples.
*
@@ -35,13 +37,20 @@
/** @example CrystalRouterExample.cpp \n
* \brief generalized gather scatter using tuples \n
- * <b>To run</b>: mpiexec -np <n> CrystalRouterExample [reportrank] \n
+ * <b>To run</b>: mpiexec -np <n> CrystalRouterExample -r [reportrank] -t [num_tuples] -n [num_comms] \n
*
*/
//
#include "moab/ProcConfig.hpp"
#include "moab/TupleList.hpp"
+#include "moab/ProgOptions.hpp"
+#include <time.h>
#include <iostream>
+#include <sstream>
+
+const char BRIEF_DESC[] =
+ "Example of gather scatter with tuple lists \n";
+std::ostringstream LONG_DESC;
using namespace moab;
using namespace std;
@@ -50,56 +59,94 @@ int main(int argc, char **argv)
{
MPI_Init(&argc, &argv);
- int reportrank = 1;
- if (argc>1)
- reportrank = atoi(argv[1]);
ProcConfig pc(MPI_COMM_WORLD);
int size = pc.proc_size();
int rank = pc.proc_rank();
- if (reportrank==rank)
+ // start copy
+ LONG_DESC << "This program does a gather scatter with a list of tuples. \n"
+ " It tries to see how much communication costs in terms of time and memory. \n"
+ << "It starts with creating a list of tuples to be sent from each processor, \n to a list of other processors.\n" <<
+ "The number of tuples and how many tasks to communicate to are controlled by input parameters.\n" <<
+ "After communication, we verify locally if we received what we expected. \n";
+ ProgOptions opts(LONG_DESC.str(), BRIEF_DESC);
+
+ // how many procs communicate to current proc, on average (we will vary that too)
+ int num_comms = 2;
+ opts.addOpt<int>("num_comms,n",
+ "each task will send to about num_comms other tasks some tuples (default 2)", &num_comms);
+
+ int num_tuples = 4;
+ opts.addOpt<int>("num_tuples,t",
+ "each task will send to some task about num_tuples tuples (default 4)", &num_tuples);
+
+ int reportrank = size+1;
+ opts.addOpt<int>("reporting_rank,r",
+ "this rank will report the tuples sent and the tuples received; it could be higher than num_procs, then no reporting"
+ ,&reportrank);
+
+ opts.parseCommandLine(argc, argv);
+
+
+
+
+ if (rank==reportrank || (reportrank>=size && rank == 0))
{
- std::cout << " there are " << size << " procs in example\n";
+ std::cout << " There are " << size << " tasks in example.\n";
+ std::cout<< " We will send groups of " << num_tuples << " from each task towards " <<
+ num_comms << " other tasks.\n";
}
- // send some data from proc i to i+n/2, also to i +n/2+1 modulo n, wher en is num procs
+
+ // send some data from proc i to i+n/2, also to i +n/2+1 modulo n, where n is num procs
gs_data::crystal_data *cd = pc.crystal_router();
- TupleList tl;
+ long total_n_tuples = num_comms*num_tuples;
- // at most 100 to send
+ // vary the number of tasks to send to, and the number of tuples to send
+ if (rank<size/2)
+ num_comms--;
+ else
+ num_comms++;
+
+ if (rank<size/3)
+ num_tuples*=2;
+ else if (rank>size-size/3)
+ num_tuples/=2;
+
+
+ TupleList tl;
+ // at most num_tuples* num_comms to send
// we do a preallocate with this; some tuples on some processors might need more memory, to be able
- // to grow locally; 100 is a very large number for this example, considering that each task sends only
- // 2 tuples. Some tasks might receive more tuples though, and in the process, some might grow more than
+ // to grow locally; Some tasks might receive more tuples though, and in the process, some might grow more than
// others. By doing these logP sends/receives, we do not grow local memory too much.
- tl.initialize(1, 1, 0, 1, 100);
+ tl.initialize(1, 1, 0, 1, num_tuples*num_comms);
tl.enableWriteAccess();
- // form 2 tuples, send to rank+1 and rank+2 (mod size)
+ // form num_tuples*num_comms tuples, send to various ranks
unsigned int n = tl.get_n();
- int sendTo = rank+1;
- sendTo = sendTo%size;
- long intToSend = 100*rank + 10000*sendTo;
- tl.vi_wr[n]= sendTo;
- tl.vl_wr[n]= intToSend;
- tl.vr_wr[n]= 100.*rank;
- tl.inc_n();
-
- n = tl.get_n();
- sendTo = rank+(rank+1)*rank+2;// just some number relatively different from rank
- sendTo = sendTo%size;
- intToSend = 100*rank + 10000*sendTo;
- tl.vi_wr[n]= sendTo;
- tl.vl_wr[n]= intToSend;
- tl.vr_wr[n]= 1000.*rank;
- tl.inc_n();
-
- if (reportrank==rank)
+ for (int i=0; i<num_comms; i++)
+ {
+ int sendTo = rank+i*size/2+1;// spread out the send to, for a stress-like test
+ sendTo = sendTo%size;//
+ long intToSend = 1000*rank + 100000*sendTo;
+ for (int j=0; j<num_tuples; j++)
+ {
+ n = tl.get_n();
+ tl.vi_wr[n]= sendTo;
+ tl.vl_wr[n]= intToSend+j;
+ tl.vr_wr[n]= 10000.*rank+j;
+ tl.inc_n();
+ }
+ }
+
+ if (rank==reportrank)
{
std::cout << "rank " << rank << "\n";
tl.print(" before sending");
}
- // all communication happens here:
+ clock_t tt = clock();
+ // all communication happens here; no mpi calls for the user
ErrorCode rval = cd->gs_transfer(1,tl,0);
if (MB_SUCCESS!= rval)
@@ -107,23 +154,34 @@ int main(int argc, char **argv)
std::cout << "error in tuple transfer\n";
}
- if (reportrank==rank)
+ double secs=0;
+ if (rank==reportrank || (reportrank>=size && rank == 0))
+ {
+ secs = (clock() - tt) / (double) CLOCKS_PER_SEC;
+ }
+ if (rank==reportrank)
{
std::cout << "rank " << rank << "\n";
tl.print(" after transfer");
}
// check that all tuples received have the form 10000* rank + 100*from
unsigned int received = tl.get_n();
- for (int i=0; i<received; i++)
+ for (int i=0; i<(int)received; i++)
{
int from = tl.vi_rd[i];
long valrec = tl.vl_rd[i];
- int remainder = valrec -10000*rank -100*from;
- if (remainder != 0 )
+ int remainder = valrec -100000*rank -1000*from;
+ if (remainder < 0 || remainder >= num_tuples*4)
std::cout << " error: tuple " << i << " received at proc rank " << rank << " from proc " << from << " has value " <<
valrec << " remainder " << remainder << "\n";
}
+ if (rank==reportrank || (reportrank>=size && rank == 0))
+ {
+ std::cout << "communication of about "<< total_n_tuples << " tuples/per proc took "
+ << secs << " seconds" << std::endl;
+ tt = clock();
+ }
MPI_Finalize();
return 0;
diff --git a/examples/StructuredMeshSimple.cpp b/examples/StructuredMeshSimple.cpp
index bd21dd1..bc80ed8 100644
--- a/examples/StructuredMeshSimple.cpp
+++ b/examples/StructuredMeshSimple.cpp
@@ -17,7 +17,7 @@
* -# Get the coordinates of the vertices comprising that element
* -# Release the structured mesh interface and destroy the MOAB instance
*
- * <b> To run: </b> ./structuredmesh [d [N] ] \n
+ * <b> To run: </b> ./StructuredMeshSimple [d [N] ] \n
* (default values so can run w/ no user interaction)
*/
diff --git a/examples/structuredmesh.cpp b/examples/structuredmesh.cpp
index 5ad42fb..0214c3e 100644
--- a/examples/structuredmesh.cpp
+++ b/examples/structuredmesh.cpp
@@ -28,6 +28,7 @@ using namespace moab;
int main(int argc, char **argv)
{
+ argv[0] = argv[argc - argc]; // To remove the warnings about unused parameters
int I, J, K;
// progoptions?
std::cout << "Enter I, J, K... " << std::endl;
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index 2c0317b..76767ea 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -2321,6 +2321,8 @@ ErrorCode Tqdcfr::read_acis_records( const char* sat_filename )
// get next occurrence of '#' (record terminator)
ret = strchr(&(char_buf[buf_pos]), '#');
+ while (ret && ret+1-&char_buf[0] < bytes_left && *(ret+1) != '\n')
+ ret = strchr(ret+1, '#');
if (NULL != ret) {
// grab the string (inclusive of the record terminator and the line feed) and complete the record
int num_chars = ret-&(char_buf[buf_pos])+2;
@@ -2460,7 +2462,10 @@ ErrorCode Tqdcfr::parse_acis_attribs(const unsigned int entity_rec_num,
}
else if (strncmp(records[current_attrib].att_string.c_str(), "UNIQUE_ID", 9) == 0) {
// parse uid
- num_read = sscanf(records[current_attrib].att_string.c_str(), "UNIQUE_ID 1 0 1 %d", &uid);
+ if (major >=14) // change of format for cubit 14:
+ num_read =sscanf(records[current_attrib].att_string.c_str(), "UNIQUE_ID 0 1 %d", &uid);
+ else
+ num_read = sscanf(records[current_attrib].att_string.c_str(), "UNIQUE_ID 1 0 1 %d", &uid);
if (1 != num_read) return MB_FAILURE;
}
else if (strncmp(records[current_attrib].att_string.c_str(), "COMPOSITE_ATTRIB @9 UNIQUE_ID", 29) == 0) {
diff --git a/tools/mbcoupler/Coupler.cpp b/tools/mbcoupler/Coupler.cpp
index 29dbb3d..b496441 100644
--- a/tools/mbcoupler/Coupler.cpp
+++ b/tools/mbcoupler/Coupler.cpp
@@ -113,11 +113,22 @@ ErrorCode Coupler::initialize_tree()
box.bMax.get(&allBoxes[6*my_rank+3]);
// now communicate to get all boxes
- // use "in place" option
if (myPc) {
- int mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
+ int mpi_err;
+#if (MPI_VERSION >= 2)
+ // use "in place" option
+ mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
&allBoxes[0], 6, MPI_DOUBLE,
myPc->proc_config().proc_comm());
+#else
+ {
+ std::vector<double> allBoxes_tmp(6*myPc->proc_config().proc_size());
+ mpi_err = MPI_Allgather( &allBoxes[6*my_rank], 6, MPI_DOUBLE,
+ &allBoxes_tmp[0], 6, MPI_DOUBLE,
+ myPc->proc_config().proc_comm());
+ allBoxes = allBoxes_tmp;
+ }
+#endif
if (MPI_SUCCESS != mpi_err) return MB_FAILURE;
}
diff --git a/tools/mbcslam/Intx2Mesh.cpp b/tools/mbcslam/Intx2Mesh.cpp
index 22fdc3f..9859d00 100644
--- a/tools/mbcslam/Intx2Mesh.cpp
+++ b/tools/mbcslam/Intx2Mesh.cpp
@@ -483,10 +483,21 @@ ErrorCode Intx2Mesh::build_processor_euler_boxes(EntityHandle euler_set, Range &
}
// now communicate to get all boxes
- // use "in place" option
- int mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
- &allBoxes[0], 6, MPI_DOUBLE,
- parcomm->proc_config().proc_comm());
+ int mpi_err;
+#if (MPI_VERSION >= 2)
+ // use "in place" option
+ mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
+ &allBoxes[0], 6, MPI_DOUBLE,
+ parcomm->proc_config().proc_comm());
+#else
+ {
+ std::vector<double> allBoxes_tmp(6*parcomm->proc_config().proc_size());
+ mpi_err = MPI_Allgather( &allBoxes[6*my_rank], 6, MPI_DOUBLE,
+ &allBoxes_tmp[0], 6, MPI_DOUBLE,
+ parcomm->proc_config().proc_comm());
+ allBoxes = allBoxes_tmp;
+ }
+#endif
if (MPI_SUCCESS != mpi_err) return MB_FAILURE;
// also process the max number of vertices per cell (4 for quads, but could be more for polygons)
https://bitbucket.org/fathomteam/moab/commits/d27ee0670e36/
Changeset: d27ee0670e36
Branch: None
User: pshriwise
Date: 2014-02-23 16:56:54
Summary: Merge branch 'master' of bitbucket.org:fathomteam/moab
Affected #: 6 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/5b13a70196ae/
Changeset: 5b13a70196ae
Branch: None
User: pshriwise
Date: 2014-02-27 20:36:11
Summary: Update to the triangle connectivity test for ReadCGM.
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/7c8638d51f39/
Changeset: 7c8638d51f39
Branch: None
User: pshriwise
Date: 2014-02-27 20:48:23
Summary: Correction to a test comment in ReadCGM connectivity tests.
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/727e66e2315e/
Changeset: 727e66e2315e
Branch: None
User: pshriwise
Date: 2014-02-27 20:57:21
Summary: Added test descriptions in ReadCGM tests.
Affected #: 2 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/a5ec35fcdba1/
Changeset: a5ec35fcdba1
Branch: None
User: pshriwise
Date: 2014-02-27 21:00:54
Summary: Added test descriptions to ReadCGM connectivity tests.
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/c16ea020b9db/
Changeset: c16ea020b9db
Branch: None
User: pshriwise
Date: 2014-02-27 21:09:15
Summary: Added a check inside a ReadCGM connectivity function.
Affected #: 1 file
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/15e4dfcb4d02/
Changeset: 15e4dfcb4d02
Branch: None
User: pshriwise
Date: 2014-02-28 20:14:45
Summary: Merge branch 'master' of bitbucket.org:fathomteam/moab
Affected #: 5 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/b1292a1f1b13/
Changeset: b1292a1f1b13
Branch: None
User: pshriwise
Date: 2014-03-09 00:24:20
Summary: Merge branch 'master' of bitbucket.org:fathomteam/moab
Affected #: 4 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/57078cd610e0/
Changeset: 57078cd610e0
Branch: None
User: pshriwise
Date: 2014-03-09 00:49:47
Summary: Added comments to ReadCGM test files.
Affected #: 4 files
Diff not available.
https://bitbucket.org/fathomteam/moab/commits/d644d9ca688d/
Changeset: d644d9ca688d
Branch: master
User: gonuke
Date: 2014-03-26 02:52:33
Summary: Merge remote-tracking branch 'pshriwise/master'
This should merge PR#21, with a robust set of tests for ReadCGM.
Affected #: 8 files
Diff not available.
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.
1
0
commit/MOAB: danwu: Deleted ineffective backslash-newlines from the error handling code. It turns out that __LINE__ refers to physical lines, not logical ones.
by commits-noreplyï¼ bitbucket.org 25 Mar '14
by commits-noreplyï¼ bitbucket.org 25 Mar '14
25 Mar '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/80b822d03567/
Changeset: 80b822d03567
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-25 22:29:58
Summary: Deleted ineffective backslash-newlines from the error handling code. It turns out that __LINE__ refers to physical lines, not logical ones.
Affected #: 6 files
diff --git a/src/io/NCHelper.cpp b/src/io/NCHelper.cpp
index 8124098..42bf23d 100644
--- a/src/io/NCHelper.cpp
+++ b/src/io/NCHelper.cpp
@@ -68,9 +68,9 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
Tag numDimsTag = 0;
tag_name = "__NUM_DIMS";
int numDims = dimNames.size();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 1, MB_TYPE_INTEGER, numDimsTag, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 1, MB_TYPE_INTEGER, numDimsTag, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(numDimsTag, &_fileSet, 1, &numDims); \
+ rval = mbImpl->tag_set_data(numDimsTag, &_fileSet, 1, &numDims);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -79,9 +79,9 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
Tag numVarsTag = 0;
tag_name = "__NUM_VARS";
int numVars = varInfo.size();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 1, MB_TYPE_INTEGER, numVarsTag, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 1, MB_TYPE_INTEGER, numVarsTag, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(numVarsTag, &_fileSet, 1, &numVars); \
+ rval = mbImpl->tag_set_data(numVarsTag, &_fileSet, 1, &numVars);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -96,10 +96,10 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
dimnames.push_back('\0');
}
int dimnamesSz = dimnames.size();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, dimNamesTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, dimNamesTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
const void* ptr = dimnames.c_str();
- rval = mbImpl->tag_set_by_ptr(dimNamesTag, &_fileSet, 1, &ptr, &dimnamesSz); \
+ rval = mbImpl->tag_set_by_ptr(dimNamesTag, &_fileSet, 1, &ptr, &dimnamesSz);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -108,10 +108,10 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
Tag dimLensTag = 0;
tag_name = "__DIM_LENS";
int dimLensSz = dimLens.size();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_INTEGER, dimLensTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_INTEGER, dimLensTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
ptr = &(dimLens[0]);
- rval = mbImpl->tag_set_by_ptr(dimLensTag, &_fileSet, 1, &ptr, &dimLensSz); \
+ rval = mbImpl->tag_set_by_ptr(dimLensTag, &_fileSet, 1, &ptr, &dimLensSz);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -126,10 +126,10 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
varnames.push_back('\0');
}
int varnamesSz = varnames.size();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, varNamesTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, varNamesTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
ptr = varnames.c_str();
- rval = mbImpl->tag_set_by_ptr(varNamesTag, &_fileSet, 1, &ptr, &varnamesSz); \
+ rval = mbImpl->tag_set_by_ptr(varNamesTag, &_fileSet, 1, &ptr, &varnamesSz);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -144,9 +144,9 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
std::vector<int> val(2, 0);
val[0] = 0;
val[1] = nTimeSteps - 1;
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]); \
+ rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -168,9 +168,9 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
std::stringstream ss_tag_name;
ss_tag_name << "__" << dimNames[i] << "_LOC_VALS";
tag_name = ss_tag_name.str();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), val.size(), MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), val.size(), MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]); \
+ rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -193,9 +193,9 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
mbImpl->tag_get_handle(tmptagname.c_str(), 0, MB_TYPE_OPAQUE, tmptag, MB_TAG_ANY);
varInfo[mapIter->first].varTags[i] = tmptag;
}
- rval = mbImpl->tag_get_handle(tag_name.c_str(), varDimSz, MB_TYPE_HANDLE, varNamesDimsTag, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), varDimSz, MB_TYPE_HANDLE, varNamesDimsTag, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(varNamesDimsTag, &_fileSet, 1, &(varInfo[mapIter->first].varTags[0])); \
+ rval = mbImpl->tag_set_data(varNamesDimsTag, &_fileSet, 1, &(varInfo[mapIter->first].varTags[0]));
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -205,21 +205,21 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
Tag part_tag = scdi->part_method_tag();
if (!part_tag)
SET_ERR(MB_FAILURE, "Trouble getting PARTITION_METHOD tag");
- rval = mbImpl->tag_set_data(part_tag, &_fileSet, 1, &partMethod); \
+ rval = mbImpl->tag_set_data(part_tag, &_fileSet, 1, &partMethod);
CHK_ERR1(rval, "Trouble setting data for PARTITION_METHOD tag");
// <__GLOBAL_ATTRIBS>
tag_name = "__GLOBAL_ATTRIBS";
Tag globalAttTag = 0;
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, globalAttTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, globalAttTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
std::string gattVal;
std::vector<int> gattLen;
- rval = create_attrib_string(globalAtts, gattVal, gattLen); \
+ rval = create_attrib_string(globalAtts, gattVal, gattLen);
CHK_ERR1(rval, "Trouble creating global attribute string");
const void* gattptr = gattVal.c_str();
int globalAttSz = gattVal.size();
- rval = mbImpl->tag_set_by_ptr(globalAttTag, &_fileSet, 1, &gattptr, &globalAttSz); \
+ rval = mbImpl->tag_set_by_ptr(globalAttTag, &_fileSet, 1, &gattptr, &globalAttSz);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -229,9 +229,9 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
Tag globalAttLenTag = 0;
if (gattLen.size() == 0)
gattLen.push_back(0);
- rval = mbImpl->tag_get_handle(tag_name.c_str(), gattLen.size(), MB_TYPE_INTEGER, globalAttLenTag, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), gattLen.size(), MB_TYPE_INTEGER, globalAttLenTag, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(globalAttLenTag, &_fileSet, 1, &gattLen[0]); \
+ rval = mbImpl->tag_set_data(globalAttLenTag, &_fileSet, 1, &gattLen[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -242,15 +242,15 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
ssTagName << "__" << mapIter->first << "_ATTRIBS";
tag_name = ssTagName.str();
Tag varAttTag = 0;
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, varAttTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, varAttTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
std::string varAttVal;
std::vector<int> varAttLen;
- rval = create_attrib_string(mapIter->second.varAtts, varAttVal, varAttLen); \
+ rval = create_attrib_string(mapIter->second.varAtts, varAttVal, varAttLen);
CHK_ERR1_STR(rval, "Trouble creating attribute string for variable " << mapIter->first);
const void* varAttPtr = varAttVal.c_str();
int varAttSz = varAttVal.size();
- rval = mbImpl->tag_set_by_ptr(varAttTag, &_fileSet, 1, &varAttPtr, &varAttSz); \
+ rval = mbImpl->tag_set_by_ptr(varAttTag, &_fileSet, 1, &varAttPtr, &varAttSz);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -260,9 +260,9 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
ssTagName << "_LEN";
tag_name = ssTagName.str();
Tag varAttLenTag = 0;
- rval = mbImpl->tag_get_handle(tag_name.c_str(), varAttLen.size(), MB_TYPE_INTEGER, varAttLenTag, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), varAttLen.size(), MB_TYPE_INTEGER, varAttLenTag, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(varAttLenTag, &_fileSet, 1, &varAttLen[0]); \
+ rval = mbImpl->tag_set_data(varAttLenTag, &_fileSet, 1, &varAttLen[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -273,12 +273,12 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
Tag varNamesLocsTag = 0;
std::vector<int> varNamesLocs(varInfo.size());
rval = mbImpl->tag_get_handle(tag_name.c_str(), varNamesLocs.size(), MB_TYPE_INTEGER, varNamesLocsTag, MB_TAG_CREAT
- | MB_TAG_SPARSE); \
+ | MB_TAG_SPARSE);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
for (mapIter = varInfo.begin(); mapIter != varInfo.end(); ++mapIter) {
varNamesLocs[std::distance(varInfo.begin(), mapIter)] = mapIter->second.entLoc;
}
- rval = mbImpl->tag_set_data(varNamesLocsTag, &_fileSet, 1, &varNamesLocs[0]); \
+ rval = mbImpl->tag_set_data(varNamesLocsTag, &_fileSet, 1, &varNamesLocs[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -288,11 +288,11 @@ ErrorCode NCHelper::create_conventional_tags(const std::vector<int>& tstep_nums)
tag_name = "__MESH_TYPE";
std::string meshTypeName = get_mesh_type_name();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, meshTypeTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_OPAQUE, meshTypeTag, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
ptr = meshTypeName.c_str();
int leng = meshTypeName.size();
- rval = mbImpl->tag_set_by_ptr(meshTypeTag, &_fileSet, 1, &ptr, &leng); \
+ rval = mbImpl->tag_set_by_ptr(meshTypeTag, &_fileSet, 1, &ptr, &leng);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -385,7 +385,7 @@ ErrorCode NCHelper::read_variables_to_set(std::vector<ReadNC::VarData>& vdatas,
Interface*& mbImpl = _readNC->mbImpl;
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_variables_to_set_allocate(vdatas, tstep_nums); \
+ ErrorCode rval = read_variables_to_set_allocate(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble allocating space to read set variables");
// Finally, read into that space
@@ -438,11 +438,11 @@ ErrorCode NCHelper::read_variables_to_set(std::vector<ReadNC::VarData>& vdatas,
}
dbgOut.tprintf(2, "Converting set variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- rval = convert_variable(vdatas[i], t); \
+ rval = convert_variable(vdatas[i], t);
CHK_ERR1_STR(rval, "Failed to convert set variable " << vdatas[i].varName);
dbgOut.tprintf(2, "Setting tag data for set variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- rval = mbImpl->tag_set_by_ptr(vdatas[i].varTags[t], &_fileSet, 1, &data, &vdatas[i].sz); \
+ rval = mbImpl->tag_set_by_ptr(vdatas[i].varTags[t], &_fileSet, 1, &data, &vdatas[i].sz);
CHK_ERR1_STR(rval, "Failed to set tag data for set variable " << vdatas[i].varName);
// Memory pointed by pointer data can be deleted, as tag_set_by_ptr() has already copied the tag values
@@ -767,14 +767,14 @@ ErrorCode NCHelper::create_dummy_variables()
// Create a corresponding sparse tag
Tag tagh;
ErrorCode rval = mbImpl->tag_get_handle(var_name.c_str(), 0, MB_TYPE_INTEGER, tagh,
- MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Failed to create tag for dimension " << var_name);
// Tag value is the dimension length
const void* ptr = &dimLens[i];
// Tag size is 1
int size = 1;
- rval = mbImpl->tag_set_by_ptr(tagh, &_fileSet, 1, &ptr, &size); \
+ rval = mbImpl->tag_set_by_ptr(tagh, &_fileSet, 1, &ptr, &size);
CHK_ERR1_STR(rval, "Failed to set tag data for dimension " << var_name);
dbgOut.tprintf(2, "Sparse tag is created for dimension %s\n", var_name.c_str());
@@ -832,7 +832,7 @@ ErrorCode NCHelper::read_variables_to_set_allocate(std::vector<ReadNC::VarData>&
// Get the tag to read into
if (!vdatas[i].varTags[t]) {
- rval = get_tag_to_set(vdatas[i], tstep_nums[t], vdatas[i].varTags[t]); \
+ rval = get_tag_to_set(vdatas[i], tstep_nums[t], vdatas[i].varTags[t]);
CHK_ERR1_STR(rval, "Trouble getting tag for set variable " << vdatas[i].varName);
}
@@ -867,7 +867,7 @@ ErrorCode ScdNCHelper::check_existing_mesh() {
// Get the number of vertices
int num_verts;
- ErrorCode rval = mbImpl->get_number_entities_by_dimension(_fileSet, 0, num_verts); \
+ ErrorCode rval = mbImpl->get_number_entities_by_dimension(_fileSet, 0, num_verts);
CHK_ERR1(rval, "Trouble getting number of vertices");
/*
@@ -883,7 +883,7 @@ ErrorCode ScdNCHelper::check_existing_mesh() {
// Check the number of elements too
int num_elems;
- rval = mbImpl->get_number_entities_by_dimension(_fileSet, (-1 == lCDims[2] ? 2 : 3), num_elems); \
+ rval = mbImpl->get_number_entities_by_dimension(_fileSet, (-1 == lCDims[2] ? 2 : 3), num_elems);
CHK_ERR1(rval, "Trouble getting number of elements");
/*
@@ -913,7 +913,7 @@ ErrorCode ScdNCHelper::create_mesh(Range& faces)
ScdBox* scd_box;
ErrorCode rval = scdi->construct_box(HomCoord(lDims[0], lDims[1], lDims[2], 1), HomCoord(lDims[3], lDims[4], lDims[5], 1),
- NULL, 0, scd_box, locallyPeriodic, &parData, true); \
+ NULL, 0, scd_box, locallyPeriodic, &parData, true);
CHK_ERR1(rval, "Trouble creating scd vertex sequence");
// Add verts to tmp_range first, so we can duplicate global ids in vertex ids
@@ -922,11 +922,11 @@ ErrorCode ScdNCHelper::create_mesh(Range& faces)
if (mpFileIdTag) {
int count;
void* data;
- rval = mbImpl->tag_iterate(*mpFileIdTag, tmp_range.begin(), tmp_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(*mpFileIdTag, tmp_range.begin(), tmp_range.end(), count, data);
CHK_ERR1(rval, "Failed to get tag iterator on file id tag");
assert(count == scd_box->num_vertices());
int* fid_data = (int*) data;
- rval = mbImpl->tag_iterate(mGlobalIdTag, tmp_range.begin(), tmp_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, tmp_range.begin(), tmp_range.end(), count, data);
CHK_ERR1(rval, "Failed to get tag iterator on global id tag");
assert(count == scd_box->num_vertices());
int* gid_data = (int*) data;
@@ -937,14 +937,14 @@ ErrorCode ScdNCHelper::create_mesh(Range& faces)
// Then add box set and elements to the range, then to the file set
tmp_range.insert(scd_box->start_element(), scd_box->start_element() + scd_box->num_elements() - 1);
tmp_range.insert(scd_box->box_set());
- rval = mbImpl->add_entities(_fileSet, tmp_range); \
+ rval = mbImpl->add_entities(_fileSet, tmp_range);
CHK_ERR1(rval, "Couldn't add new vertices to current file set");
dbgOut.tprintf(1, "scdbox %d quads, %d vertices\n", scd_box->num_elements(), scd_box->num_vertices());
// Set the vertex coordinates
double *xc, *yc, *zc;
- rval = scd_box->get_coordinate_arrays(xc, yc, zc); \
+ rval = scd_box->get_coordinate_arrays(xc, yc, zc);
CHK_ERR1(rval, "Couldn't get vertex coordinate arrays");
int i, j, k, il, jl, kl;
@@ -971,7 +971,7 @@ ErrorCode ScdNCHelper::create_mesh(Range& faces)
int num_verts = (lDims[3] - lDims[0] + 1) * (lDims[4] - lDims[1] + 1) * (-1 == lDims[2] ? 1 : lDims[5] - lDims[2] + 1);
std::vector<int> gids(num_verts);
Range verts(scd_box->start_vertex(), scd_box->start_vertex() + scd_box->num_vertices() - 1);
- rval = mbImpl->tag_get_data(mGlobalIdTag, verts, &gids[0]); \
+ rval = mbImpl->tag_get_data(mGlobalIdTag, verts, &gids[0]);
CHK_ERR1(rval, "Trouble getting local gid values of vertices");
int vmin = *(std::min_element(gids.begin(), gids.end())), vmax = *(std::max_element(gids.begin(), gids.end()));
dbgOut.tprintf(1, "Vertex gids %d-%d\n", vmin, vmax);
@@ -983,14 +983,14 @@ ErrorCode ScdNCHelper::create_mesh(Range& faces)
if (2 <= dbgOut.get_verbosity()) {
assert(scd_box->boundary_complete());
EntityHandle dum_ent = scd_box->start_element();
- rval = mbImpl->list_entities(&dum_ent, 1); \
+ rval = mbImpl->list_entities(&dum_ent, 1);
CHK_ERR1(rval, "Trouble listing first hex");
std::vector<EntityHandle> connect;
- rval = mbImpl->get_connectivity(&dum_ent, 1, connect); \
+ rval = mbImpl->get_connectivity(&dum_ent, 1, connect);
CHK_ERR1(rval, "Trouble getting connectivity");
- rval = mbImpl->list_entities(&connect[0], connect.size()); \
+ rval = mbImpl->list_entities(&connect[0], connect.size());
CHK_ERR1(rval, "Trouble listing element connectivity");
}
@@ -1005,19 +1005,19 @@ ErrorCode ScdNCHelper::read_variables(std::vector<std::string>& var_names, std::
std::vector<ReadNC::VarData> vdatas;
std::vector<ReadNC::VarData> vsetdatas;
- ErrorCode rval = read_variables_setup(var_names, tstep_nums, vdatas, vsetdatas); \
+ ErrorCode rval = read_variables_setup(var_names, tstep_nums, vdatas, vsetdatas);
CHK_ERR1(rval, "Trouble setting up to read variables");
- rval = create_quad_coordinate_tag(); \
+ rval = create_quad_coordinate_tag();
CHK_ERR1(rval, "Trouble creating COORDS tag for quads");
if (!vsetdatas.empty()) {
- rval = read_variables_to_set(vsetdatas, tstep_nums); \
+ rval = read_variables_to_set(vsetdatas, tstep_nums);
CHK_ERR1(rval, "Trouble reading variables to set");
}
if (!vdatas.empty()) {
- rval = read_scd_variables_to_nonset(vdatas, tstep_nums); \
+ rval = read_scd_variables_to_nonset(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble reading variables to verts/edges/faces");
}
@@ -1036,14 +1036,14 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset_allocate(std::vector<ReadNC:
// Get vertices in set
Range verts;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts);
CHK_ERR1(rval, "Trouble getting vertices in current file set");
assert("Should only have a single vertex subrange, since they were read in one shot" &&
verts.psize() == 1);
// Get faces in set
Range faces;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 2, faces); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 2, faces);
CHK_ERR1(rval, "Trouble getting faces in current file set");
assert("Should only have a single face subrange, since they were read in one shot" &&
faces.psize() == 1);
@@ -1053,7 +1053,7 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset_allocate(std::vector<ReadNC:
bool& isParallel = _readNC->isParallel;
if (isParallel) {
ParallelComm*& myPcomm = _readNC->myPcomm;
- rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &faces_owned); \
+ rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &faces_owned);
CHK_ERR1(rval, "Trouble getting owned faces in current file set");
}
else
@@ -1118,14 +1118,14 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset_allocate(std::vector<ReadNC:
// Get the tag to read into
if (!vdatas[i].varTags[t]) {
- rval = get_tag_to_nonset(vdatas[i], tstep_nums[t], vdatas[i].varTags[t], vdatas[i].numLev); \
+ rval = get_tag_to_nonset(vdatas[i], tstep_nums[t], vdatas[i].varTags[t], vdatas[i].numLev);
CHK_ERR1_STR(rval, "Trouble getting tag for non-set variable " << vdatas[i].varName);
}
// Get ptr to tag space
void* data;
int count;
- rval = mbImpl->tag_iterate(vdatas[i].varTags[t], range->begin(), range->end(), count, data); \
+ rval = mbImpl->tag_iterate(vdatas[i].varTags[t], range->begin(), range->end(), count, data);
CHK_ERR1_STR(rval, "Failed to get tag iterator for non-set variable " << vdatas[i].varName);
assert((unsigned)count == range->size());
vdatas[i].varDatas[t] = data;
@@ -1144,7 +1144,7 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset(std::vector<ReadNC::VarData>
{
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_scd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ ErrorCode rval = read_scd_variables_to_nonset_allocate(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
@@ -1251,7 +1251,7 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset(std::vector<ReadNC::VarData>
for (unsigned int i = 0; i < vdatas.size(); i++) {
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting non-set variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- rval = convert_variable(vdatas[i], t); \
+ rval = convert_variable(vdatas[i], t);
CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
@@ -1271,7 +1271,7 @@ ErrorCode ScdNCHelper::create_quad_coordinate_tag() {
Interface*& mbImpl = _readNC->mbImpl;
Range ents;
- ErrorCode rval = mbImpl->get_entities_by_type(_fileSet, moab::MBQUAD, ents); \
+ ErrorCode rval = mbImpl->get_entities_by_type(_fileSet, moab::MBQUAD, ents);
CHK_ERR1(rval, "Trouble getting quads");
std::size_t numOwnedEnts = 0;
@@ -1280,7 +1280,7 @@ ErrorCode ScdNCHelper::create_quad_coordinate_tag() {
bool& isParallel = _readNC->isParallel;
if (isParallel) {
ParallelComm*& myPcomm = _readNC->myPcomm;
- rval = myPcomm->filter_pstatus(ents, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &ents_owned); \
+ rval = myPcomm->filter_pstatus(ents, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &ents_owned);
CHK_ERR1(rval, "Trouble getting owned quads");
numOwnedEnts = ents_owned.size();
}
@@ -1308,16 +1308,16 @@ ErrorCode ScdNCHelper::create_quad_coordinate_tag() {
}
std::string tag_name = "COORDS";
Tag tagh = 0;
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 3, MB_TYPE_DOUBLE, tagh, MB_TAG_DENSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 3, MB_TYPE_DOUBLE, tagh, MB_TAG_DENSE | MB_TAG_CREAT);
CHK_ERR1(rval, "Trouble creating COORDS tag");
void *data;
int count;
#ifdef USE_MPI
- rval = mbImpl->tag_iterate(tagh, ents_owned.begin(), ents_owned.end(), count, data); \
+ rval = mbImpl->tag_iterate(tagh, ents_owned.begin(), ents_owned.end(), count, data);
CHK_ERR1(rval, "Failed to get COORDS tag iterator on owned quads");
#else
- rval = mbImpl->tag_iterate(tagh, ents.begin(), ents.end(), count, data); \
+ rval = mbImpl->tag_iterate(tagh, ents.begin(), ents.end(), count, data);
CHK_ERR1(rval, "Failed to get COORDS tag iterator on quads");
#endif
assert(count == (int)numOwnedEnts);
@@ -1332,22 +1332,22 @@ ErrorCode UcdNCHelper::read_variables(std::vector<std::string>& var_names, std::
std::vector<ReadNC::VarData> vdatas;
std::vector<ReadNC::VarData> vsetdatas;
- ErrorCode rval = read_variables_setup(var_names, tstep_nums, vdatas, vsetdatas); \
+ ErrorCode rval = read_variables_setup(var_names, tstep_nums, vdatas, vsetdatas);
CHK_ERR1(rval, "Trouble setting up to read variables");
if (!vsetdatas.empty()) {
- rval = read_variables_to_set(vsetdatas, tstep_nums); \
+ rval = read_variables_to_set(vsetdatas, tstep_nums);
CHK_ERR1(rval, "Trouble reading variables to set");
}
if (!vdatas.empty()) {
#ifdef PNETCDF_FILE
// With pnetcdf support, we will use async read
- rval = read_ucd_variables_to_nonset_async(vdatas, tstep_nums); \
+ rval = read_ucd_variables_to_nonset_async(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble reading variables to verts/edges/faces");
#else
// Without pnetcdf support, we will use old read
- rval = read_ucd_variables_to_nonset(vdatas, tstep_nums); \
+ rval = read_ucd_variables_to_nonset(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble reading variables to verts/edges/faces");
#endif
}
diff --git a/src/io/NCHelperEuler.cpp b/src/io/NCHelperEuler.cpp
index fe15c6e..9f67a71 100644
--- a/src/io/NCHelperEuler.cpp
+++ b/src/io/NCHelperEuler.cpp
@@ -69,7 +69,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
// Check i periodicity and set globallyPeriodic[0]
std::vector<double> til_vals(2);
- ErrorCode rval = read_coordinate("lon", gCDims[3] - 1, gCDims[3], til_vals); \
+ ErrorCode rval = read_coordinate("lon", gCDims[3] - 1, gCDims[3], til_vals);
CHK_ERR1(rval, "Trouble reading 'lon' variable");
if (std::fabs(2 * til_vals[1] - til_vals[0] - 360) < 0.001)
globallyPeriodic[0] = 1;
@@ -135,7 +135,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
parData.partMethod = partMethod;
int pdims[3];
- rval = ScdInterface::compute_partition(procs, rank, parData, lDims, locallyPeriodic, pdims); \
+ rval = ScdInterface::compute_partition(procs, rank, parData, lDims, locallyPeriodic, pdims);
CHK_ERR1(rval, "Error returned from compute_partition");
for (int i = 0; i < 3; i++)
parData.pDims[i] = pdims[i];
@@ -185,7 +185,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
std::map<std::string, ReadNC::VarData>::iterator vmit;
if (-1 != lCDims[0]) {
if ((vmit = varInfo.find("lon")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
- rval = read_coordinate("lon", lCDims[0], lCDims[3], ilCVals); \
+ rval = read_coordinate("lon", lCDims[0], lCDims[3], ilCVals);
CHK_ERR1(rval, "Trouble reading 'lon' variable");
}
else {
@@ -195,7 +195,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
if (-1 != lCDims[1]) {
if ((vmit = varInfo.find("lat")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
- rval = read_coordinate("lat", lCDims[1], lCDims[4], jlCVals); \
+ rval = read_coordinate("lat", lCDims[1], lCDims[4], jlCVals);
CHK_ERR1(rval, "Trouble reading 'lat' variable");
}
else {
@@ -223,7 +223,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
if (!isParallel || ((gDims[4] - gDims[1]) == (lDims[4] - lDims[1]))) {
std::string gwName("gw");
std::vector<double> gwVals(lDims[4] - lDims[1] - 1);
- rval = read_coordinate(gwName.c_str(), lDims[1], lDims[4] - 2, gwVals); \
+ rval = read_coordinate(gwName.c_str(), lDims[1], lDims[4] - 2, gwVals);
CHK_ERR1(rval, "Trouble reading 'gw' variable");
// Copy the correct piece
jlVals[0] = -(M_PI / 2) * 180 / M_PI;
@@ -242,7 +242,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
// If this is the first row
if (lDims[1] == gDims[1]) {
std::vector<double> gwVals(lDims[4]);
- rval = read_coordinate(gwName.c_str(), 0, lDims[4] - 1, gwVals); \
+ rval = read_coordinate(gwName.c_str(), 0, lDims[4] - 1, gwVals);
CHK_ERR1(rval, "Trouble reading 'gw' variable");
// Copy the correct piece
jlVals[0] = -(M_PI / 2) * 180 / M_PI;
@@ -255,7 +255,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
// Or if it's the last row
else if (lDims[4] == gDims[4]) {
std::vector<double> gwVals(lDims[4] - 1);
- rval = read_coordinate(gwName.c_str(), 0, lDims[4] - 2, gwVals); \
+ rval = read_coordinate(gwName.c_str(), 0, lDims[4] - 2, gwVals);
CHK_ERR1(rval, "Trouble reading 'gw' variable");
// copy the correct piece
gwSum = -1;
@@ -273,7 +273,7 @@ ErrorCode NCHelperEuler::init_mesh_vals()
int start = lDims[1] - 1;
int end = lDims[4] - 1;
std::vector<double> gwVals(end);
- rval = read_coordinate(gwName.c_str(), 0, end - 1, gwVals); \
+ rval = read_coordinate(gwName.c_str(), 0, end - 1, gwVals);
CHK_ERR1(rval, "Trouble reading 'gw' variable");
gwSum = -1;
for (int j = 0; j != start - 1; j++)
@@ -294,11 +294,11 @@ ErrorCode NCHelperEuler::init_mesh_vals()
// Store time coordinate values in tVals
if (nTimeSteps > 0) {
if ((vmit = varInfo.find("time")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
- rval = read_coordinate("time", 0, nTimeSteps - 1, tVals); \
+ rval = read_coordinate("time", 0, nTimeSteps - 1, tVals);
CHK_ERR1(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); \
+ rval = read_coordinate("t", 0, nTimeSteps - 1, tVals);
CHK_ERR1(rval, "Trouble reading 't' variable");
}
else {
@@ -361,9 +361,9 @@ ErrorCode NCHelperEuler::init_mesh_vals()
std::stringstream ss_tag_name;
ss_tag_name << ijdimNames[i] << "_LOC_MINMAX";
tag_name = ss_tag_name.str();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]); \
+ rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -402,9 +402,9 @@ ErrorCode NCHelperEuler::init_mesh_vals()
std::stringstream ss_tag_name;
ss_tag_name << ijdimNames[i] << "_LOC_VALS";
tag_name = ss_tag_name.str();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_DOUBLE, tagh, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_DOUBLE, tagh, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_by_ptr(tagh, &_fileSet, 1, &val, &val_len); \
+ rval = mbImpl->tag_set_by_ptr(tagh, &_fileSet, 1, &val, &val_len);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -432,16 +432,16 @@ ErrorCode NCHelperEuler::init_mesh_vals()
std::stringstream ss_tag_name;
ss_tag_name << ijdimNames[i] << "_GLOBAL_MINMAX";
tag_name = ss_tag_name.str();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]); \
+ rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
}
// Hack: create dummy variables, if needed, for dimensions with no corresponding coordinate variables
- rval = create_dummy_variables(); \
+ rval = create_dummy_variables();
CHK_ERR1(rval, "Failed to create dummy variables");
return MB_SUCCESS;
diff --git a/src/io/NCHelperFV.cpp b/src/io/NCHelperFV.cpp
index 1120866..a85e834 100644
--- a/src/io/NCHelperFV.cpp
+++ b/src/io/NCHelperFV.cpp
@@ -86,7 +86,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
// Check i periodicity and set globallyPeriodic[0]
std::vector<double> til_vals(2);
- ErrorCode rval = read_coordinate("lon", gCDims[3] - 1, gCDims[3], til_vals); \
+ ErrorCode rval = read_coordinate("lon", gCDims[3] - 1, gCDims[3], til_vals);
CHK_ERR1(rval, "Trouble reading 'lon' variable");
if (std::fabs(2 * til_vals[1] - til_vals[0] - 360) < 0.001)
globallyPeriodic[0] = 1;
@@ -151,7 +151,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
parData.partMethod = partMethod;
int pdims[3];
- rval = ScdInterface::compute_partition(procs, rank, parData, lDims, locallyPeriodic, pdims); \
+ rval = ScdInterface::compute_partition(procs, rank, parData, lDims, locallyPeriodic, pdims);
CHK_ERR1(rval, "Error returned from compute_partition");
for (int i = 0; i < 3; i++)
parData.pDims[i] = pdims[i];
@@ -201,7 +201,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
std::map<std::string, ReadNC::VarData>::iterator vmit;
if (-1 != lCDims[0]) {
if ((vmit = varInfo.find("lon")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
- rval = read_coordinate("lon", lCDims[0], lCDims[3], ilCVals); \
+ rval = read_coordinate("lon", lCDims[0], lCDims[3], ilCVals);
CHK_ERR1(rval, "Trouble reading 'lon' variable");
}
else {
@@ -211,7 +211,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
if (-1 != lCDims[1]) {
if ((vmit = varInfo.find("lat")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
- rval = read_coordinate("lat", lCDims[1], lCDims[4], jlCVals); \
+ rval = read_coordinate("lat", lCDims[1], lCDims[4], jlCVals);
CHK_ERR1(rval, "Trouble reading 'lat' variable");
}
else {
@@ -233,7 +233,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
ilVals[i] = ilVals[i - 1] + dif;
}
else {
- rval = read_coordinate("slon", lDims[0], lDims[3], ilVals); \
+ rval = read_coordinate("slon", lDims[0], lDims[3], ilVals);
CHK_ERR1(rval, "Trouble reading 'slon' variable");
}
}
@@ -246,7 +246,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
if ((vmit = varInfo.find("slat")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
if (!isParallel || ((gDims[4] - gDims[1]) == (lDims[4] - lDims[1]))) {
std::vector<double> dummyVar(lDims[4] - lDims[1] - 1);
- rval = read_coordinate("slat", lDims[1], lDims[4] - 2, dummyVar); \
+ rval = read_coordinate("slat", lDims[1], lDims[4] - 2, dummyVar);
CHK_ERR1(rval, "Trouble reading 'slat' variable");
// Copy the correct piece
jlVals[0] = -90.0;
@@ -260,7 +260,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
// Need to read one less then available and read it into a dummy var
if (lDims[1] == gDims[1]) {
std::vector<double> dummyVar(lDims[4] - lDims[1]);
- rval = read_coordinate("slat", lDims[1], lDims[4] - 1, dummyVar); \
+ rval = read_coordinate("slat", lDims[1], lDims[4] - 1, dummyVar);
CHK_ERR1(rval, "Trouble reading 'slat' variable");
// Copy the correct piece
jlVals[0] = -90.0;
@@ -270,7 +270,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
// Or if it's the last row
else if (lDims[4] == gDims[4]) {
std::vector<double> dummyVar(lDims[4] - lDims[1]);
- rval = read_coordinate("slat", lDims[1] - 1, lDims[4] - 2, dummyVar); \
+ rval = read_coordinate("slat", lDims[1] - 1, lDims[4] - 2, dummyVar);
CHK_ERR1(rval, "Trouble reading 'slat' variable");
// Copy the correct piece
std::size_t i = 0;
@@ -280,7 +280,7 @@ ErrorCode NCHelperFV::init_mesh_vals()
}
// It's in the middle
else {
- rval = read_coordinate("slat", lDims[1] - 1, lDims[4] - 1, jlVals); \
+ rval = read_coordinate("slat", lDims[1] - 1, lDims[4] - 1, jlVals);
CHK_ERR1(rval, "Trouble reading 'slat' variable");
}
}
@@ -293,11 +293,11 @@ ErrorCode NCHelperFV::init_mesh_vals()
// Store time coordinate values in tVals
if (nTimeSteps > 0) {
if ((vmit = varInfo.find("time")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
- rval = read_coordinate("time", 0, nTimeSteps - 1, tVals); \
+ rval = read_coordinate("time", 0, nTimeSteps - 1, tVals);
CHK_ERR1(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); \
+ rval = read_coordinate("t", 0, nTimeSteps - 1, tVals);
CHK_ERR1(rval, "Trouble reading 't' variable");
}
else {
@@ -365,9 +365,9 @@ ErrorCode NCHelperFV::init_mesh_vals()
std::stringstream ss_tag_name;
ss_tag_name << ijdimNames[i] << "_LOC_MINMAX";
tag_name = ss_tag_name.str();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]); \
+ rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -406,9 +406,9 @@ ErrorCode NCHelperFV::init_mesh_vals()
std::stringstream ss_tag_name;
ss_tag_name << ijdimNames[i] << "_LOC_VALS";
tag_name = ss_tag_name.str();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_DOUBLE, tagh, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 0, MB_TYPE_DOUBLE, tagh, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_by_ptr(tagh, &_fileSet, 1, &val, &val_len); \
+ rval = mbImpl->tag_set_by_ptr(tagh, &_fileSet, 1, &val, &val_len);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
@@ -436,16 +436,16 @@ ErrorCode NCHelperFV::init_mesh_vals()
std::stringstream ss_tag_name;
ss_tag_name << ijdimNames[i] << "_GLOBAL_MINMAX";
tag_name = ss_tag_name.str();
- rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle(tag_name.c_str(), 2, MB_TYPE_INTEGER, tagh, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1_STR(rval, "Trouble creating conventional tag " << tag_name);
- rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]); \
+ rval = mbImpl->tag_set_data(tagh, &_fileSet, 1, &val[0]);
CHK_ERR1_STR(rval, "Trouble setting data for conventional tag " << tag_name);
if (MB_SUCCESS == rval)
dbgOut.tprintf(2, "Conventional tag %s is created.\n", tag_name.c_str());
}
// Hack: create dummy variables, if needed, for dimensions with no corresponding coordinate variables
- rval = create_dummy_variables(); \
+ rval = create_dummy_variables();
CHK_ERR1(rval, "Failed to create dummy variables");
return MB_SUCCESS;
diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index 7f650fd..72d9773 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -165,11 +165,11 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
}
else {
if ((vmit = varInfo.find("time")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
- rval = read_coordinate("time", 0, nTimeSteps - 1, tVals); \
+ rval = read_coordinate("time", 0, nTimeSteps - 1, tVals);
CHK_ERR1(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); \
+ rval = read_coordinate("t", 0, nTimeSteps - 1, tVals);
CHK_ERR1(rval, "Trouble reading 't' variable");
}
else {
@@ -196,7 +196,7 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
}
// Hack: create dummy variables for dimensions (like ncol) with no corresponding coordinate variables
- rval = create_dummy_variables(); \
+ rval = create_dummy_variables();
CHK_ERR1(rval, "Failed to create dummy variables");
return MB_SUCCESS;
@@ -220,14 +220,14 @@ ErrorCode NCHelperHOMME::check_existing_mesh()
// Get all vertices from current file set (it is the input set in no_mesh scenario)
Range local_verts;
- ErrorCode rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts); \
+ ErrorCode rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts);
CHK_ERR1(rval, "Trouble getting local vertices in current file set");
if (!local_verts.empty()) {
std::vector<int> gids(local_verts.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]); \
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]);
CHK_ERR1(rval, "Trouble getting local gid values of vertices");
// Restore localGidVerts
@@ -300,7 +300,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
std::vector<std::string> conn_names;
std::vector<int> conn_vals;
- rval = _readNC->get_dimensions(connectId, conn_names, conn_vals); \
+ rval = _readNC->get_dimensions(connectId, conn_names, conn_vals);
CHK_ERR1(rval, "Failed to get dimensions for connectivity");
// Read connectivity into temporary variable
@@ -383,20 +383,20 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
rval = _readNC->readMeshIface->get_element_connect(num_coarse_quads, 4,
MBQUAD, 0, start_quad, conn_arr,
// Might have to create gather mesh later
- (create_gathers ? num_coarse_quads + num_quads : num_coarse_quads)); \
+ (create_gathers ? num_coarse_quads + num_quads : num_coarse_quads));
CHK_ERR1(rval, "Failed to create local quads");
tmp_range.insert(start_quad, start_quad + num_coarse_quads - 1);
std::copy(&tmp_conn[start_idx], &tmp_conn[start_idx + 4 * num_fine_quads], conn_arr);
std::copy(conn_arr, conn_arr + 4 * num_fine_quads, range_inserter(localGidVerts));
}
else {
- rval = smt.create_spectral_elems(&tmp_conn[0], num_fine_quads, 2, tmp_range, start_idx, &localGidVerts); \
+ rval = smt.create_spectral_elems(&tmp_conn[0], num_fine_quads, 2, tmp_range, start_idx, &localGidVerts);
CHK_ERR1(rval, "Failed to create spectral elements");
int count, v_per_e;
- rval = mbImpl->connect_iterate(tmp_range.begin(), tmp_range.end(), conn_arr, v_per_e, count); \
+ rval = mbImpl->connect_iterate(tmp_range.begin(), tmp_range.end(), conn_arr, v_per_e, count);
CHK_ERR1(rval, "Failed to get connectivity of spectral elements.");
rval = mbImpl->tag_iterate(smt.spectral_vertices_tag(true), tmp_range.begin(), tmp_range.end(),
- count, (void*&)sv_ptr); \
+ count, (void*&)sv_ptr);
CHK_ERR1(rval, "Failed to get fine connectivity of spectral elements");
}
@@ -405,7 +405,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
std::vector<double*> arrays;
rval = _readNC->readMeshIface->get_node_coords(3, nLocalVertices, 0, start_vertex, arrays,
// Might have to create gather mesh later
- (create_gathers ? nLocalVertices + nVertices : nLocalVertices)); \
+ (create_gathers ? nLocalVertices + nVertices : nLocalVertices));
CHK_ERR1(rval, "Failed to create local vertices");
// Set vertex coordinates
@@ -437,7 +437,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
Range vert_range(start_vertex, start_vertex + nLocalVertices - 1);
void* data;
int count;
- rval = mbImpl->tag_iterate(mGlobalIdTag, vert_range.begin(), vert_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, vert_range.begin(), vert_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate global id tag on local vertices");
assert(count == nLocalVertices);
int* gid_data = (int*) data;
@@ -445,7 +445,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
// Duplicate global id data, which will be used to resolve sharing
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, vert_range.begin(), vert_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(*mpFileIdTag, vert_range.begin(), vert_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate file id tag on local vertices");
assert(count == nLocalVertices);
gid_data = (int*) data;
@@ -478,20 +478,20 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
// Mark the set with the spectral order
Tag sporder;
- rval = mbImpl->tag_get_handle("SPECTRAL_ORDER", 1, MB_TYPE_INTEGER, sporder, MB_TAG_CREAT | MB_TAG_SPARSE); \
+ rval = mbImpl->tag_get_handle("SPECTRAL_ORDER", 1, MB_TYPE_INTEGER, sporder, MB_TAG_CREAT | MB_TAG_SPARSE);
CHK_ERR1(rval, "Failed to get SPECTRAL_ORDER tag");
- rval = mbImpl->tag_set_data(sporder, &_fileSet, 1, &_spectralOrder); \
+ rval = mbImpl->tag_set_data(sporder, &_fileSet, 1, &_spectralOrder);
CHK_ERR1(rval, "Failed to set data for SPECTRAL_ORDER tag");
if (create_gathers) {
EntityHandle gather_set;
- rval = _readNC->readMeshIface->create_gather_set(gather_set); \
+ rval = _readNC->readMeshIface->create_gather_set(gather_set);
CHK_ERR1(rval, "Failed to create gather set");
// Create vertices
arrays.clear();
// Don't need to specify allocation number here, because we know enough verts were created before
- rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, start_vertex, arrays); \
+ rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, start_vertex, arrays);
CHK_ERR1(rval, "Failed to create gather set vertices");
xptr = arrays[0];
@@ -509,7 +509,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
// Get ptr to gid memory for vertices
Range gather_set_verts_range(start_vertex, start_vertex + nVertices - 1);
- rval = mbImpl->tag_iterate(mGlobalIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate global id tag on gather set vertices");
assert(count == nVertices);
gid_data = (int*) data;
@@ -517,7 +517,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
gid_data[j - 1] = j;
// Set the file id tag too, it should be bigger something not interfering with global id
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(*mpFileIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate file id tag on gather set vertices");
assert(count == nVertices);
gid_data = (int*) data;
@@ -525,20 +525,20 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
gid_data[j - 1] = nVertices + j; // bigger than global id tag
}
- rval = mbImpl->add_entities(gather_set, gather_set_verts_range); \
+ rval = mbImpl->add_entities(gather_set, gather_set_verts_range);
CHK_ERR1(rval, "Failed to add vertices to the gather set");
// Create quads
Range gather_set_quads_range;
// Don't need to specify allocation number here, because we know enough quads were created before
rval = _readNC->readMeshIface->get_element_connect(num_quads, 4,
- MBQUAD, 0, start_quad, conn_arr); \
+ MBQUAD, 0, start_quad, conn_arr);
CHK_ERR1(rval, "Failed to create gather set quads");
gather_set_quads_range.insert(start_quad, start_quad + num_quads - 1);
std::copy(&tmp_conn[0], &tmp_conn[4 * num_quads], conn_arr);
for (i = 0; i != 4 * num_quads; i++)
conn_arr[i] += start_vertex - 1; // Connectivity array is shifted by where the gather verts start
- rval = mbImpl->add_entities(gather_set, gather_set_quads_range); \
+ rval = mbImpl->add_entities(gather_set, gather_set_quads_range);
CHK_ERR1(rval, "Failed to add quads to the gather set");
}
@@ -557,7 +557,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_allocate(std::vector<ReadN
// Get vertices in set
Range verts;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts);
CHK_ERR1(rval, "Trouble getting vertices in current file set");
assert("Should only have a single vertex subrange, since they were read in one shot" &&
verts.psize() == 1);
@@ -631,7 +631,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
{
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
@@ -770,7 +770,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
for (unsigned int i = 0; i < vdatas.size(); i++) {
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- rval = convert_variable(vdatas[i], t); \
+ rval = convert_variable(vdatas[i], t);
CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
@@ -790,7 +790,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
{
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
@@ -910,7 +910,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
for (unsigned int i = 0; i < vdatas.size(); i++) {
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- rval = convert_variable(vdatas[i], t); \
+ rval = convert_variable(vdatas[i], t);
CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 349e17a..8491b1c 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -144,7 +144,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
// Note, two possible types for xtime variable: double(Time) or char(Time, StrLen)
if ((vmit = varInfo.find("xtime")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
// If xtime variable is double type, read time coordinate values to tVals
- rval = read_coordinate("xtime", 0, nTimeSteps - 1, tVals); \
+ rval = read_coordinate("xtime", 0, nTimeSteps - 1, tVals);
CHK_ERR1(rval, "Trouble reading 'xtime' variable");
}
else {
@@ -187,7 +187,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
}
// Hack: create dummy variables for dimensions (like nCells) with no corresponding coordinate variables
- rval = create_dummy_variables(); \
+ rval = create_dummy_variables();
CHK_ERR1(rval, "Failed to create dummy variables");
return MB_SUCCESS;
@@ -217,14 +217,14 @@ ErrorCode NCHelperMPAS::check_existing_mesh()
if (localGidVerts.empty()) {
// Get all vertices from tmp_set (it is the input set in no_mesh scenario)
Range local_verts;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts);
CHK_ERR1(rval, "Trouble getting local vertices in current file set");
if (!local_verts.empty()) {
std::vector<int> gids(local_verts.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]); \
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]);
CHK_ERR1(rval, "Trouble getting local gid values of vertices");
// Restore localGidVerts
@@ -236,14 +236,14 @@ ErrorCode NCHelperMPAS::check_existing_mesh()
if (localGidEdges.empty()) {
// Get all edges from _fileSet (it is the input set in no_mesh scenario)
Range local_edges;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 1, local_edges); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 1, local_edges);
CHK_ERR1(rval, "Trouble getting local edges in current file set");
if (!local_edges.empty()) {
std::vector<int> gids(local_edges.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_edges, &gids[0]); \
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_edges, &gids[0]);
CHK_ERR1(rval, "Trouble getting local gid values of edges");
// Restore localGidEdges
@@ -262,7 +262,7 @@ ErrorCode NCHelperMPAS::check_existing_mesh()
std::vector<int> gids(local_cells.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_cells, &gids[0]); \
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_cells, &gids[0]);
CHK_ERR1(rval, "Trouble getting local gid values of cells");
// Restore localGidCells
@@ -323,7 +323,7 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
start_cell_idx++; // 0 based -> 1 based
// Redistribute local cells after trivial partition (e.g. apply Zoltan partition)
- ErrorCode rval = redistribute_local_cells(start_cell_idx); \
+ ErrorCode rval = redistribute_local_cells(start_cell_idx);
CHK_ERR1(rval, "Failed to redistribute local cells after trivial partition");
}
else {
@@ -447,55 +447,55 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
// Create local vertices
EntityHandle start_vertex;
- ErrorCode rval = create_local_vertices(vertices_on_local_cells, start_vertex); \
+ ErrorCode rval = create_local_vertices(vertices_on_local_cells, start_vertex);
CHK_ERR1(rval, "Failed to create local vertices for MPAS mesh");
// Create local edges (unless NO_EDGES read option is set)
if (!noEdges) {
- rval = create_local_edges(start_vertex, num_edges_on_local_cells); \
+ rval = create_local_edges(start_vertex, num_edges_on_local_cells);
CHK_ERR1(rval, "Failed to create local edges for MPAS mesh");
}
// Create local cells, either unpadded or padded
if (noMixedElements) {
- rval = create_padded_local_cells(vertices_on_local_cells, start_vertex, faces); \
+ rval = create_padded_local_cells(vertices_on_local_cells, start_vertex, faces);
CHK_ERR1(rval, "Failed to create padded local cells for MPAS mesh");
}
else {
- rval = create_local_cells(vertices_on_local_cells, num_edges_on_local_cells, start_vertex, faces); \
+ rval = create_local_cells(vertices_on_local_cells, num_edges_on_local_cells, start_vertex, faces);
CHK_ERR1(rval, "Failed to create local cells for MPAS mesh");
}
// Set tag for numCellGroups
Tag numCellGroupsTag = 0;
- rval = mbImpl->tag_get_handle("__NUM_CELL_GROUPS", 1, MB_TYPE_INTEGER, numCellGroupsTag, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ rval = mbImpl->tag_get_handle("__NUM_CELL_GROUPS", 1, MB_TYPE_INTEGER, numCellGroupsTag, MB_TAG_SPARSE | MB_TAG_CREAT);
CHK_ERR1(rval, "Failed to get __NUM_CELL_GROUPS tag");
- rval = mbImpl->tag_set_data(numCellGroupsTag, &_fileSet, 1, &numCellGroups); \
+ rval = mbImpl->tag_set_data(numCellGroupsTag, &_fileSet, 1, &numCellGroups);
CHK_ERR1(rval, "Failed to set data for __NUM_CELL_GROUPS tag");
if (createGatherSet) {
EntityHandle gather_set;
- rval = _readNC->readMeshIface->create_gather_set(gather_set); \
+ rval = _readNC->readMeshIface->create_gather_set(gather_set);
CHK_ERR1(rval, "Failed to create gather set");
// Create gather set vertices
EntityHandle start_gather_set_vertex;
- rval = create_gather_set_vertices(gather_set, start_gather_set_vertex); \
+ rval = create_gather_set_vertices(gather_set, start_gather_set_vertex);
CHK_ERR1(rval, "Failed to create gather set vertices for MPAS mesh");
// Create gather set edges (unless NO_EDGES read option is set)
if (!noEdges) {
- rval = create_gather_set_edges(gather_set, start_gather_set_vertex); \
+ rval = create_gather_set_edges(gather_set, start_gather_set_vertex);
CHK_ERR1(rval, "Failed to create gather set edges for MPAS mesh");
}
// Create gather set cells, either unpadded or padded
if (noMixedElements) {
- rval = create_padded_gather_set_cells(gather_set, start_gather_set_vertex); \
+ rval = create_padded_gather_set_cells(gather_set, start_gather_set_vertex);
CHK_ERR1(rval, "Failed to create padded gather set cells for MPAS mesh");
}
else {
- rval = create_gather_set_cells(gather_set, start_gather_set_vertex); \
+ rval = create_gather_set_cells(gather_set, start_gather_set_vertex);
CHK_ERR1(rval, "Failed to create gather set cells for MPAS mesh");
}
}
@@ -516,7 +516,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
// Get vertices in set
Range verts;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts);
CHK_ERR1(rval, "Trouble getting vertices in current file set");
assert("Should only have a single vertex subrange, since they were read in one shot" &&
verts.psize() == 1);
@@ -524,7 +524,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
// Get edges in set (unless NO_EDGES read option is set)
Range edges;
if (!noEdges) {
- rval = mbImpl->get_entities_by_dimension(_fileSet, 1, edges); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 1, edges);
CHK_ERR1(rval, "Trouble getting edges in current file set");
assert("Should only have a single edge subrange, since they were read in one shot" &&
edges.psize() == 1);
@@ -532,7 +532,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
// Get faces in set
Range faces;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 2, faces); \
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 2, faces);
CHK_ERR1(rval, "Trouble getting faces in current file set");
// Note, for MPAS faces.psize() can be more than 1
@@ -540,7 +540,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
bool& isParallel = _readNC->isParallel;
if (isParallel) {
ParallelComm*& myPcomm = _readNC->myPcomm;
- rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &facesOwned); \
+ rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &facesOwned);
CHK_ERR1(rval, "Trouble getting owned faces in current file set");
}
else
@@ -649,7 +649,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
bool& noEdges = _readNC->noEdges;
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
@@ -735,7 +735,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
while (iter != facesOwned.end()) {
int count;
void* ptr;
- rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr); \
+ rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr);
CHK_ERR1(rval, "Failed to iterate tag on owned faces");
for (int j = 0; j < count; j++) {
@@ -778,7 +778,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- rval = convert_variable(vdatas[i], t); \
+ rval = convert_variable(vdatas[i], t);
CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
@@ -799,7 +799,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
bool& noEdges = _readNC->noEdges;
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
@@ -872,7 +872,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
while (iter != facesOwned.end()) {
int count;
void* ptr;
- rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr); \
+ rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr);
CHK_ERR1(rval, "Failed to iterate tag on owned faces");
for (int j = 0; j < count; j++) {
@@ -915,7 +915,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- rval = convert_variable(vdatas[i], t); \
+ rval = convert_variable(vdatas[i], t);
CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
@@ -974,8 +974,8 @@ ErrorCode NCHelperMPAS::redistribute_local_cells(int start_cell_idx)
Interface*& mbImpl = _readNC->mbImpl;
DebugOutput& dbgOut = _readNC->dbgOut;
MBZoltan* mbZTool = new MBZoltan(mbImpl, false, 0, NULL);
- ErrorCode rval = mbZTool->repartition(xCell, yCell, zCell, start_cell_idx, "RCB", localGidCells); \
- delete mbZTool; \
+ ErrorCode rval = mbZTool->repartition(xCell, yCell, zCell, start_cell_idx, "RCB", localGidCells);
+ delete mbZTool;
CHK_ERR1(rval, "Error in Zoltan partitioning");
dbgOut.tprintf(1, "After Zoltan partitioning, localGidCells.psize() = %d\n", (int)localGidCells.psize());
@@ -1014,18 +1014,18 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
std::vector<double*> arrays;
ErrorCode rval = _readNC->readMeshIface->get_node_coords(3, nLocalVertices, 0, start_vertex, arrays,
// Might have to create gather mesh later
- (createGatherSet ? nLocalVertices + nVertices : nLocalVertices)); \
+ (createGatherSet ? nLocalVertices + nVertices : nLocalVertices));
CHK_ERR1(rval, "Failed to create local vertices");
// Add local vertices to current file set
Range local_verts_range(start_vertex, start_vertex + nLocalVertices - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_verts_range); \
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_verts_range);
CHK_ERR1(rval, "Failed to add local vertices to current file set");
// Get ptr to GID memory for local vertices
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_verts_range.begin(), local_verts_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_verts_range.begin(), local_verts_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate global id tag on local vertices");
assert(count == nLocalVertices);
int* gid_data = (int*) data;
@@ -1033,7 +1033,7 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
// Duplicate GID data, which will be used to resolve sharing
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, local_verts_range.begin(), local_verts_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(*mpFileIdTag, local_verts_range.begin(), local_verts_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate file id tag on local vertices");
assert(count == nLocalVertices);
gid_data = (int*) data;
@@ -1242,18 +1242,18 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
EntityHandle* conn_arr_edges = NULL;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(nLocalEdges, 2, MBEDGE, 0, start_edge, conn_arr_edges,
// Might have to create gather mesh later
- (createGatherSet ? nLocalEdges + nEdges : nLocalEdges)); \
+ (createGatherSet ? nLocalEdges + nEdges : nLocalEdges));
CHK_ERR1(rval, "Failed to create local edges");
// Add local edges to current file set
Range local_edges_range(start_edge, start_edge + nLocalEdges - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_edges_range); \
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_edges_range);
CHK_ERR1(rval, "Failed to add local edges to current file set");
// Get ptr to GID memory for edges
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_edges_range.begin(), local_edges_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_edges_range.begin(), local_edges_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate global id tag on local edges");
assert(count == nLocalEdges);
int* gid_data = (int*) data;
@@ -1348,19 +1348,19 @@ ErrorCode NCHelperMPAS::create_local_cells(const std::vector<int>& vertices_on_l
// Create local cells for each non-empty cell group
EntityHandle start_element;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(num_group_cells, num_edges_per_cell, MBPOLYGON, 0, start_element,
- conn_arr_local_cells_with_n_edges[num_edges_per_cell], num_group_cells); \
+ conn_arr_local_cells_with_n_edges[num_edges_per_cell], num_group_cells);
CHK_ERR1(rval, "Failed to create local cells");
faces.insert(start_element, start_element + num_group_cells - 1);
// Add local cells to current file set
Range local_cells_range(start_element, start_element + num_group_cells - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range); \
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range);
CHK_ERR1(rval, "Failed to add local cells to current file set");
// Get ptr to gid memory for local cells
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate global id tag on local cells");
assert(count == num_group_cells);
int* gid_data = (int*) data;
@@ -1404,19 +1404,19 @@ ErrorCode NCHelperMPAS::create_padded_local_cells(const std::vector<int>& vertic
EntityHandle* conn_arr_local_cells = NULL;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(nLocalCells, maxEdgesPerCell, MBPOLYGON, 0, start_element, conn_arr_local_cells,
// Might have to create gather mesh later
- (createGatherSet ? nLocalCells + nCells : nLocalCells)); \
+ (createGatherSet ? nLocalCells + nCells : nLocalCells));
CHK_ERR1(rval, "Failed to create cells");
faces.insert(start_element, start_element + nLocalCells - 1);
// Add local cells to current file set
Range local_cells_range(start_element, start_element + nLocalCells - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range); \
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range);
CHK_ERR1(rval, "Failed to add local cells to current file set");
// Get ptr to GID memory for local cells
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate global id tag on local cells");
assert(count == nLocalCells);
int* gid_data = (int*) data;
@@ -1446,12 +1446,12 @@ ErrorCode NCHelperMPAS::create_gather_set_vertices(EntityHandle gather_set, Enti
// Create gather set vertices
std::vector<double*> arrays;
// Don't need to specify allocation number here, because we know enough vertices were created before
- ErrorCode rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, gather_set_start_vertex, arrays); \
+ ErrorCode rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, gather_set_start_vertex, arrays);
CHK_ERR1(rval, "Failed to create gather set vertices");
// Add vertices to the gather set
Range gather_set_verts_range(gather_set_start_vertex, gather_set_start_vertex + nVertices - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_verts_range); \
+ rval = mbImpl->add_entities(gather_set, gather_set_verts_range);
CHK_ERR1(rval, "Failed to add vertices to the gather set");
// Read x coordinates for gather set vertices
@@ -1528,7 +1528,7 @@ ErrorCode NCHelperMPAS::create_gather_set_vertices(EntityHandle gather_set, Enti
// Get ptr to GID memory for gather set vertices
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(mGlobalIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate global id tag on gather set vertices");
assert(count == nVertices);
int* gid_data = (int*) data;
@@ -1537,7 +1537,7 @@ ErrorCode NCHelperMPAS::create_gather_set_vertices(EntityHandle gather_set, Enti
// Set the file id tag too, it should be bigger something not interfering with global id
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ rval = mbImpl->tag_iterate(*mpFileIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data);
CHK_ERR1(rval, "Failed to iterate file id tag on gather set vertices");
assert(count == nVertices);
gid_data = (int*) data;
@@ -1556,12 +1556,12 @@ ErrorCode NCHelperMPAS::create_gather_set_edges(EntityHandle gather_set, EntityH
EntityHandle start_edge;
EntityHandle* conn_arr_gather_set_edges = NULL;
// Don't need to specify allocation number here, because we know enough edges were created before
- ErrorCode rval = _readNC->readMeshIface->get_element_connect(nEdges, 2, MBEDGE, 0, start_edge, conn_arr_gather_set_edges); \
+ ErrorCode rval = _readNC->readMeshIface->get_element_connect(nEdges, 2, MBEDGE, 0, start_edge, conn_arr_gather_set_edges);
CHK_ERR1(rval, "Failed to create gather set edges");
// Add edges to the gather set
Range gather_set_edges_range(start_edge, start_edge + nEdges - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_edges_range); \
+ rval = mbImpl->add_entities(gather_set, gather_set_edges_range);
CHK_ERR1(rval, "Failed to add edges to the gather set");
// Read vertices on each edge
@@ -1672,12 +1672,12 @@ ErrorCode NCHelperMPAS::create_gather_set_cells(EntityHandle gather_set, EntityH
if (num_group_cells > 0) {
EntityHandle start_element;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(num_group_cells, num_edges_per_cell, MBPOLYGON, 0, start_element,
- conn_arr_gather_set_cells_with_n_edges[num_edges_per_cell], num_group_cells); \
+ conn_arr_gather_set_cells_with_n_edges[num_edges_per_cell], num_group_cells);
CHK_ERR1(rval, "Failed to create gather set cells");
// Add cells to the gather set
Range gather_set_cells_range(start_element, start_element + num_group_cells - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_cells_range); \
+ rval = mbImpl->add_entities(gather_set, gather_set_cells_range);
CHK_ERR1(rval, "Failed to add cells to the gather set");
for (int j = 0; j < num_group_cells; j++) {
@@ -1732,12 +1732,12 @@ ErrorCode NCHelperMPAS::create_padded_gather_set_cells(EntityHandle gather_set,
EntityHandle start_element;
EntityHandle* conn_arr_gather_set_cells = NULL;
// Don't need to specify allocation number here, because we know enough cells were created before
- ErrorCode rval = _readNC->readMeshIface->get_element_connect(nCells, maxEdgesPerCell, MBPOLYGON, 0, start_element, conn_arr_gather_set_cells); \
+ ErrorCode rval = _readNC->readMeshIface->get_element_connect(nCells, maxEdgesPerCell, MBPOLYGON, 0, start_element, conn_arr_gather_set_cells);
CHK_ERR1(rval, "Failed to create cells");
// Add cells to the gather set
Range gather_set_cells_range(start_element, start_element + nCells - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_cells_range); \
+ rval = mbImpl->add_entities(gather_set, gather_set_cells_range);
CHK_ERR1(rval, "Failed to add cells to the gather set");
// Read vertices on each gather set cell (connectivity)
diff --git a/src/io/ReadNC.cpp b/src/io/ReadNC.cpp
index fba9bce..cfda41d 100644
--- a/src/io/ReadNC.cpp
+++ b/src/io/ReadNC.cpp
@@ -50,7 +50,7 @@ ErrorCode ReadNC::load_file(const char* file_name, const EntityHandle* file_set,
// is set too, with the same data, duplicated
mpFileIdTag = file_id_tag;
- rval = parse_options(opts, var_names, tstep_nums, tstep_vals); \
+ rval = parse_options(opts, var_names, tstep_nums, tstep_vals);
CHK_ERR1(rval, "Trouble parsing option string");
// Open the file
@@ -71,7 +71,7 @@ ErrorCode ReadNC::load_file(const char* file_name, const EntityHandle* file_set,
SET_ERR(MB_FAILURE, "Trouble opening file");
// Read the header (num dimensions, dimensions, num variables, global attribs)
- rval = read_header(); \
+ rval = read_header();
CHK_ERR1(rval, "Trouble reading file header");
// Make sure there's a file set to put things in
@@ -80,7 +80,7 @@ ErrorCode ReadNC::load_file(const char* file_name, const EntityHandle* file_set,
SET_ERR(MB_FAILURE, "NOMESH option requires non-NULL file set on input");
}
else if (!file_set || (file_set && *file_set == 0)) {
- rval = mbImpl->create_meshset(MESHSET_SET, tmp_set); \
+ rval = mbImpl->create_meshset(MESHSET_SET, tmp_set);
CHK_ERR1(rval, "Trouble creating file set");
}
else
@@ -102,19 +102,19 @@ ErrorCode ReadNC::load_file(const char* file_name, const EntityHandle* file_set,
}
// Initialize mesh values
- rval = myHelper->init_mesh_vals(); \
+ rval = myHelper->init_mesh_vals();
CHK_ERR1(rval, "Trouble initializing mesh values");
// Check existing mesh from last read
if (noMesh && !noVars) {
- rval = myHelper->check_existing_mesh(); \
+ rval = myHelper->check_existing_mesh();
CHK_ERR1(rval, "Trouble checking mesh from last read");
}
// Create mesh vertex/edge/face sequences
Range faces;
if (!noMesh) {
- rval = myHelper->create_mesh(faces); \
+ rval = myHelper->create_mesh(faces);
CHK_ERR1(rval, "Trouble creating mesh");
}
@@ -140,17 +140,17 @@ ErrorCode ReadNC::load_file(const char* file_name, const EntityHandle* file_set,
// Create partition set, and populate with elements
if (isParallel) {
EntityHandle partn_set;
- rval = mbImpl->create_meshset(MESHSET_SET, partn_set); \
+ rval = mbImpl->create_meshset(MESHSET_SET, partn_set);
CHK_ERR1(rval, "Trouble creating partition set");
- rval = mbImpl->add_entities(partn_set, faces); \
+ rval = mbImpl->add_entities(partn_set, faces);
CHK_ERR1(rval, "Couldn't add new faces to partition set");
Range verts;
- rval = mbImpl->get_connectivity(faces, verts); \
+ rval = mbImpl->get_connectivity(faces, verts);
CHK_ERR1(rval, "Couldn't get verts of faces");
- rval = mbImpl->add_entities(partn_set, verts); \
+ rval = mbImpl->add_entities(partn_set, verts);
CHK_ERR1(rval, "Couldn't add new verts to partition set");
myPcomm->partition_sets().insert(partn_set);
@@ -164,7 +164,7 @@ ErrorCode ReadNC::load_file(const char* file_name, const EntityHandle* file_set,
// Create NC conventional tags when loading header info only
if (noMesh && noVars) {
- rval = myHelper->create_conventional_tags(tstep_nums); \
+ rval = myHelper->create_conventional_tags(tstep_nums);
CHK_ERR1(rval, "Trouble creating NC conventional tags");
}
@@ -284,17 +284,17 @@ ErrorCode ReadNC::read_header()
SET_ERR(MB_FAILURE, "Couldn't get number of global attributes");
// Read attributes into globalAtts
- ErrorCode result = get_attributes(NC_GLOBAL, numgatts, globalAtts); \
+ ErrorCode result = get_attributes(NC_GLOBAL, numgatts, globalAtts);
CHK_ERR1(result, "Trouble getting attributes");
dbgOut.tprintf(1, "Read %u attributes\n", (unsigned int) globalAtts.size());
// Read in dimensions into dimNames and dimLens
- result = get_dimensions(fileId, dimNames, dimLens); \
+ result = get_dimensions(fileId, dimNames, dimLens);
CHK_ERR1(result, "Trouble getting dimensions");
dbgOut.tprintf(1, "Read %u dimensions\n", (unsigned int) dimNames.size());
// Read in variables into varInfo
- result = get_variables(); \
+ result = get_variables();
CHK_ERR1(result, "Trouble getting variables");
dbgOut.tprintf(1, "Read %u variables\n", (unsigned int) varInfo.size());
@@ -416,7 +416,7 @@ ErrorCode ReadNC::get_variables()
dbgOut.tprintf(2, "Variable %s: Id=%d, numAtts=%d, datatype=%d, num_dims=%u\n", data.varName.c_str(), data.varId, data.numAtts,
data.varDataType, (unsigned int) data.varDims.size());
- ErrorCode rval = get_attributes(i, data.numAtts, data.varAtts, " "); \
+ ErrorCode rval = get_attributes(i, data.numAtts, data.varAtts, " ");
CHK_ERR1(rval, "Trouble getting attributes for a variable");
}
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.
1
0
commit/MOAB: danwu: MPAS reader should get local edges only when NO_EDGES read option is not set.
by commits-noreplyï¼ bitbucket.org 25 Mar '14
by commits-noreplyï¼ bitbucket.org 25 Mar '14
25 Mar '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/438f9d0c3e88/
Changeset: 438f9d0c3e88
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-25 19:45:04
Summary: MPAS reader should get local edges only when NO_EDGES read option is not set.
Affected #: 1 file
diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 305257e..349e17a 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -521,10 +521,14 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
assert("Should only have a single vertex subrange, since they were read in one shot" &&
verts.psize() == 1);
- // Get edges in set
+ // Get edges in set (unless NO_EDGES read option is set)
Range edges;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 1, edges); \
- CHK_ERR1(rval, "Trouble getting edges in current file set");
+ if (!noEdges) {
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 1, edges); \
+ CHK_ERR1(rval, "Trouble getting edges in current file set");
+ assert("Should only have a single edge subrange, since they were read in one shot" &&
+ edges.psize() == 1);
+ }
// Get faces in set
Range faces;
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.
1
0
Hi all,
What version(s) of OCC and CGM are tested in the MOAB nightlies?
Going to create a similar set of builds for testing on my local machine.
Thanks!
--
Patrick C. Shriwise
Research Assistant
University of Wisconsin - Madison
Engineering Research Building - Rm. 428
1500 Engineering Drive
Madison, WI 53706
(608) 446-8173
4
14
commit/MOAB: danwu: Minor changes to some error handling code in NC reader classes.
by commits-noreplyï¼ bitbucket.org 25 Mar '14
by commits-noreplyï¼ bitbucket.org 25 Mar '14
25 Mar '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/7094995cc2e2/
Changeset: 7094995cc2e2
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-25 17:13:34
Summary: Minor changes to some error handling code in NC reader classes.
Affected #: 5 files
diff --git a/src/io/NCHelper.cpp b/src/io/NCHelper.cpp
index eccb43f..8124098 100644
--- a/src/io/NCHelper.cpp
+++ b/src/io/NCHelper.cpp
@@ -938,7 +938,7 @@ ErrorCode ScdNCHelper::create_mesh(Range& faces)
tmp_range.insert(scd_box->start_element(), scd_box->start_element() + scd_box->num_elements() - 1);
tmp_range.insert(scd_box->box_set());
rval = mbImpl->add_entities(_fileSet, tmp_range); \
- CHK_ERR1(rval, "Couldn't add new vertices to file set");
+ CHK_ERR1(rval, "Couldn't add new vertices to current file set");
dbgOut.tprintf(1, "scdbox %d quads, %d vertices\n", scd_box->num_elements(), scd_box->num_vertices());
@@ -972,7 +972,7 @@ ErrorCode ScdNCHelper::create_mesh(Range& faces)
std::vector<int> gids(num_verts);
Range verts(scd_box->start_vertex(), scd_box->start_vertex() + scd_box->num_vertices() - 1);
rval = mbImpl->tag_get_data(mGlobalIdTag, verts, &gids[0]); \
- CHK_ERR1(rval, "Trouble getting gid values");
+ CHK_ERR1(rval, "Trouble getting local gid values of vertices");
int vmin = *(std::min_element(gids.begin(), gids.end())), vmax = *(std::max_element(gids.begin(), gids.end()));
dbgOut.tprintf(1, "Vertex gids %d-%d\n", vmin, vmax);
#endif
@@ -1037,18 +1037,14 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset_allocate(std::vector<ReadNC:
// Get vertices in set
Range verts;
rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts); \
- CHK_ERR1(rval, "Trouble getting vertices in set");
+ CHK_ERR1(rval, "Trouble getting vertices in current file set");
assert("Should only have a single vertex subrange, since they were read in one shot" &&
verts.psize() == 1);
- Range edges;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 1, edges); \
- CHK_ERR1(rval, "Trouble getting edges in set");
-
// Get faces in set
Range faces;
rval = mbImpl->get_entities_by_dimension(_fileSet, 2, faces); \
- CHK_ERR1(rval, "Trouble getting faces in set");
+ CHK_ERR1(rval, "Trouble getting faces in current file set");
assert("Should only have a single face subrange, since they were read in one shot" &&
faces.psize() == 1);
@@ -1058,7 +1054,7 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset_allocate(std::vector<ReadNC:
if (isParallel) {
ParallelComm*& myPcomm = _readNC->myPcomm;
rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &faces_owned); \
- CHK_ERR1(rval, "Trouble getting owned faces in set");
+ CHK_ERR1(rval, "Trouble getting owned faces in current file set");
}
else
faces_owned = faces; // Not running in parallel, but still with MPI
@@ -1095,6 +1091,7 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset_allocate(std::vector<ReadNC:
break;
case ReadNC::ENTLOCNSEDGE:
case ReadNC::ENTLOCEWEDGE:
+ case ReadNC::ENTLOCEDGE:
SET_GLB_ERR(MB_NOT_IMPLEMENTED, "Reading edge data is not implemented yet");
case ReadNC::ENTLOCFACE:
// Faces
@@ -1108,18 +1105,15 @@ ErrorCode ScdNCHelper::read_scd_variables_to_nonset_allocate(std::vector<ReadNC:
range = &faces;
#endif
break;
- case ReadNC::ENTLOCSET:
- // Set
- break;
default:
- SET_ERR_STR(MB_FAILURE, "Unrecognized entity location type for non-set variable " << vdatas[i].varName);
+ SET_ERR_STR(MB_FAILURE, "Unexpected entity location type for non-set variable " << vdatas[i].varName);
}
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Reading non-set variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
if (tstep_nums[t] >= dimLens[tDim]) {
- SET_ERR_STR(MB_INDEX_OUT_OF_RANGE, "Wrong value for a timestep number " << tstep_nums[t]);
+ SET_ERR_STR(MB_INDEX_OUT_OF_RANGE, "Wrong value for timestep number " << tstep_nums[t]);
}
// Get the tag to read into
diff --git a/src/io/NCHelper.hpp b/src/io/NCHelper.hpp
index 25103a3..12e3b0e 100644
--- a/src/io/NCHelper.hpp
+++ b/src/io/NCHelper.hpp
@@ -134,7 +134,7 @@ private:
//! Create COORDS tag for quads coordinate
ErrorCode create_quad_coordinate_tag();
- template <typename T> ErrorCode kji_to_jik(size_t ni, size_t nj, size_t nk, void* dest, T* source)
+ template <typename T> void kji_to_jik(size_t ni, size_t nj, size_t nk, void* dest, T* source)
{
size_t nik = ni * nk, nij = ni * nj;
T* tmp_data = reinterpret_cast<T*>(dest);
@@ -142,7 +142,6 @@ private:
for (std::size_t i = 0; i != ni; i++)
for (std::size_t k = 0; k != nk; k++)
tmp_data[j*nik + i*nk + k] = source[k*nij + j*ni + i];
- return MB_SUCCESS;
}
protected:
@@ -207,7 +206,7 @@ private:
protected:
//! This version takes as input the moab range, from which we actually need just the
//! size of each sequence, for a proper transpose of the data
- template <typename T> ErrorCode kji_to_jik_stride(size_t , size_t nj, size_t nk, void* dest, T* source, Range& localGid)
+ template <typename T> void kji_to_jik_stride(size_t , size_t nj, size_t nk, void* dest, T* source, Range& localGid)
{
std::size_t idxInSource = 0; // Position of the start of the stride
// For each subrange, we will transpose a matrix of size
@@ -223,7 +222,6 @@ protected:
tmp_data[idxInSource + j*nik + i*nk + k] = source[idxInSource + k*nij + j*size_range + i];
idxInSource += (size_range*nj*nk);
}
- return MB_SUCCESS;
}
//! Dimensions of global grid in file
diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index 8da3e60..7f650fd 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -384,7 +384,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
MBQUAD, 0, start_quad, conn_arr,
// Might have to create gather mesh later
(create_gathers ? num_coarse_quads + num_quads : num_coarse_quads)); \
- CHK_ERR1(rval, "Failed to create quads");
+ CHK_ERR1(rval, "Failed to create local quads");
tmp_range.insert(start_quad, start_quad + num_coarse_quads - 1);
std::copy(&tmp_conn[start_idx], &tmp_conn[start_idx + 4 * num_fine_quads], conn_arr);
std::copy(conn_arr, conn_arr + 4 * num_fine_quads, range_inserter(localGidVerts));
@@ -406,7 +406,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
rval = _readNC->readMeshIface->get_node_coords(3, nLocalVertices, 0, start_vertex, arrays,
// Might have to create gather mesh later
(create_gathers ? nLocalVertices + nVertices : nLocalVertices)); \
- CHK_ERR1(rval, "Failed to create vertices");
+ CHK_ERR1(rval, "Failed to create local vertices");
// Set vertex coordinates
Range::iterator rit;
diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 3d777c2..305257e 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -217,17 +217,15 @@ ErrorCode NCHelperMPAS::check_existing_mesh()
if (localGidVerts.empty()) {
// Get all vertices from tmp_set (it is the input set in no_mesh scenario)
Range local_verts;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts);
- if (MB_FAILURE == rval)
- return rval;
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts); \
+ CHK_ERR1(rval, "Trouble getting local vertices in current file set");
if (!local_verts.empty()) {
std::vector<int> gids(local_verts.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]);
- if (MB_FAILURE == rval)
- return rval;
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]); \
+ CHK_ERR1(rval, "Trouble getting local gid values of vertices");
// Restore localGidVerts
std::copy(gids.rbegin(), gids.rend(), range_inserter(localGidVerts));
@@ -238,17 +236,15 @@ ErrorCode NCHelperMPAS::check_existing_mesh()
if (localGidEdges.empty()) {
// Get all edges from _fileSet (it is the input set in no_mesh scenario)
Range local_edges;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 1, local_edges);
- if (MB_FAILURE == rval)
- return rval;
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 1, local_edges); \
+ CHK_ERR1(rval, "Trouble getting local edges in current file set");
if (!local_edges.empty()) {
std::vector<int> gids(local_edges.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_edges, &gids[0]);
- if (MB_FAILURE == rval)
- return rval;
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_edges, &gids[0]); \
+ CHK_ERR1(rval, "Trouble getting local gid values of edges");
// Restore localGidEdges
std::copy(gids.rbegin(), gids.rend(), range_inserter(localGidEdges));
@@ -257,19 +253,17 @@ ErrorCode NCHelperMPAS::check_existing_mesh()
}
if (localGidCells.empty()) {
- // Get all cells from tmp_set (it is the input set in no_mesh scenario)
+ // Get all cells from current file set (it is the input set in no_mesh scenario)
Range local_cells;
rval = mbImpl->get_entities_by_dimension(_fileSet, 2, local_cells);
- if (MB_FAILURE == rval)
- return rval;
+ CHK_ERR1(rval, "Trouble getting local cells in current file set");
if (!local_cells.empty()) {
std::vector<int> gids(local_cells.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_cells, &gids[0]);
- if (MB_FAILURE == rval)
- return rval;
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_cells, &gids[0]); \
+ CHK_ERR1(rval, "Trouble getting local gid values of cells");
// Restore localGidCells
std::copy(gids.rbegin(), gids.rend(), range_inserter(localGidCells));
@@ -1245,7 +1239,7 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
ErrorCode rval = _readNC->readMeshIface->get_element_connect(nLocalEdges, 2, MBEDGE, 0, start_edge, conn_arr_edges,
// Might have to create gather mesh later
(createGatherSet ? nLocalEdges + nEdges : nLocalEdges)); \
- CHK_ERR1(rval, "Failed to create edges");
+ CHK_ERR1(rval, "Failed to create local edges");
// Add local edges to current file set
Range local_edges_range(start_edge, start_edge + nLocalEdges - 1);
@@ -1351,7 +1345,7 @@ ErrorCode NCHelperMPAS::create_local_cells(const std::vector<int>& vertices_on_l
EntityHandle start_element;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(num_group_cells, num_edges_per_cell, MBPOLYGON, 0, start_element,
conn_arr_local_cells_with_n_edges[num_edges_per_cell], num_group_cells); \
- CHK_ERR1(rval, "Failed to create cells");
+ CHK_ERR1(rval, "Failed to create local cells");
faces.insert(start_element, start_element + num_group_cells - 1);
// Add local cells to current file set
@@ -1449,7 +1443,7 @@ ErrorCode NCHelperMPAS::create_gather_set_vertices(EntityHandle gather_set, Enti
std::vector<double*> arrays;
// Don't need to specify allocation number here, because we know enough vertices were created before
ErrorCode rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, gather_set_start_vertex, arrays); \
- CHK_ERR1(rval, "Failed to create vertices");
+ CHK_ERR1(rval, "Failed to create gather set vertices");
// Add vertices to the gather set
Range gather_set_verts_range(gather_set_start_vertex, gather_set_start_vertex + nVertices - 1);
@@ -1559,7 +1553,7 @@ ErrorCode NCHelperMPAS::create_gather_set_edges(EntityHandle gather_set, EntityH
EntityHandle* conn_arr_gather_set_edges = NULL;
// Don't need to specify allocation number here, because we know enough edges were created before
ErrorCode rval = _readNC->readMeshIface->get_element_connect(nEdges, 2, MBEDGE, 0, start_edge, conn_arr_gather_set_edges); \
- CHK_ERR1(rval, "Failed to create edges");
+ CHK_ERR1(rval, "Failed to create gather set edges");
// Add edges to the gather set
Range gather_set_edges_range(start_edge, start_edge + nEdges - 1);
@@ -1675,7 +1669,7 @@ ErrorCode NCHelperMPAS::create_gather_set_cells(EntityHandle gather_set, EntityH
EntityHandle start_element;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(num_group_cells, num_edges_per_cell, MBPOLYGON, 0, start_element,
conn_arr_gather_set_cells_with_n_edges[num_edges_per_cell], num_group_cells); \
- CHK_ERR1(rval, "Failed to create cells");
+ CHK_ERR1(rval, "Failed to create gather set cells");
// Add cells to the gather set
Range gather_set_cells_range(start_element, start_element + num_group_cells - 1);
diff --git a/src/io/ReadNC.cpp b/src/io/ReadNC.cpp
index 53b4dd7..fba9bce 100644
--- a/src/io/ReadNC.cpp
+++ b/src/io/ReadNC.cpp
@@ -132,9 +132,7 @@ ErrorCode ReadNC::load_file(const char* file_name, const EntityHandle* file_set,
}
if (!dim_var_names.empty()) {
- rval = myHelper->read_variables(dim_var_names, tstep_nums);
- if (MB_FAILURE == rval)
- return rval;
+ rval = myHelper->read_variables(dim_var_names, tstep_nums);CHK_ERR(rval);
}
}
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.
1
0
commit/MOAB: danwu: Applied error handling code to NCHelperHOMME.cpp
by commits-noreplyï¼ bitbucket.org 24 Mar '14
by commits-noreplyï¼ bitbucket.org 24 Mar '14
24 Mar '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/42613b31f03a/
Changeset: 42613b31f03a
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-24 20:58:23
Summary: Applied error handling code to NCHelperHOMME.cpp
Affected #: 1 file
diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index b2dea5e..8da3e60 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -5,12 +5,6 @@
#include <cmath>
-#define ERRORR(rval, str) \
- if (MB_SUCCESS != rval) {_readNC->readMeshIface->report_error("%s", str); return rval;}
-
-#define ERRORS(err, str) \
- if (err) {_readNC->readMeshIface->report_error("%s", str); return MB_FAILURE;}
-
namespace moab {
NCHelperHOMME::NCHelperHOMME(ReadNC* readNC, int fileId, const FileOptions& opts, EntityHandle fileSet)
@@ -90,7 +84,7 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
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.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'time' or 't' dimension");
}
tDim = idx;
nTimeSteps = dimLens[idx];
@@ -100,7 +94,7 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
if ((vit = std::find(dimNames.begin(), dimNames.end(), "ncol")) != dimNames.end())
idx = vit - dimNames.begin();
else {
- ERRORR(MB_FAILURE, "Couldn't find 'ncol' dimension.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'ncol' dimension");
}
vDim = idx;
nVertices = dimLens[idx];
@@ -118,7 +112,7 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
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.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'lev' or 'ilev' dimension");
}
levDim = idx;
nLevels = dimLens[idx];
@@ -128,19 +122,19 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
std::map<std::string, ReadNC::VarData>::iterator vmit;
if ((vmit = varInfo.find("lon")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
rval = read_coordinate("lon", 0, nVertices - 1, xVertVals);
- ERRORR(rval, "Trouble reading 'lon' variable.");
+ CHK_ERR1(rval, "Trouble reading 'lon' variable");
}
else {
- ERRORR(MB_FAILURE, "Couldn't find 'lon' variable.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'lon' variable");
}
// Store lat values in yVertVals
if ((vmit = varInfo.find("lat")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
rval = read_coordinate("lat", 0, nVertices - 1, yVertVals);
- ERRORR(rval, "Trouble reading 'lat' variable.");
+ CHK_ERR1(rval, "Trouble reading 'lat' variable");
}
else {
- ERRORR(MB_FAILURE, "Couldn't find 'lat' variable.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'lat' variable");
}
// Store lev values in levVals
@@ -150,7 +144,7 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
else {
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.");
+ CHK_ERR1(rval, "Trouble reading 'lev' variable");
// Decide whether down is positive
char posval[10];
@@ -161,7 +155,7 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
}
}
else {
- ERRORR(MB_FAILURE, "Couldn't find 'lev' variable.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'lev' variable");
}
}
@@ -171,15 +165,15 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
}
else {
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.");
+ rval = read_coordinate("time", 0, nTimeSteps - 1, tVals); \
+ CHK_ERR1(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.");
+ rval = read_coordinate("t", 0, nTimeSteps - 1, tVals); \
+ CHK_ERR1(rval, "Trouble reading 't' variable");
}
else {
- // If expected time variable is not available, set dummy time coordinate values to tVals
+ // If expected time variable does not exist, set dummy values to tVals
for (int t = 0; t < nTimeSteps; t++)
tVals.push_back((double)t);
}
@@ -202,8 +196,8 @@ ErrorCode NCHelperHOMME::init_mesh_vals()
}
// Hack: create dummy variables for dimensions (like ncol) with no corresponding coordinate variables
- rval = create_dummy_variables();
- ERRORR(rval, "Failed to create dummy variables.");
+ rval = create_dummy_variables(); \
+ CHK_ERR1(rval, "Failed to create dummy variables");
return MB_SUCCESS;
}
@@ -219,26 +213,22 @@ ErrorCode NCHelperHOMME::check_existing_mesh()
bool& noMesh = _readNC->noMesh;
if (noMesh && localGidVerts.empty()) {
- // We need to populate localGidVerts range with the gids of vertices from the tmp_set
+ // We need to populate localGidVerts range with the gids of vertices from current file set
// localGidVerts is important in reading the variable data into the nodes
// also, for our purposes, localGidVerts is truly the GLOBAL_ID tag data, not other
// file_id tags that could get passed around in other scenarios for parallel reading
- // for nodal_partition, this local gid is easier, should be initialized with only
- // the owned nodes
- // We need to get all vertices from tmp_set (it is the input set in no_mesh scenario)
+ // Get all vertices from current file set (it is the input set in no_mesh scenario)
Range local_verts;
- ErrorCode rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts);
- if (MB_FAILURE == rval)
- return rval;
+ ErrorCode rval = mbImpl->get_entities_by_dimension(_fileSet, 0, local_verts); \
+ CHK_ERR1(rval, "Trouble getting local vertices in current file set");
if (!local_verts.empty()) {
std::vector<int> gids(local_verts.size());
// !IMPORTANT : this has to be the GLOBAL_ID tag
- rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]);
- if (MB_FAILURE == rval)
- return rval;
+ rval = mbImpl->tag_get_data(mGlobalIdTag, local_verts, &gids[0]); \
+ CHK_ERR1(rval, "Trouble getting local gid values of vertices");
// Restore localGidVerts
std::copy(gids.rbegin(), gids.rend(), range_inserter(localGidVerts));
@@ -304,13 +294,14 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
#else
success = NCFUNC(open)(conn_fname.c_str(), 0, &connectId);
#endif
- ERRORS(success, "Failed on open.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on open");
}
std::vector<std::string> conn_names;
std::vector<int> conn_vals;
- rval = _readNC->get_dimensions(connectId, conn_names, conn_vals);
- ERRORR(rval, "Failed to get dimensions for connectivity.");
+ rval = _readNC->get_dimensions(connectId, conn_names, conn_vals); \
+ CHK_ERR1(rval, "Failed to get dimensions for connectivity");
// Read connectivity into temporary variable
int num_fine_quads = 0;
@@ -323,7 +314,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
else if ((vit = std::find(conn_names.begin(), conn_names.end(), "ncenters")) != conn_names.end())
idx = vit - conn_names.begin();
else {
- ERRORR(MB_FAILURE, "Failed to get number of quads.");
+ SET_ERR(MB_FAILURE, "Failed to get number of quads");
}
int num_quads = conn_vals[idx];
if (!isConnFile && num_quads != nCells) {
@@ -334,18 +325,21 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
// Get the connectivity into tmp_conn2 and permute into tmp_conn
int cornerVarId;
success = NCFUNC(inq_varid)(connectId, "element_corners", &cornerVarId);
- ERRORS(success, "Failed to get variable id.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of 'element_corners'");
NCDF_SIZE tmp_starts[2] = {0, 0};
NCDF_SIZE tmp_counts[2] = {4, static_cast<NCDF_SIZE>(num_quads)};
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.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get temporary connectivity");
if (isConnFile) {
// This data/connectivity file will be closed later in ReadNC::load_file()
}
else {
success = NCFUNC(close)(connectId);
- ERRORS(success, "Failed on close.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on close");
}
// Permute the connectivity
for (int i = 0; i < num_quads; i++) {
@@ -389,21 +383,21 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
rval = _readNC->readMeshIface->get_element_connect(num_coarse_quads, 4,
MBQUAD, 0, start_quad, conn_arr,
// Might have to create gather mesh later
- (create_gathers ? num_coarse_quads + num_quads : num_coarse_quads));
- ERRORR(rval, "Failed to create quads.");
+ (create_gathers ? num_coarse_quads + num_quads : num_coarse_quads)); \
+ CHK_ERR1(rval, "Failed to create quads");
tmp_range.insert(start_quad, start_quad + num_coarse_quads - 1);
std::copy(&tmp_conn[start_idx], &tmp_conn[start_idx + 4 * num_fine_quads], conn_arr);
std::copy(conn_arr, conn_arr + 4 * num_fine_quads, range_inserter(localGidVerts));
}
else {
- rval = smt.create_spectral_elems(&tmp_conn[0], num_fine_quads, 2, tmp_range, start_idx, &localGidVerts);
- ERRORR(rval, "Failed to create spectral elements.");
+ rval = smt.create_spectral_elems(&tmp_conn[0], num_fine_quads, 2, tmp_range, start_idx, &localGidVerts); \
+ CHK_ERR1(rval, "Failed to create spectral elements");
int count, v_per_e;
- rval = mbImpl->connect_iterate(tmp_range.begin(), tmp_range.end(), conn_arr, v_per_e, count);
- ERRORR(rval, "Failed to get connectivity of spectral elements.");
+ rval = mbImpl->connect_iterate(tmp_range.begin(), tmp_range.end(), conn_arr, v_per_e, count); \
+ CHK_ERR1(rval, "Failed to get connectivity of spectral elements.");
rval = mbImpl->tag_iterate(smt.spectral_vertices_tag(true), tmp_range.begin(), tmp_range.end(),
- count, (void*&)sv_ptr);
- ERRORR(rval, "Failed to get fine connectivity of spectral elements.");
+ count, (void*&)sv_ptr); \
+ CHK_ERR1(rval, "Failed to get fine connectivity of spectral elements");
}
// Create vertices
@@ -411,8 +405,8 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
std::vector<double*> arrays;
rval = _readNC->readMeshIface->get_node_coords(3, nLocalVertices, 0, start_vertex, arrays,
// Might have to create gather mesh later
- (create_gathers ? nLocalVertices + nVertices : nLocalVertices));
- ERRORR(rval, "Couldn't create vertices in HOMME mesh.");
+ (create_gathers ? nLocalVertices + nVertices : nLocalVertices)); \
+ CHK_ERR1(rval, "Failed to create vertices");
// Set vertex coordinates
Range::iterator rit;
@@ -443,16 +437,16 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
Range vert_range(start_vertex, start_vertex + nLocalVertices - 1);
void* data;
int count;
- rval = mbImpl->tag_iterate(mGlobalIdTag, vert_range.begin(), vert_range.end(), count, data);
- ERRORR(rval, "Failed to get tag iterator.");
+ rval = mbImpl->tag_iterate(mGlobalIdTag, vert_range.begin(), vert_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate global id tag on local vertices");
assert(count == nLocalVertices);
int* gid_data = (int*) data;
std::copy(localGidVerts.begin(), localGidVerts.end(), gid_data);
// Duplicate global id data, which will be used to resolve sharing
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, vert_range.begin(), vert_range.end(), count, data);
- ERRORR(rval, "Failed to get tag iterator on file id tag.");
+ rval = mbImpl->tag_iterate(*mpFileIdTag, vert_range.begin(), vert_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate file id tag on local vertices");
assert(count == nLocalVertices);
gid_data = (int*) data;
std::copy(localGidVerts.begin(), localGidVerts.end(), gid_data);
@@ -476,29 +470,29 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
}
}
- // Add new vertices and elements to the set
+ // Add new vertices and quads to current file set
faces.merge(tmp_range);
tmp_range.insert(start_vertex, start_vertex + nLocalVertices - 1);
rval = mbImpl->add_entities(_fileSet, tmp_range);
- ERRORR(rval, "Couldn't add new vertices and quads to file set.");
+ CHK_ERR1(rval, "Failed to add new vertices and quads to current file set.");
// Mark the set with the spectral order
Tag sporder;
- rval = mbImpl->tag_get_handle("SPECTRAL_ORDER", 1, MB_TYPE_INTEGER, sporder, MB_TAG_CREAT | MB_TAG_SPARSE);
- ERRORR(rval, "Couldn't create spectral order tag.");
- rval = mbImpl->tag_set_data(sporder, &_fileSet, 1, &_spectralOrder);
- ERRORR(rval, "Couldn't set value for spectral order tag.");
+ rval = mbImpl->tag_get_handle("SPECTRAL_ORDER", 1, MB_TYPE_INTEGER, sporder, MB_TAG_CREAT | MB_TAG_SPARSE); \
+ CHK_ERR1(rval, "Failed to get SPECTRAL_ORDER tag");
+ rval = mbImpl->tag_set_data(sporder, &_fileSet, 1, &_spectralOrder); \
+ CHK_ERR1(rval, "Failed to set data for SPECTRAL_ORDER tag");
if (create_gathers) {
EntityHandle gather_set;
- rval = _readNC->readMeshIface->create_gather_set(gather_set);
- ERRORR(rval, "Trouble creating gather set.");
+ rval = _readNC->readMeshIface->create_gather_set(gather_set); \
+ CHK_ERR1(rval, "Failed to create gather set");
// Create vertices
arrays.clear();
// Don't need to specify allocation number here, because we know enough verts were created before
- rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, start_vertex, arrays);
- ERRORR(rval, "Couldn't create vertices in HOMME mesh for gather set.");
+ rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, start_vertex, arrays); \
+ CHK_ERR1(rval, "Failed to create gather set vertices");
xptr = arrays[0];
yptr = arrays[1];
@@ -514,38 +508,38 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
}
// Get ptr to gid memory for vertices
- Range gather_verts(start_vertex, start_vertex + nVertices - 1);
- rval = mbImpl->tag_iterate(mGlobalIdTag, gather_verts.begin(), gather_verts.end(), count, data);
- ERRORR(rval, "Failed to get tag iterator.");
+ Range gather_set_verts_range(start_vertex, start_vertex + nVertices - 1);
+ rval = mbImpl->tag_iterate(mGlobalIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate global id tag on gather set vertices");
assert(count == nVertices);
gid_data = (int*) data;
for (int j = 1; j <= nVertices; j++)
gid_data[j - 1] = j;
// Set the file id tag too, it should be bigger something not interfering with global id
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, gather_verts.begin(), gather_verts.end(), count, data);
- ERRORR(rval, "Failed to get tag iterator in file id tag.");
+ rval = mbImpl->tag_iterate(*mpFileIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate file id tag on gather set vertices");
assert(count == nVertices);
gid_data = (int*) data;
for (int j = 1; j <= nVertices; j++)
gid_data[j - 1] = nVertices + j; // bigger than global id tag
}
- rval = mbImpl->add_entities(gather_set, gather_verts);
- ERRORR(rval, "Couldn't add vertices to gather set.");
+ rval = mbImpl->add_entities(gather_set, gather_set_verts_range); \
+ CHK_ERR1(rval, "Failed to add vertices to the gather set");
// Create quads
- Range gather_quads;
+ Range gather_set_quads_range;
// Don't need to specify allocation number here, because we know enough quads were created before
rval = _readNC->readMeshIface->get_element_connect(num_quads, 4,
- MBQUAD, 0, start_quad, conn_arr);
- ERRORR(rval, "Failed to create quads.");
- gather_quads.insert(start_quad, start_quad + num_quads - 1);
+ MBQUAD, 0, start_quad, conn_arr); \
+ CHK_ERR1(rval, "Failed to create gather set quads");
+ gather_set_quads_range.insert(start_quad, start_quad + num_quads - 1);
std::copy(&tmp_conn[0], &tmp_conn[4 * num_quads], conn_arr);
for (i = 0; i != 4 * num_quads; i++)
conn_arr[i] += start_vertex - 1; // Connectivity array is shifted by where the gather verts start
- rval = mbImpl->add_entities(gather_set, gather_quads);
- ERRORR(rval, "Couldn't add quads to gather set.");
+ rval = mbImpl->add_entities(gather_set, gather_set_quads_range); \
+ CHK_ERR1(rval, "Failed to add quads to the gather set");
}
return MB_SUCCESS;
@@ -563,8 +557,8 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_allocate(std::vector<ReadN
// Get vertices in set
Range verts;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts);
- ERRORR(rval, "Trouble getting vertices in set.");
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts); \
+ CHK_ERR1(rval, "Trouble getting vertices in current file set");
assert("Should only have a single vertex subrange, since they were read in one shot" &&
verts.psize() == 1);
@@ -598,8 +592,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_allocate(std::vector<ReadN
range = &verts;
break;
default:
- ERRORR(MB_FAILURE, "Unexpected entity location type for HOMME non-set variable.");
- break;
+ SET_ERR_STR(MB_FAILURE, "Unexpected entity location type for non-set variable " << vdatas[i].varName);
}
// Get variable size
@@ -611,20 +604,20 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_allocate(std::vector<ReadN
dbgOut.tprintf(2, "Reading variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
if (tstep_nums[t] >= dimLens[tDim]) {
- ERRORR(MB_INDEX_OUT_OF_RANGE, "Wrong value for a timestep number.");
+ SET_ERR_STR(MB_INDEX_OUT_OF_RANGE, "Wrong value for timestep number " << tstep_nums[t]);
}
// Get the tag to read into
if (!vdatas[i].varTags[t]) {
rval = get_tag_to_nonset(vdatas[i], tstep_nums[t], vdatas[i].varTags[t], vdatas[i].numLev);
- ERRORR(rval, "Trouble getting tag.");
+ CHK_ERR1_STR(rval, "Trouble getting tag for non-set variable " << vdatas[i].varName);
}
// Get ptr to tag space
void* data;
int count;
rval = mbImpl->tag_iterate(vdatas[i].varTags[t], range->begin(), range->end(), count, data);
- ERRORR(rval, "Failed to get tag iterator.");
+ CHK_ERR1_STR(rval, "Failed to get tag iterator for non-set variable " << vdatas[i].varName);
assert((unsigned)count == range->size());
vdatas[i].varDatas[t] = data;
}
@@ -638,8 +631,8 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
{
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
- ERRORR(rval, "Trouble allocating read variables.");
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
int success;
@@ -669,8 +662,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
switch (vdatas[i].varDataType) {
case NC_BYTE:
case NC_CHAR: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading byte or char type variables is not implemented yet");
}
case NC_DOUBLE: {
// Copied from float case
@@ -696,7 +688,8 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
success = NCFUNCREQG(_vara_double)(_fileId, vdatas[i].varId,
&(vdatas[i].readStarts[0]), &(vdatas[i].readCounts[0]),
&(tmpdoubledata[indexInDoubleArray]), &requests[idxReq++]);
- ERRORS(success, "Failed to read double data in loop");
+ if (success)
+ SET_ERR_STR(MB_FAILURE, "Failed to read double data in a loop for non-set variable " << vdatas[i].varName);
// We need to increment the index in double array for the
// next subrange
indexInDoubleArray += (endh - starth + 1) * 1 * vdatas[i].numLev;
@@ -704,16 +697,17 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
assert(ic == localGidVerts.psize());
success = ncmpi_wait_all(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
if (vdatas[i].numLev != 1)
// Transpose (lev, ncol) to (ncol, lev)
- success = kji_to_jik_stride(ni, nj, nk, data, &tmpdoubledata[0], localGidVerts);
+ kji_to_jik_stride(ni, nj, nk, data, &tmpdoubledata[0], localGidVerts);
else {
for (std::size_t idx = 0; idx != tmpdoubledata.size(); idx++)
((double*) data)[idx] = tmpdoubledata[idx];
}
- ERRORS(success, "Failed to read double data.");
+
break;
}
case NC_FLOAT: {
@@ -739,7 +733,8 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
success = NCFUNCREQG(_vara_float)(_fileId, vdatas[i].varId,
&(vdatas[i].readStarts[0]), &(vdatas[i].readCounts[0]),
&(tmpfloatdata[indexInFloatArray]), &requests[idxReq++]);
- ERRORS(success, "Failed to read float data in loop");
+ if (success)
+ SET_ERR_STR(MB_FAILURE, "Failed to read float data in a loop for non-set variable " << vdatas[i].varName);
// We need to increment the index in float array for the
// next subrange
indexInFloatArray += (endh - starth + 1) * 1 * vdatas[i].numLev;
@@ -747,41 +742,36 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset_async(std::vector<ReadNC::
assert(ic == localGidVerts.psize());
success = ncmpi_wait_all(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
if (vdatas[i].numLev != 1)
// Transpose (lev, ncol) to (ncol, lev)
- success = kji_to_jik_stride(ni, nj, nk, data, &tmpfloatdata[0], localGidVerts);
+ kji_to_jik_stride(ni, nj, nk, data, &tmpfloatdata[0], localGidVerts);
else {
for (std::size_t idx = 0; idx != tmpfloatdata.size(); idx++)
((float*) data)[idx] = tmpfloatdata[idx];
}
- ERRORS(success, "Failed to read float data.");
+
break;
}
case NC_INT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading int type variables is not implemented yet");
}
case NC_SHORT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading short type variables is not implemented yet");
}
default:
- success = 1;
+ SET_ERR_STR(MB_FAILURE, "Unrecognized data type for non-set variable " << vdatas[i].varName);
}
-
- if (success)
- ERRORR(MB_FAILURE, "Trouble reading variable.");
- }
- }
+ } // for (unsigned int t = 0; t < tstep_nums.size(); t++)
+ } // for (unsigned int i = 0; i < vdatas.size(); i++)
for (unsigned int i = 0; i < vdatas.size(); i++) {
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- ErrorCode tmp_rval = convert_variable(vdatas[i], t);
- if (MB_SUCCESS != tmp_rval)
- rval = tmp_rval;
+ rval = convert_variable(vdatas[i], t); \
+ CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
@@ -800,8 +790,8 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
{
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
- ERRORR(rval, "Trouble allocating read variables.");
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
int success;
@@ -824,8 +814,7 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
switch (vdatas[i].varDataType) {
case NC_BYTE:
case NC_CHAR: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading byte or char type variables is not implemented yet");
}
case NC_DOUBLE: {
// Copied from float case
@@ -849,7 +838,8 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
success = NCFUNCAG(_vara_double)(_fileId, vdatas[i].varId,
&(vdatas[i].readStarts[0]), &(vdatas[i].readCounts[0]),
&(tmpdoubledata[indexInDoubleArray]));
- ERRORS(success, "Failed to read float data in loop");
+ if (success)
+ SET_ERR_STR(MB_FAILURE, "Failed to read double data in a loop for non-set variable " << vdatas[i].varName);
// We need to increment the index in double array for the
// next subrange
indexInDoubleArray += (endh - starth + 1) * 1 * vdatas[i].numLev;
@@ -858,12 +848,12 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
if (vdatas[i].numLev != 1)
// Transpose (lev, ncol) to (ncol, lev)
- success = kji_to_jik_stride(ni, nj, nk, data, &tmpdoubledata[0], localGidVerts);
+ kji_to_jik_stride(ni, nj, nk, data, &tmpdoubledata[0], localGidVerts);
else {
for (std::size_t idx = 0; idx != tmpdoubledata.size(); idx++)
((double*) data)[idx] = tmpdoubledata[idx];
}
- ERRORS(success, "Failed to read double data.");
+
break;
}
case NC_FLOAT: {
@@ -887,7 +877,8 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
success = NCFUNCAG(_vara_float)(_fileId, vdatas[i].varId,
&(vdatas[i].readStarts[0]), &(vdatas[i].readCounts[0]),
&(tmpfloatdata[indexInFloatArray]));
- ERRORS(success, "Failed to read float data in loop");
+ if (success)
+ SET_ERR_STR(MB_FAILURE, "Failed to read float data in a loop for non-set variable " << vdatas[i].varName);
// We need to increment the index in float array for the
// next subrange
indexInFloatArray += (endh - starth + 1) * 1 * vdatas[i].numLev;
@@ -896,37 +887,31 @@ ErrorCode NCHelperHOMME::read_ucd_variables_to_nonset(std::vector<ReadNC::VarDat
if (vdatas[i].numLev != 1)
// Transpose (lev, ncol) to (ncol, lev)
- success = kji_to_jik_stride(ni, nj, nk, data, &tmpfloatdata[0], localGidVerts);
+ kji_to_jik_stride(ni, nj, nk, data, &tmpfloatdata[0], localGidVerts);
else {
for (std::size_t idx = 0; idx != tmpfloatdata.size(); idx++)
((float*) data)[idx] = tmpfloatdata[idx];
}
- ERRORS(success, "Failed to read float data.");
+
break;
}
case NC_INT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading int type variables is not implemented yet");
}
case NC_SHORT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading short type variables is not implemented yet");
}
default:
- success = 1;
+ SET_ERR_STR(MB_FAILURE, "Unrecognized data type for non-set variable " << vdatas[i].varName);
}
-
- if (success)
- ERRORR(MB_FAILURE, "Trouble reading variable.");
- }
- }
+ } // for (unsigned int t = 0; t < tstep_nums.size(); t++)
+ } // for (unsigned int i = 0; i < vdatas.size(); i++)
for (unsigned int i = 0; i < vdatas.size(); i++) {
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- ErrorCode tmp_rval = convert_variable(vdatas[i], t);
- if (MB_SUCCESS != tmp_rval)
- rval = tmp_rval;
+ rval = convert_variable(vdatas[i], t); \
+ CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
// Debug output, if requested
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.
1
0
commit/MOAB: danwu: Merged master into error_handling_enhancement
by commits-noreplyï¼ bitbucket.org 24 Mar '14
by commits-noreplyï¼ bitbucket.org 24 Mar '14
24 Mar '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/2d011a399dca/
Changeset: 2d011a399dca
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-24 15:23:47
Summary: Merged master into error_handling_enhancement
Affected #: 1 file
diff --git a/tools/mbcoupler/.gitignore b/tools/mbcoupler/.gitignore
index cfad060..2dd2db0 100644
--- a/tools/mbcoupler/.gitignore
+++ b/tools/mbcoupler/.gitignore
@@ -1,4 +1,5 @@
addfield
+datacoupler_test
elem_util_test
element_test
findpt_test
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.
1
0
commit/MOAB: danwu: Applied error handling code to NCHelperMPAS.cpp
by commits-noreplyï¼ bitbucket.org 21 Mar '14
by commits-noreplyï¼ bitbucket.org 21 Mar '14
21 Mar '14
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/aa5cf2be6072/
Changeset: aa5cf2be6072
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-21 20:09:15
Summary: Applied error handling code to NCHelperMPAS.cpp
Affected #: 1 file
diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 58093e3..3d777c2 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -10,12 +10,6 @@
#include <cmath>
-#define ERRORR(rval, str) \
- if (MB_SUCCESS != rval) {_readNC->readMeshIface->report_error("%s", str); return rval;}
-
-#define ERRORS(err, str) \
- if (err) {_readNC->readMeshIface->report_error("%s", str); return MB_FAILURE;}
-
namespace moab {
const int DEFAULT_MAX_EDGES_PER_CELL = 10;
@@ -70,7 +64,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
idx = vit - dimNames.begin();
maxEdgesPerCell = dimLens[idx];
if (maxEdgesPerCell > DEFAULT_MAX_EDGES_PER_CELL) {
- ERRORR(MB_FAILURE, "maxEdgesPerCell read from the MPAS file header has exceeded DEFAULT_MAX_EDGES_PER_CELL.");
+ SET_ERR(MB_FAILURE, "maxEdgesPerCell read from the MPAS file header has exceeded DEFAULT_MAX_EDGES_PER_CELL");
}
}
@@ -80,7 +74,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
else if ((vit = std::find(dimNames.begin(), dimNames.end(), "time")) != dimNames.end())
idx = vit - dimNames.begin();
else {
- ERRORR(MB_FAILURE, "Couldn't find 'Time' or 'time' dimension.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'Time' or 'time' dimension");
}
tDim = idx;
nTimeSteps = dimLens[idx];
@@ -89,7 +83,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
if ((vit = std::find(dimNames.begin(), dimNames.end(), "nCells")) != dimNames.end())
idx = vit - dimNames.begin();
else {
- ERRORR(MB_FAILURE, "Couldn't find 'nCells' dimension.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'nCells' dimension");
}
cDim = idx;
nCells = dimLens[idx];
@@ -98,7 +92,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
if ((vit = std::find(dimNames.begin(), dimNames.end(), "nEdges")) != dimNames.end())
idx = vit - dimNames.begin();
else {
- ERRORR(MB_FAILURE, "Couldn't find 'nEdges' dimension.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'nEdges' dimension");
}
eDim = idx;
nEdges = dimLens[idx];
@@ -108,7 +102,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
if ((vit = std::find(dimNames.begin(), dimNames.end(), "nVertices")) != dimNames.end())
idx = vit - dimNames.begin();
else {
- ERRORR(MB_FAILURE, "Couldn't find 'nVertices' dimension.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'nVertices' dimension");
}
vDim = idx;
nVertices = dimLens[idx];
@@ -117,7 +111,7 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
if ((vit = std::find(dimNames.begin(), dimNames.end(), "nVertLevels")) != dimNames.end())
idx = vit - dimNames.begin();
else {
- ERRORR(MB_FAILURE, "Couldn't find 'nVertLevels' dimension.");
+ SET_ERR(MB_FAILURE, "Couldn't find 'nVertLevels' dimension");
}
levDim = idx;
nLevels = dimLens[idx];
@@ -150,8 +144,8 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
// Note, two possible types for xtime variable: double(Time) or char(Time, StrLen)
if ((vmit = varInfo.find("xtime")) != varInfo.end() && (*vmit).second.varDims.size() == 1) {
// If xtime variable is double type, read time coordinate values to tVals
- rval = read_coordinate("xtime", 0, nTimeSteps - 1, tVals);
- ERRORR(rval, "Trouble reading 'xtime' variable.");
+ rval = read_coordinate("xtime", 0, nTimeSteps - 1, tVals); \
+ CHK_ERR1(rval, "Trouble reading 'xtime' variable");
}
else {
// If xtime variable does not exist, or it is string type, set dummy values to tVals
@@ -193,8 +187,8 @@ ErrorCode NCHelperMPAS::init_mesh_vals()
}
// Hack: create dummy variables for dimensions (like nCells) with no corresponding coordinate variables
- rval = create_dummy_variables();
- ERRORR(rval, "Failed to create dummy variables.");
+ rval = create_dummy_variables(); \
+ CHK_ERR1(rval, "Failed to create dummy variables");
return MB_SUCCESS;
}
@@ -335,8 +329,8 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
start_cell_idx++; // 0 based -> 1 based
// Redistribute local cells after trivial partition (e.g. apply Zoltan partition)
- ErrorCode rval = redistribute_local_cells(start_cell_idx);
- ERRORR(rval, "Failed to redistribute local cells after trivial partition.");
+ ErrorCode rval = redistribute_local_cells(start_cell_idx); \
+ CHK_ERR1(rval, "Failed to redistribute local cells after trivial partition");
}
else {
nLocalCells = nCells;
@@ -346,7 +340,8 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
// Read number of edges on each local cell, to calculate actual maxEdgesPerCell
int nEdgesOnCellVarId;
int success = NCFUNC(inq_varid)(_fileId, "nEdgesOnCell", &nEdgesOnCellVarId);
- ERRORS(success, "Failed to get variable id of nEdgesOnCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of nEdgesOnCell");
std::vector<int> num_edges_on_local_cells(nLocalCells);
#ifdef PNETCDF_FILE
size_t nb_reads = localGidCells.psize();
@@ -371,7 +366,8 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
success = NCFUNCAG(_vara_int)(_fileId, nEdgesOnCellVarId, &read_start, &read_count,
&(num_edges_on_local_cells[indexInArray]));
#endif
- ERRORS(success, "Failed to read nEdgesOnCell data in a loop");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read nEdgesOnCell data in a loop");
// Increment the index for next subrange
indexInArray += (endh - starth + 1);
@@ -380,7 +376,8 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
#ifdef PNETCDF_FILE
// Wait outside the loop
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
#endif
// Get local maxEdgesPerCell on this proc
@@ -405,7 +402,8 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
// Read vertices on each local cell, to get localGidVerts and cell connectivity later
int verticesOnCellVarId;
success = NCFUNC(inq_varid)(_fileId, "verticesOnCell", &verticesOnCellVarId);
- ERRORS(success, "Failed to get variable id of verticesOnCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of verticesOnCell");
std::vector<int> vertices_on_local_cells(nLocalCells * maxEdgesPerCell);
#ifdef PNETCDF_FILE
idxReq = 0;
@@ -428,7 +426,8 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
success = NCFUNCAG(_vara_int)(_fileId, verticesOnCellVarId, read_starts, read_counts,
&(vertices_on_local_cells[indexInArray]));
#endif
- ERRORS(success, "Failed to read verticesOnCell data in a loop");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnCell data in a loop");
// Increment the index for next subrange
indexInArray += (endh - starth + 1) * maxEdgesPerCell;
@@ -437,7 +436,8 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
#ifdef PNETCDF_FILE
// Wait outside the loop
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
#endif
// Correct local cell vertices array, replace the padded vertices with the last vertices
@@ -453,56 +453,56 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
// Create local vertices
EntityHandle start_vertex;
- ErrorCode rval = create_local_vertices(vertices_on_local_cells, start_vertex);
- ERRORR(rval, "Failed to create local vertices for MPAS mesh.");
+ ErrorCode rval = create_local_vertices(vertices_on_local_cells, start_vertex); \
+ CHK_ERR1(rval, "Failed to create local vertices for MPAS mesh");
// Create local edges (unless NO_EDGES read option is set)
if (!noEdges) {
- rval = create_local_edges(start_vertex, num_edges_on_local_cells);
- ERRORR(rval, "Failed to create local edges for MPAS mesh.");
+ rval = create_local_edges(start_vertex, num_edges_on_local_cells); \
+ CHK_ERR1(rval, "Failed to create local edges for MPAS mesh");
}
// Create local cells, either unpadded or padded
if (noMixedElements) {
- rval = create_padded_local_cells(vertices_on_local_cells, start_vertex, faces);
- ERRORR(rval, "Failed to create padded local cells for MPAS mesh.");
+ rval = create_padded_local_cells(vertices_on_local_cells, start_vertex, faces); \
+ CHK_ERR1(rval, "Failed to create padded local cells for MPAS mesh");
}
else {
- rval = create_local_cells(vertices_on_local_cells, num_edges_on_local_cells, start_vertex, faces);
- ERRORR(rval, "Failed to create local cells for MPAS mesh.");
+ rval = create_local_cells(vertices_on_local_cells, num_edges_on_local_cells, start_vertex, faces); \
+ CHK_ERR1(rval, "Failed to create local cells for MPAS mesh");
}
// Set tag for numCellGroups
Tag numCellGroupsTag = 0;
- rval = mbImpl->tag_get_handle("__NUM_CELL_GROUPS", 1, MB_TYPE_INTEGER, numCellGroupsTag, MB_TAG_SPARSE | MB_TAG_CREAT);
- ERRORR(rval, "Failed to get __NUM_CELL_GROUPS tag.");
- rval = mbImpl->tag_set_data(numCellGroupsTag, &_fileSet, 1, &numCellGroups);
- ERRORR(rval, "Failed to set data for __NUM_CELL_GROUPS tag.");
+ rval = mbImpl->tag_get_handle("__NUM_CELL_GROUPS", 1, MB_TYPE_INTEGER, numCellGroupsTag, MB_TAG_SPARSE | MB_TAG_CREAT); \
+ CHK_ERR1(rval, "Failed to get __NUM_CELL_GROUPS tag");
+ rval = mbImpl->tag_set_data(numCellGroupsTag, &_fileSet, 1, &numCellGroups); \
+ CHK_ERR1(rval, "Failed to set data for __NUM_CELL_GROUPS tag");
if (createGatherSet) {
EntityHandle gather_set;
- rval = _readNC->readMeshIface->create_gather_set(gather_set);
- ERRORR(rval, "Failed to create gather set.");
+ rval = _readNC->readMeshIface->create_gather_set(gather_set); \
+ CHK_ERR1(rval, "Failed to create gather set");
// Create gather set vertices
EntityHandle start_gather_set_vertex;
- rval = create_gather_set_vertices(gather_set, start_gather_set_vertex);
- ERRORR(rval, "Failed to create gather set vertices for MPAS mesh");
+ rval = create_gather_set_vertices(gather_set, start_gather_set_vertex); \
+ CHK_ERR1(rval, "Failed to create gather set vertices for MPAS mesh");
// Create gather set edges (unless NO_EDGES read option is set)
if (!noEdges) {
- rval = create_gather_set_edges(gather_set, start_gather_set_vertex);
- ERRORR(rval, "Failed to create gather set edges for MPAS mesh.");
+ rval = create_gather_set_edges(gather_set, start_gather_set_vertex); \
+ CHK_ERR1(rval, "Failed to create gather set edges for MPAS mesh");
}
// Create gather set cells, either unpadded or padded
if (noMixedElements) {
- rval = create_padded_gather_set_cells(gather_set, start_gather_set_vertex);
- ERRORR(rval, "Failed to create padded gather set cells for MPAS mesh.");
+ rval = create_padded_gather_set_cells(gather_set, start_gather_set_vertex); \
+ CHK_ERR1(rval, "Failed to create padded gather set cells for MPAS mesh");
}
else {
- rval = create_gather_set_cells(gather_set, start_gather_set_vertex);
- ERRORR(rval, "Failed to create gather set cells for MPAS mesh.");
+ rval = create_gather_set_cells(gather_set, start_gather_set_vertex); \
+ CHK_ERR1(rval, "Failed to create gather set cells for MPAS mesh");
}
}
@@ -522,28 +522,28 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
// Get vertices in set
Range verts;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts);
- ERRORR(rval, "Trouble getting vertices in set.");
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 0, verts); \
+ CHK_ERR1(rval, "Trouble getting vertices in current file set");
assert("Should only have a single vertex subrange, since they were read in one shot" &&
verts.psize() == 1);
// Get edges in set
Range edges;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 1, edges);
- ERRORR(rval, "Trouble getting edges in set.");
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 1, edges); \
+ CHK_ERR1(rval, "Trouble getting edges in current file set");
// Get faces in set
Range faces;
- rval = mbImpl->get_entities_by_dimension(_fileSet, 2, faces);
- ERRORR(rval, "Trouble getting faces in set.");
+ rval = mbImpl->get_entities_by_dimension(_fileSet, 2, faces); \
+ CHK_ERR1(rval, "Trouble getting faces in current file set");
// Note, for MPAS faces.psize() can be more than 1
#ifdef USE_MPI
bool& isParallel = _readNC->isParallel;
if (isParallel) {
ParallelComm*& myPcomm = _readNC->myPcomm;
- rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &facesOwned);
- ERRORR(rval, "Trouble getting owned faces in set.");
+ rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &facesOwned); \
+ CHK_ERR1(rval, "Trouble getting owned faces in current file set");
}
else
facesOwned = faces; // not running in parallel, but still with MPI
@@ -598,8 +598,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
range = &edges;
break;
default:
- ERRORR(MB_FAILURE, "Unexpected entity location type for MPAS non-set variable.");
- break;
+ SET_ERR_STR(MB_FAILURE, "Unexpected entity location type for non-set variable " << vdatas[i].varName);
}
// Finally: nVertLevels or other optional levels, it is possible that there
@@ -616,13 +615,13 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
dbgOut.tprintf(2, "Reading variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
if (tstep_nums[t] >= dimLens[tDim]) {
- ERRORR(MB_INDEX_OUT_OF_RANGE, "Wrong value for a timestep number.");
+ SET_ERR_STR(MB_INDEX_OUT_OF_RANGE, "Wrong value for timestep number " << tstep_nums[t]);
}
// Get the tag to read into
if (!vdatas[i].varTags[t]) {
rval = get_tag_to_nonset(vdatas[i], tstep_nums[t], vdatas[i].varTags[t], vdatas[i].numLev);
- ERRORR(rval, "Trouble getting tag.");
+ CHK_ERR1_STR(rval, "Trouble getting tag for non-set variable " << vdatas[i].varName);
}
// Get ptr to tag space
@@ -635,7 +634,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_allocate(std::vector<ReadNC
void* data;
int count;
rval = mbImpl->tag_iterate(vdatas[i].varTags[t], range->begin(), range->end(), count, data);
- ERRORR(rval, "Failed to iterate tag.");
+ CHK_ERR1_STR(rval, "Failed to get tag iterator for non-set variable " << vdatas[i].varName);
assert((unsigned)count == range->size());
vdatas[i].varDatas[t] = data;
}
@@ -652,8 +651,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
bool& noEdges = _readNC->noEdges;
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
- ERRORR(rval, "Trouble allocating read variables.");
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
int success;
@@ -675,8 +674,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
pLocalGid = &localGidEdges;
break;
default:
- ERRORR(MB_FAILURE, "Unrecognized entity location type.");
- break;
+ SET_ERR_STR(MB_FAILURE, "Unexpected entity location type for non-set variable " << vdatas[i].varName);
}
std::size_t sz = vdatas[i].sz;
@@ -694,9 +692,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
switch (vdatas[i].varDataType) {
case NC_BYTE:
case NC_CHAR: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
- }
+ SET_ERR(MB_FAILURE, "Reading byte or char type variables is not implemented yet");
+ }
case NC_DOUBLE: {
std::vector<double> tmpdoubledata(sz);
@@ -721,7 +718,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
success = NCFUNCREQG(_vara_double)(_fileId, vdatas[i].varId,
&(vdatas[i].readStarts[0]), &(vdatas[i].readCounts[0]),
&(tmpdoubledata[indexInDoubleArray]), &requests[idxReq++]);
- ERRORS(success, "Failed to read double data in loop");
+ if (success)
+ SET_ERR_STR(MB_FAILURE, "Failed to read double data in a loop for non-set variable " << vdatas[i].varName);
// We need to increment the index in double array for the
// next subrange
indexInDoubleArray += (endh - starth + 1) * 1 * vdatas[i].numLev;
@@ -729,7 +727,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
assert(ic == pLocalGid->psize());
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
if (vdatas[i].entLoc == ReadNC::ENTLOCFACE && numCellGroups > 1) {
// For a cell variable that is NOT on one contiguous chunk of faces, allocate tag space for
@@ -738,8 +737,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
while (iter != facesOwned.end()) {
int count;
void* ptr;
- rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr);
- ERRORR(rval, "Failed to iterate tag on owned faces.");
+ rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr); \
+ CHK_ERR1(rval, "Failed to iterate tag on owned faces");
for (int j = 0; j < count; j++) {
int global_cell_idx = cellHandleToGlobalID[*(iter + j)]; // Global cell index, 1 based
@@ -761,25 +760,19 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
break;
}
case NC_FLOAT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading float type variables is not implemented yet");
}
case NC_INT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading int type variables is not implemented yet");
}
case NC_SHORT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading short type variables is not implemented yet");
}
default:
- success = 1;
+ SET_ERR_STR(MB_FAILURE, "Unrecognized data type for non-set variable " << vdatas[i].varName);
}
-
- if (success)
- ERRORR(MB_FAILURE, "Trouble reading variable.");
- }
- }
+ } // for (unsigned int t = 0; t < tstep_nums.size(); t++)
+ } // for (unsigned int i = 0; i < vdatas.size(); i++)
for (unsigned int i = 0; i < vdatas.size(); i++) {
if (noEdges && vdatas[i].entLoc == ReadNC::ENTLOCEDGE)
@@ -787,9 +780,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset_async(std::vector<ReadNC::V
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- ErrorCode tmp_rval = convert_variable(vdatas[i], t);
- if (MB_SUCCESS != tmp_rval)
- rval = tmp_rval;
+ rval = convert_variable(vdatas[i], t); \
+ CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
// Debug output, if requested
@@ -809,8 +801,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
bool& noEdges = _readNC->noEdges;
DebugOutput& dbgOut = _readNC->dbgOut;
- ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums);
- ERRORR(rval, "Trouble allocating read variables.");
+ ErrorCode rval = read_ucd_variables_to_nonset_allocate(vdatas, tstep_nums); \
+ CHK_ERR1(rval, "Trouble allocating space to read non-set variables");
// Finally, read into that space
int success;
@@ -832,8 +824,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
pLocalGid = &localGidEdges;
break;
default:
- ERRORR(MB_FAILURE, "Unrecognized entity location type.");
- break;
+ SET_ERR_STR(MB_FAILURE, "Unexpected entity location type for non-set variable " << vdatas[i].varName);
}
std::size_t sz = vdatas[i].sz;
@@ -845,8 +836,7 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
switch (vdatas[i].varDataType) {
case NC_BYTE:
case NC_CHAR: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading byte or char type variables is not implemented yet");
}
case NC_DOUBLE: {
std::vector<double> tmpdoubledata(sz);
@@ -869,7 +859,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
success = NCFUNCAG(_vara_double)(_fileId, vdatas[i].varId,
&(vdatas[i].readStarts[0]), &(vdatas[i].readCounts[0]),
&(tmpdoubledata[indexInDoubleArray]));
- ERRORS(success, "Failed to read double data in loop");
+ if (success)
+ SET_ERR_STR(MB_FAILURE, "Failed to read double data in a loop for non-set variable " << vdatas[i].varName);
// We need to increment the index in double array for the
// next subrange
indexInDoubleArray += (endh - starth + 1) * 1 * vdatas[i].numLev;
@@ -883,8 +874,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
while (iter != facesOwned.end()) {
int count;
void* ptr;
- rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr);
- ERRORR(rval, "Failed to iterate tag on owned faces.");
+ rval = mbImpl->tag_iterate(vdatas[i].varTags[t], iter, facesOwned.end(), count, ptr); \
+ CHK_ERR1(rval, "Failed to iterate tag on owned faces");
for (int j = 0; j < count; j++) {
int global_cell_idx = cellHandleToGlobalID[*(iter + j)]; // Global cell index, 1 based
@@ -906,25 +897,19 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
break;
}
case NC_FLOAT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading float type variables is not implemented yet");
}
case NC_INT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading int type variables is not implemented yet");
}
case NC_SHORT: {
- ERRORR(MB_FAILURE, "not implemented");
- break;
+ SET_ERR(MB_FAILURE, "Reading short type variables is not implemented yet");
}
default:
- success = 1;
+ SET_ERR_STR(MB_FAILURE, "Unrecognized data type for non-set variable " << vdatas[i].varName);
}
-
- if (success)
- ERRORR(MB_FAILURE, "Trouble reading variable.");
- }
- }
+ } // for (unsigned int t = 0; t < tstep_nums.size(); t++)
+ } // for (unsigned int i = 0; i < vdatas.size(); i++)
for (unsigned int i = 0; i < vdatas.size(); i++) {
if (noEdges && vdatas[i].entLoc == ReadNC::ENTLOCEDGE)
@@ -932,9 +917,8 @@ ErrorCode NCHelperMPAS::read_ucd_variables_to_nonset(std::vector<ReadNC::VarData
for (unsigned int t = 0; t < tstep_nums.size(); t++) {
dbgOut.tprintf(2, "Converting variable %s, time step %d\n", vdatas[i].varName.c_str(), tstep_nums[t]);
- ErrorCode tmp_rval = convert_variable(vdatas[i], t);
- if (MB_SUCCESS != tmp_rval)
- rval = tmp_rval;
+ rval = convert_variable(vdatas[i], t); \
+ CHK_ERR1_STR(rval, "Failed to convert non-set variable " << vdatas[i].varName);
}
}
@@ -958,37 +942,43 @@ ErrorCode NCHelperMPAS::redistribute_local_cells(int start_cell_idx)
// Read x coordinates of cell centers
int xCellVarId;
int success = NCFUNC(inq_varid)(_fileId, "xCell", &xCellVarId);
- ERRORS(success, "Failed to get variable id of xCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of xCell");
std::vector<double> xCell(nLocalCells);
NCDF_SIZE read_start = static_cast<NCDF_SIZE>(start_cell_idx - 1);
NCDF_SIZE read_count = static_cast<NCDF_SIZE>(nLocalCells);
success = NCFUNCAG(_vara_double)(_fileId, xCellVarId, &read_start, &read_count, &xCell[0]);
- ERRORS(success, "Failed to read xCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read xCell data");
// Read y coordinates of cell centers
int yCellVarId;
success = NCFUNC(inq_varid)(_fileId, "yCell", &yCellVarId);
- ERRORS(success, "Failed to get variable id of yCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of yCell");
std::vector<double> yCell(nLocalCells);
success = NCFUNCAG(_vara_double)(_fileId, yCellVarId, &read_start, &read_count, &yCell[0]);
- ERRORS(success, "Failed to read yCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read yCell data");
// Read z coordinates of cell centers
int zCellVarId;
success = NCFUNC(inq_varid)(_fileId, "zCell", &zCellVarId);
- ERRORS(success, "Failed to get variable id of zCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of zCell");
std::vector<double> zCell(nLocalCells);
success = NCFUNCAG(_vara_double)(_fileId, zCellVarId, &read_start, &read_count, &zCell[0]);
- ERRORS(success, "Failed to read zCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read zCell data");
// Zoltan partition using RCB; maybe more studies would be good, as to which partition
// is better
Interface*& mbImpl = _readNC->mbImpl;
DebugOutput& dbgOut = _readNC->dbgOut;
MBZoltan* mbZTool = new MBZoltan(mbImpl, false, 0, NULL);
- ErrorCode rval = mbZTool->repartition(xCell, yCell, zCell, start_cell_idx, "RCB", localGidCells);
- delete mbZTool;
- ERRORR(rval, "Error in Zoltan partitioning.");
+ ErrorCode rval = mbZTool->repartition(xCell, yCell, zCell, start_cell_idx, "RCB", localGidCells); \
+ delete mbZTool; \
+ CHK_ERR1(rval, "Error in Zoltan partitioning");
dbgOut.tprintf(1, "After Zoltan partitioning, localGidCells.psize() = %d\n", (int)localGidCells.psize());
dbgOut.tprintf(1, " localGidCells.size() = %d\n", (int)localGidCells.size());
@@ -1026,27 +1016,27 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
std::vector<double*> arrays;
ErrorCode rval = _readNC->readMeshIface->get_node_coords(3, nLocalVertices, 0, start_vertex, arrays,
// Might have to create gather mesh later
- (createGatherSet ? nLocalVertices + nVertices : nLocalVertices));
- ERRORR(rval, "Failed to create local vertices.");
+ (createGatherSet ? nLocalVertices + nVertices : nLocalVertices)); \
+ CHK_ERR1(rval, "Failed to create local vertices");
- // Add local vertices to the file set
+ // Add local vertices to current file set
Range local_verts_range(start_vertex, start_vertex + nLocalVertices - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_verts_range);
- ERRORR(rval, "Failed to add local vertices to the file set.");
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_verts_range); \
+ CHK_ERR1(rval, "Failed to add local vertices to current file set");
// Get ptr to GID memory for local vertices
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_verts_range.begin(), local_verts_range.end(), count, data);
- ERRORR(rval, "Failed to iterate global id tag on local vertices.");
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_verts_range.begin(), local_verts_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate global id tag on local vertices");
assert(count == nLocalVertices);
int* gid_data = (int*) data;
std::copy(localGidVerts.begin(), localGidVerts.end(), gid_data);
// Duplicate GID data, which will be used to resolve sharing
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, local_verts_range.begin(), local_verts_range.end(), count, data);
- ERRORR(rval, "Failed to iterate file id tag on local vertices.");
+ rval = mbImpl->tag_iterate(*mpFileIdTag, local_verts_range.begin(), local_verts_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate file id tag on local vertices");
assert(count == nLocalVertices);
gid_data = (int*) data;
std::copy(localGidVerts.begin(), localGidVerts.end(), gid_data);
@@ -1063,7 +1053,8 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
double* xptr = arrays[0];
int xVertexVarId;
int success = NCFUNC(inq_varid)(_fileId, "xVertex", &xVertexVarId);
- ERRORS(success, "Failed to get variable id of xVertex.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of xVertex");
size_t indexInArray = 0;
for (Range::pair_iterator pair_iter = localGidVerts.pair_begin();
pair_iter != localGidVerts.pair_end();
@@ -1081,7 +1072,8 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
success = NCFUNCAG(_vara_double)(_fileId, xVertexVarId, &read_start, &read_count,
&(xptr[indexInArray]));
#endif
- ERRORS(success, "Failed to read xVertex data in a loop");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read xVertex data in a loop");
// Increment the index for next subrange
indexInArray += (endh - starth + 1);
@@ -1090,14 +1082,16 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
#ifdef PNETCDF_FILE
// Wait outside the loop
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
#endif
// Read y coordinates for local vertices
double* yptr = arrays[1];
int yVertexVarId;
success = NCFUNC(inq_varid)(_fileId, "yVertex", &yVertexVarId);
- ERRORS(success, "Failed to get variable id of yVertex.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of yVertex");
#ifdef PNETCDF_FILE
idxReq = 0;
#endif
@@ -1118,7 +1112,8 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
success = NCFUNCAG(_vara_double)(_fileId, yVertexVarId, &read_start, &read_count,
&(yptr[indexInArray]));
#endif
- ERRORS(success, "Failed to read yVertex data in a loop");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read yVertex data in a loop");
// Increment the index for next subrange
indexInArray += (endh - starth + 1);
@@ -1127,14 +1122,16 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
#ifdef PNETCDF_FILE
// Wait outside the loop
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
#endif
// Read z coordinates for local vertices
double* zptr = arrays[2];
int zVertexVarId;
success = NCFUNC(inq_varid)(_fileId, "zVertex", &zVertexVarId);
- ERRORS(success, "Failed to get variable id of zVertex.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of zVertex");
#ifdef PNETCDF_FILE
idxReq = 0;
#endif
@@ -1155,7 +1152,8 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
success = NCFUNCAG(_vara_double)(_fileId, zVertexVarId, &read_start, &read_count,
&(zptr[indexInArray]));
#endif
- ERRORS(success, "Failed to read zVertex data in a loop");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read zVertex data in a loop");
// Increment the index for next subrange
indexInArray += (endh - starth + 1);
@@ -1164,7 +1162,8 @@ ErrorCode NCHelperMPAS::create_local_vertices(const std::vector<int>& vertices_o
#ifdef PNETCDF_FILE
// Wait outside the loop
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
#endif
return MB_SUCCESS;
@@ -1179,7 +1178,8 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
// Read edges on each local cell, to get localGidEdges
int edgesOnCellVarId;
int success = NCFUNC(inq_varid)(_fileId, "edgesOnCell", &edgesOnCellVarId);
- ERRORS(success, "Failed to get variable id of edgesOnCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of edgesOnCell");
std::vector<int> edges_on_local_cells(nLocalCells * maxEdgesPerCell);
dbgOut.tprintf(1, " edges_on_local_cells.size() = %d\n", (int)edges_on_local_cells.size());
@@ -1207,7 +1207,8 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
success = NCFUNCAG(_vara_int)(_fileId, edgesOnCellVarId, read_starts, read_counts,
&(edges_on_local_cells[indexInArray]));
#endif
- ERRORS(success, "Failed to read edgesOnCell data in a loop");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read edgesOnCell data in a loop");
// Increment the index for next subrange
indexInArray += (endh - starth + 1) * maxEdgesPerCell;
@@ -1216,7 +1217,8 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
#ifdef PNETCDF_FILE
// Wait outside the loop
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
#endif
// Correct local cell edges array in the same way as local cell vertices array, replace the
@@ -1242,19 +1244,19 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
EntityHandle* conn_arr_edges = NULL;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(nLocalEdges, 2, MBEDGE, 0, start_edge, conn_arr_edges,
// Might have to create gather mesh later
- (createGatherSet ? nLocalEdges + nEdges : nLocalEdges));
- ERRORR(rval, "Failed to create edges.");
+ (createGatherSet ? nLocalEdges + nEdges : nLocalEdges)); \
+ CHK_ERR1(rval, "Failed to create edges");
- // Add local edges to the file set
+ // Add local edges to current file set
Range local_edges_range(start_edge, start_edge + nLocalEdges - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_edges_range);
- ERRORR(rval, "Failed to add local edges to the file set.");
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_edges_range); \
+ CHK_ERR1(rval, "Failed to add local edges to current file set");
// Get ptr to GID memory for edges
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_edges_range.begin(), local_edges_range.end(), count, data);
- ERRORR(rval, "Failed to iterate global id tag on local edges.");
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_edges_range.begin(), local_edges_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate global id tag on local edges");
assert(count == nLocalEdges);
int* gid_data = (int*) data;
std::copy(localGidEdges.begin(), localGidEdges.end(), gid_data);
@@ -1263,7 +1265,9 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
// Read vertices on each local edge, to get edge connectivity
success = NCFUNC(inq_varid)(_fileId, "verticesOnEdge", &verticesOnEdgeVarId);
- ERRORS(success, "Failed to get variable id of verticesOnEdge.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of verticesOnEdge");
+
// Utilize the memory storage pointed by conn_arr_edges
int* vertices_on_local_edges = (int*) conn_arr_edges;
#ifdef PNETCDF_FILE
@@ -1289,7 +1293,8 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
success = NCFUNCAG(_vara_int)(_fileId, verticesOnEdgeVarId, read_starts, read_counts,
&(vertices_on_local_edges[indexInArray]));
#endif
- ERRORS(success, "Failed to read verticesOnEdge data in a loop");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnEdge data in a loop");
// Increment the index for next subrange
indexInArray += (endh - starth + 1) * 2;
@@ -1298,7 +1303,8 @@ ErrorCode NCHelperMPAS::create_local_edges(EntityHandle start_vertex, const std:
#ifdef PNETCDF_FILE
// Wait outside the loop
success = NCFUNC(wait_all)(_fileId, requests.size(), &requests[0], &statuss[0]);
- ERRORS(success, "Failed on wait_all.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed on wait_all");
#endif
// Populate connectivity data for local edges
@@ -1344,20 +1350,20 @@ ErrorCode NCHelperMPAS::create_local_cells(const std::vector<int>& vertices_on_l
// Create local cells for each non-empty cell group
EntityHandle start_element;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(num_group_cells, num_edges_per_cell, MBPOLYGON, 0, start_element,
- conn_arr_local_cells_with_n_edges[num_edges_per_cell], num_group_cells);
- ERRORR(rval, "Failed to create cells");
+ conn_arr_local_cells_with_n_edges[num_edges_per_cell], num_group_cells); \
+ CHK_ERR1(rval, "Failed to create cells");
faces.insert(start_element, start_element + num_group_cells - 1);
- // Add local cells to the file set
+ // Add local cells to current file set
Range local_cells_range(start_element, start_element + num_group_cells - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range);
- ERRORR(rval, "Failed to add local cells to the file set.");
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range); \
+ CHK_ERR1(rval, "Failed to add local cells to current file set");
// Get ptr to gid memory for local cells
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data);
- ERRORR(rval, "Failed to iterate global id tag on local cells.");
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate global id tag on local cells");
assert(count == num_group_cells);
int* gid_data = (int*) data;
std::copy(local_cells_with_n_edges[num_edges_per_cell].begin(), local_cells_with_n_edges[num_edges_per_cell].end(), gid_data);
@@ -1400,20 +1406,20 @@ ErrorCode NCHelperMPAS::create_padded_local_cells(const std::vector<int>& vertic
EntityHandle* conn_arr_local_cells = NULL;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(nLocalCells, maxEdgesPerCell, MBPOLYGON, 0, start_element, conn_arr_local_cells,
// Might have to create gather mesh later
- (createGatherSet ? nLocalCells + nCells : nLocalCells));
- ERRORR(rval, "Failed to create cells.");
+ (createGatherSet ? nLocalCells + nCells : nLocalCells)); \
+ CHK_ERR1(rval, "Failed to create cells");
faces.insert(start_element, start_element + nLocalCells - 1);
- // Add local cells to the file set
+ // Add local cells to current file set
Range local_cells_range(start_element, start_element + nLocalCells - 1);
- rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range);
- ERRORR(rval, "Failed to add local cells to the file set.");
+ rval = _readNC->mbImpl->add_entities(_fileSet, local_cells_range); \
+ CHK_ERR1(rval, "Failed to add local cells to current file set");
// Get ptr to GID memory for local cells
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data);
- ERRORR(rval, "Failed to iterate global id tag on local cells.");
+ rval = mbImpl->tag_iterate(mGlobalIdTag, local_cells_range.begin(), local_cells_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate global id tag on local cells");
assert(count == nLocalCells);
int* gid_data = (int*) data;
std::copy(localGidCells.begin(), localGidCells.end(), gid_data);
@@ -1442,75 +1448,90 @@ ErrorCode NCHelperMPAS::create_gather_set_vertices(EntityHandle gather_set, Enti
// Create gather set vertices
std::vector<double*> arrays;
// Don't need to specify allocation number here, because we know enough vertices were created before
- ErrorCode rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, gather_set_start_vertex, arrays);
- ERRORR(rval, "Failed to create vertices.");
+ ErrorCode rval = _readNC->readMeshIface->get_node_coords(3, nVertices, 0, gather_set_start_vertex, arrays); \
+ CHK_ERR1(rval, "Failed to create vertices");
// Add vertices to the gather set
Range gather_set_verts_range(gather_set_start_vertex, gather_set_start_vertex + nVertices - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_verts_range);
- ERRORR(rval, "Failed to add vertices to the gather set.");
+ rval = mbImpl->add_entities(gather_set, gather_set_verts_range); \
+ CHK_ERR1(rval, "Failed to add vertices to the gather set");
// Read x coordinates for gather set vertices
double* xptr = arrays[0];
int xVertexVarId;
int success = NCFUNC(inq_varid)(_fileId, "xVertex", &xVertexVarId);
- ERRORS(success, "Failed to get variable id of xVertex.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of xVertex");
NCDF_SIZE read_start = 0;
NCDF_SIZE read_count = static_cast<NCDF_SIZE>(nVertices);
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_double)(_fileId, xVertexVarId, &read_start, &read_count, xptr);
- ERRORS(success, "Failed to read xVertex data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read xVertex data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_double)(_fileId, xVertexVarId, &read_start, &read_count, xptr);
- ERRORS(success, "Failed to read xVertex data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read xVertex data");
#endif
// Read y coordinates for gather set vertices
double* yptr = arrays[1];
int yVertexVarId;
success = NCFUNC(inq_varid)(_fileId, "yVertex", &yVertexVarId);
- ERRORS(success, "Failed to get variable id of yVertex.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of yVertex");
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_double)(_fileId, yVertexVarId, &read_start, &read_count, yptr);
- ERRORS(success, "Failed to read yVertex data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read yVertex data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_double)(_fileId, yVertexVarId, &read_start, &read_count, yptr);
- ERRORS(success, "Failed to read yVertex data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read yVertex data");
#endif
// Read z coordinates for gather set vertices
double* zptr = arrays[2];
int zVertexVarId;
success = NCFUNC(inq_varid)(_fileId, "zVertex", &zVertexVarId);
- ERRORS(success, "Failed to get variable id of zVertex.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of zVertex");
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_double)(_fileId, zVertexVarId, &read_start, &read_count, zptr);
- ERRORS(success, "Failed to read zVertex data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read zVertex data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_double)(_fileId, zVertexVarId, &read_start, &read_count, zptr);
- ERRORS(success, "Failed to read zVertex data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read zVertex data");
#endif
// Get ptr to GID memory for gather set vertices
int count = 0;
void* data = NULL;
- rval = mbImpl->tag_iterate(mGlobalIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data);
- ERRORR(rval, "Failed to iterate global id tag on gather set vertices.");
+ rval = mbImpl->tag_iterate(mGlobalIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate global id tag on gather set vertices");
assert(count == nVertices);
int* gid_data = (int*) data;
for (int j = 1; j <= nVertices; j++)
@@ -1518,8 +1539,8 @@ ErrorCode NCHelperMPAS::create_gather_set_vertices(EntityHandle gather_set, Enti
// Set the file id tag too, it should be bigger something not interfering with global id
if (mpFileIdTag) {
- rval = mbImpl->tag_iterate(*mpFileIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data);
- ERRORR(rval, "Failed to iterate file id tag on gather set vertices.");
+ rval = mbImpl->tag_iterate(*mpFileIdTag, gather_set_verts_range.begin(), gather_set_verts_range.end(), count, data); \
+ CHK_ERR1(rval, "Failed to iterate file id tag on gather set vertices");
assert(count == nVertices);
gid_data = (int*) data;
for (int j = 1; j <= nVertices; j++)
@@ -1537,18 +1558,19 @@ ErrorCode NCHelperMPAS::create_gather_set_edges(EntityHandle gather_set, EntityH
EntityHandle start_edge;
EntityHandle* conn_arr_gather_set_edges = NULL;
// Don't need to specify allocation number here, because we know enough edges were created before
- ErrorCode rval = _readNC->readMeshIface->get_element_connect(nEdges, 2, MBEDGE, 0, start_edge, conn_arr_gather_set_edges);
- ERRORR(rval, "Failed to create edges.");
+ ErrorCode rval = _readNC->readMeshIface->get_element_connect(nEdges, 2, MBEDGE, 0, start_edge, conn_arr_gather_set_edges); \
+ CHK_ERR1(rval, "Failed to create edges");
// Add edges to the gather set
Range gather_set_edges_range(start_edge, start_edge + nEdges - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_edges_range);
- ERRORR(rval, "Failed to add edges to the gather set.");
+ rval = mbImpl->add_entities(gather_set, gather_set_edges_range); \
+ CHK_ERR1(rval, "Failed to add edges to the gather set");
// Read vertices on each edge
int verticesOnEdgeVarId;
int success = NCFUNC(inq_varid)(_fileId, "verticesOnEdge", &verticesOnEdgeVarId);
- ERRORS(success, "Failed to get variable id of verticesOnEdge.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of verticesOnEdge");
// Utilize the memory storage pointed by conn_arr_gather_set_edges
int* vertices_on_gather_set_edges = (int*) conn_arr_gather_set_edges;
NCDF_SIZE read_starts[2] = {0, 0};
@@ -1556,14 +1578,18 @@ ErrorCode NCHelperMPAS::create_gather_set_edges(EntityHandle gather_set, EntityH
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_int)(_fileId, verticesOnEdgeVarId, read_starts, read_counts, vertices_on_gather_set_edges);
- ERRORS(success, "Failed to read verticesOnEdge data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnEdge data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_int)(_fileId, verticesOnEdgeVarId, read_starts, read_counts, vertices_on_gather_set_edges);
- ERRORS(success, "Failed to read verticesOnEdge data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnEdge data");
#endif
// Populate connectivity data for gather set edges
@@ -1586,41 +1612,51 @@ ErrorCode NCHelperMPAS::create_gather_set_cells(EntityHandle gather_set, EntityH
// Read number of edges on each gather set cell
int nEdgesOnCellVarId;
int success = NCFUNC(inq_varid)(_fileId, "nEdgesOnCell", &nEdgesOnCellVarId);
- ERRORS(success, "Failed to get variable id of nEdgesOnCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of nEdgesOnCell");
std::vector<int> num_edges_on_gather_set_cells(nCells);
NCDF_SIZE read_start = 0;
NCDF_SIZE read_count = static_cast<NCDF_SIZE>(nCells);
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_int)(_fileId, nEdgesOnCellVarId, &read_start, &read_count, &num_edges_on_gather_set_cells[0]);
- ERRORS(success, "Failed to read nEdgesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read nEdgesOnCell data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_int)(_fileId, nEdgesOnCellVarId, &read_start, &read_count, &num_edges_on_gather_set_cells[0]);
- ERRORS(success, "Failed to read nEdgesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read nEdgesOnCell data");
#endif
// Read vertices on each gather set cell (connectivity)
int verticesOnCellVarId;
success = NCFUNC(inq_varid)(_fileId, "verticesOnCell", &verticesOnCellVarId);
- ERRORS(success, "Failed to get variable id of verticesOnCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of verticesOnCell");
std::vector<int> vertices_on_gather_set_cells(nCells * maxEdgesPerCell);
NCDF_SIZE read_starts[2] = {0, 0};
NCDF_SIZE read_counts[2] = {static_cast<NCDF_SIZE>(nCells), static_cast<NCDF_SIZE>(maxEdgesPerCell)};
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_int)(_fileId, verticesOnCellVarId, read_starts, read_counts, &vertices_on_gather_set_cells[0]);
- ERRORS(success, "Failed to read verticesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnCell data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_int)(_fileId, verticesOnCellVarId, read_starts, read_counts, &vertices_on_gather_set_cells[0]);
- ERRORS(success, "Failed to read verticesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnCell data");
#endif
// Divide gather set cells into groups based on the number of edges
@@ -1638,13 +1674,13 @@ ErrorCode NCHelperMPAS::create_gather_set_cells(EntityHandle gather_set, EntityH
if (num_group_cells > 0) {
EntityHandle start_element;
ErrorCode rval = _readNC->readMeshIface->get_element_connect(num_group_cells, num_edges_per_cell, MBPOLYGON, 0, start_element,
- conn_arr_gather_set_cells_with_n_edges[num_edges_per_cell], num_group_cells);
- ERRORR(rval, "Failed to create cells.");
+ conn_arr_gather_set_cells_with_n_edges[num_edges_per_cell], num_group_cells); \
+ CHK_ERR1(rval, "Failed to create cells");
// Add cells to the gather set
Range gather_set_cells_range(start_element, start_element + num_group_cells - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_cells_range);
- ERRORR(rval, "Failed to add cells to the gather set.");
+ rval = mbImpl->add_entities(gather_set, gather_set_cells_range); \
+ CHK_ERR1(rval, "Failed to add cells to the gather set");
for (int j = 0; j < num_group_cells; j++) {
int gather_set_cell_idx = gather_set_cells_with_n_edges[num_edges_per_cell][j]; // Global cell index, 1 based
@@ -1672,39 +1708,46 @@ ErrorCode NCHelperMPAS::create_padded_gather_set_cells(EntityHandle gather_set,
// Read number of edges on each gather set cell
int nEdgesOnCellVarId;
int success = NCFUNC(inq_varid)(_fileId, "nEdgesOnCell", &nEdgesOnCellVarId);
- ERRORS(success, "Failed to get variable id of nEdgesOnCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of nEdgesOnCell");
std::vector<int> num_edges_on_gather_set_cells(nCells);
NCDF_SIZE read_start = 0;
NCDF_SIZE read_count = static_cast<NCDF_SIZE>(nCells);
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_int)(_fileId, nEdgesOnCellVarId, &read_start, &read_count, &num_edges_on_gather_set_cells[0]);
- ERRORS(success, "Failed to read nEdgesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read nEdgesOnCell data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_int)(_fileId, nEdgesOnCellVarId, &read_start, &read_count, &num_edges_on_gather_set_cells[0]);
- ERRORS(success, "Failed to read nEdgesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read nEdgesOnCell data");
#endif
// Create gather set cells
EntityHandle start_element;
EntityHandle* conn_arr_gather_set_cells = NULL;
// Don't need to specify allocation number here, because we know enough cells were created before
- ErrorCode rval = _readNC->readMeshIface->get_element_connect(nCells, maxEdgesPerCell, MBPOLYGON, 0, start_element, conn_arr_gather_set_cells);
- ERRORR(rval, "Failed to create cells.");
+ ErrorCode rval = _readNC->readMeshIface->get_element_connect(nCells, maxEdgesPerCell, MBPOLYGON, 0, start_element, conn_arr_gather_set_cells); \
+ CHK_ERR1(rval, "Failed to create cells");
// Add cells to the gather set
Range gather_set_cells_range(start_element, start_element + nCells - 1);
- rval = mbImpl->add_entities(gather_set, gather_set_cells_range);
- ERRORR(rval, "Failed to add cells to the gather set.");
+ rval = mbImpl->add_entities(gather_set, gather_set_cells_range); \
+ CHK_ERR1(rval, "Failed to add cells to the gather set");
// Read vertices on each gather set cell (connectivity)
int verticesOnCellVarId;
success = NCFUNC(inq_varid)(_fileId, "verticesOnCell", &verticesOnCellVarId);
- ERRORS(success, "Failed to get variable id of verticesOnCell.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to get variable id of verticesOnCell");
+
// Utilize the memory storage pointed by conn_arr_gather_set_cells
int* vertices_on_gather_set_cells = (int*) conn_arr_gather_set_cells;
NCDF_SIZE read_starts[2] = {0, 0};
@@ -1712,14 +1755,18 @@ ErrorCode NCHelperMPAS::create_padded_gather_set_cells(EntityHandle gather_set,
#ifdef PNETCDF_FILE
// Enter independent I/O mode, since this read is only for the gather processor
success = NCFUNC(begin_indep_data)(_fileId);
- ERRORS(success, "Failed to begin independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to begin independent I/O mode");
success = NCFUNCG(_vara_int)(_fileId, verticesOnCellVarId, read_starts, read_counts, vertices_on_gather_set_cells);
- ERRORS(success, "Failed to read verticesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnCell data");
success = NCFUNC(end_indep_data)(_fileId);
- ERRORS(success, "Failed to end independent I/O mode.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to end independent I/O mode");
#else
success = NCFUNCG(_vara_int)(_fileId, verticesOnCellVarId, read_starts, read_counts, vertices_on_gather_set_cells);
- ERRORS(success, "Failed to read verticesOnCell data.");
+ if (success)
+ SET_ERR(MB_FAILURE, "Failed to read verticesOnCell data");
#endif
// Correct gather set cell vertices array in the same way as local cell vertices array,
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.
1
0
21 Mar '14
On Sat, Mar 15, 2014 at 4:52 PM, Andrew Davis
<andrewdavis.davis(a)gmail.com>wrote:
> Comping with verbose mode suggests that headers variable is not set
> correctly
>
> cd /data/opt/pyne/build/pyne && /usr/bin/c++ -D_dagmc_EXPORTS
> -D__LINUX__ -DJSON_IS_AMALGAMATION -O3 -DNDEBUG -fPIC
> -I/data/opt/dagmc/hdf5/include
> -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/data/opt/pyne/cpp
> -I/usr/include/python2.7 -o CMakeFiles/_dagmc.dir/_dagmc.cxx.o -c
> /data/opt/pyne/build/pyne/_dagmc.cxx
>
>
> So is there somekind of mismatch between the MOAB_INCLUDE_DIRS env wanted
> by cmake/FindMOAB and the MOAB_INCLUDE_DIR suggested by the cmake build
> echo.
>
Hey Andy,
There very well might be. I am not super confident in the FindMOAB.cmake.
This seems like the thing that MOAB itself should support. Maybe they do
and I missed it when I wrote the dagmc wrapper. For expediency, I just used
the best thing that I found online. It could probably use love & official
support.
Be Well
Anthony
>
> Andy
>
>
>
>
> On Sat, Mar 15, 2014 at 4:44 PM, Andrew Davis <andrewdavis.davis(a)gmail.com
> > wrote:
>
>> Can anyone confirm is this is true? When I try it I get the following
>>
>> python setup.py install --user --
>> -DMOAB_INCLUDE_DIR=/data/opt/dagmc/moab/include
>> -DMOAB_LIBRARY=/data/opt/dagmc/moab/lib/libMOAB.so
>>
>> It finds MOAB,
>>
>> -- Found MOAB: /data/opt/dagmc/moab/lib/libMOAB.so
>> -- MOAB header files: /data/opt/dagmc/moab/include
>> -- MOAB library: /data/opt/dagmc/moab/lib/libMOAB.so
>> -- MOAB Found: TRUE
>>
>> Then fails during build
>>
>> /data/opt/pyne/build/pyne/_dagmc.cxx:322:26: fatal error: moab/Types.hpp:
>> No such file or directory
>> #include "moab/Types.hpp"
>> ^
>> compilation terminated.
>> make[2]: *** [pyne/CMakeFiles/_dagmc.dir/_dagmc.cxx.o] Error 1
>> make[1]: *** [pyne/CMakeFiles/_dagmc.dir/all] Error 2
>> make: *** [all] Error 2
>> Traceback (most recent call last):
>> File "setup.py", line 106, in <module>
>> main()
>> File "setup.py", line 100, in main
>> main_body()
>> File "setup.py", line 91, in main_body
>> rtn = subprocess.check_call(['make'] + make_args, cwd='build')
>> File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
>> raise CalledProcessError(retcode, cmd)
>> subprocess.CalledProcessError: Command '['make']' returned non-zero exit
>> status 2
>>
>> My MOAB is setup correctly, this is a fresh pull from staging, I can
>> confirm that the header is where it should be.
>>
>> Any ideas?
>>
>> Thanks
>>
>> Andy
>>
>>
>> On Mon, Mar 10, 2014 at 1:31 PM, Elliott Biondo <Biondo(a)wisc.edu> wrote:
>>
>>> I actually ran into this last week. Anthony helped me with the cmake
>>> flags:
>>>
>>> python setup.py install --user --
>>> -DMOAB_INCLUDE_DIR=/PATH/TO/MOAB/include
>>> -DMOAB_LIBRARY=/PATH/TO/MOAB/lib/libMOAB.so
>>>
>>>
>>> On Mon, Mar 10, 2014 at 12:42 PM, Matthew Gidden <gidden(a)wisc.edu>wrote:
>>>
>>>> It will involve setting pyne's cmake flags, where the setup looks like
>>>>
>>>> ```
>>>> setup.py install <python flags> -- <cmake flags>
>>>> ```
>>>>
>>>> You can see such an example in moab_build.sh in pyne-ci.
>>>>
>>>>
>>>> On Mon, Mar 10, 2014 at 12:41 PM, Paul Wilson <wilsonp(a)engr.wisc.edu>wrote:
>>>>
>>>>> Hmmmm... I guess I can look in the pyne-ci repo... I'll do that.
>>>>>
>>>>> Paul
>>>>>
>>>>>
>>>>> On 03/10/2014 12:31 PM, Paul Wilson wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Do we have any install instructions that describe how to pass the
>>>>>> right path and variable info to build PyNE with MOAB? I don't see it at
>>>>>> pyne.io or the README.
>>>>>>
>>>>>> Paul
>>>>>>
>>>>>>
>>>>> --
>>>>> -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
>>>>> Paul Wilson ~ UW-Madison ~ 608-263-0807 ~ cal: http://bit.ly/pphw-cal
>>>>> Professor, Engineering Physics. ~ http://cnerg.engr.wisc.edu
>>>>> Faculty Director, Advanced Computing Infrastructure
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Matthew Gidden
>>>> Ph.D. Candidate, Nuclear Engineering
>>>> The University of Wisconsin -- Madison
>>>> Ph. 225.892.3192
>>>>
>>>> --
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "PyNE" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to pyne-dev+unsubscribe(a)googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Elliott D. Biondo
>>> Nuclear Regulatory Commission Fellow
>>> Computational Nuclear Engineering Research Group (CNERG)
>>> Department of Nuclear Engineering and Engineering Physics
>>> University of Wisconsin - Madison
>>>
>>> 434 Engineering Research Building
>>> 1500 Engineering Drive
>>> Madison, WI 53706
>>>
>>> Calendar<https://www.google.com/calendar/embed?src=elliott.biondo%40gmail.com&ctz=Am…>
>>>
>>> --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "PyNE" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to pyne-dev+unsubscribe(a)googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "PyNE" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyne-dev+unsubscribe(a)googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
3
3