@@ -60,7 +60,7 @@ def bisect(mesh):
6060 quad = np .empty ((0 , 4 ), dtype = np .int32 )
6161 qmap = mapper ()
6262 hexa = np .empty ((0 , 8 ), dtype = np .int32 )
63- hmap = mapper ()
63+ # hmap = mapper()
6464
6565 if (mesh .edge2 is not None and
6666 mesh .edge2 .size != + 0 ):
@@ -73,10 +73,12 @@ def bisect(mesh):
7373 edge = np .concatenate (
7474 (edge , cell [:, (0 , 1 )]), axis = 0 )
7575
76+ indx = np .arange (0 , ncel )
77+
7678 emap .edge2 .index = \
7779 np .empty ((ncel , 1 ), dtype = np .int32 )
7880 emap .edge2 .index [:, 0 ] = \
79- np . arange ( 0 , ncel ) + ncel * 0 + nedg
81+ indx + ncel * 0 + nedg
8082
8183 if (mesh .tria3 is not None and
8284 mesh .tria3 .size != + 0 ):
@@ -93,14 +95,16 @@ def bisect(mesh):
9395 edge = np .concatenate (
9496 (edge , cell [:, (2 , 0 )]), axis = 0 )
9597
98+ indx = np .arange (0 , ncel )
99+
96100 emap .tria3 .index = \
97101 np .empty ((ncel , 3 ), dtype = np .int32 )
98102 emap .tria3 .index [:, 0 ] = \
99- np . arange ( 0 , ncel ) + ncel * 0 + nedg
103+ indx + ncel * 0 + nedg
100104 emap .tria3 .index [:, 1 ] = \
101- np . arange ( 0 , ncel ) + ncel * 1 + nedg
105+ indx + ncel * 1 + nedg
102106 emap .tria3 .index [:, 2 ] = \
103- np . arange ( 0 , ncel ) + ncel * 2 + nedg
107+ indx + ncel * 2 + nedg
104108
105109 if (mesh .quad4 is not None and
106110 mesh .quad4 .size != + 0 ):
@@ -123,21 +127,23 @@ def bisect(mesh):
123127 edge = np .concatenate (
124128 (edge , cell [:, (3 , 0 )]), axis = 0 )
125129
130+ indx = np .arange (0 , ncel )
131+
126132 qmap .quad4 .index = \
127133 np .empty ((ncel , 1 ), dtype = np .int32 )
128134 qmap .quad4 .index [:, 0 ] = \
129- np . arange ( 0 , ncel ) + ncel * 0 + nfac
135+ indx + ncel * 0 + nfac
130136
131137 emap .quad4 .index = \
132138 np .empty ((ncel , 4 ), dtype = np .int32 )
133139 emap .quad4 .index [:, 0 ] = \
134- np . arange ( 0 , ncel ) + ncel * 0 + nedg
140+ indx + ncel * 0 + nedg
135141 emap .quad4 .index [:, 1 ] = \
136- np . arange ( 0 , ncel ) + ncel * 1 + nedg
142+ indx + ncel * 1 + nedg
137143 emap .quad4 .index [:, 2 ] = \
138- np . arange ( 0 , ncel ) + ncel * 2 + nedg
144+ indx + ncel * 2 + nedg
139145 emap .quad4 .index [:, 3 ] = \
140- np . arange ( 0 , ncel ) + ncel * 3 + nedg
146+ indx + ncel * 3 + nedg
141147
142148 if (mesh .tria4 is not None and
143149 mesh .tria4 .size != + 0 ):
@@ -160,20 +166,22 @@ def bisect(mesh):
160166 edge = np .concatenate (
161167 (edge , cell [:, (2 , 3 )]), axis = 0 )
162168
169+ indx = np .arange (0 , ncel )
170+
163171 emap .tria4 .index = \
164172 np .empty ((ncel , 6 ), dtype = np .int32 )
165173 emap .tria4 .index [:, 0 ] = \
166- np . arange ( 0 , ncel ) + ncel * 0 + nedg
174+ indx + ncel * 0 + nedg
167175 emap .tria4 .index [:, 1 ] = \
168- np . arange ( 0 , ncel ) + ncel * 1 + nedg
176+ indx + ncel * 1 + nedg
169177 emap .tria4 .index [:, 2 ] = \
170- np . arange ( 0 , ncel ) + ncel * 2 + nedg
178+ indx + ncel * 2 + nedg
171179 emap .tria4 .index [:, 3 ] = \
172- np . arange ( 0 , ncel ) + ncel * 3 + nedg
180+ indx + ncel * 3 + nedg
173181 emap .tria4 .index [:, 4 ] = \
174- np . arange ( 0 , ncel ) + ncel * 4 + nedg
182+ indx + ncel * 4 + nedg
175183 emap .tria4 .index [:, 5 ] = \
176- np . arange ( 0 , ncel ) + ncel * 5 + nedg
184+ indx + ncel * 5 + nedg
177185
178186 if (mesh .hexa8 is not None and
179187 mesh .hexa8 .size != + 0 ):
@@ -351,7 +359,7 @@ def bisect(mesh):
351359 nold = np .size (vert , 0 )
352360 nnew = np .size (hmid , 0 )
353361
354- qnew = nold + np .arange (+ 0 , nnew )
362+ hnew = nold + np .arange (+ 0 , nnew )
355363
356364 vnew = np .empty (
357365 nnew , dtype = mesh .point .dtype )
@@ -741,23 +749,18 @@ def bisect(mesh):
741749 mesh .tria4 = np .concatenate (
742750 (tria1 , tria2 ,
743751 tria3 , tria4 ,
744- # 1st subdiv. of octahedron
745- triaA [index [:, 2 ] == 0 ],
752+ triaA [index [:, 2 ] == 0 ], # subdiv. 1
746753 triaB [index [:, 2 ] == 0 ],
747754 triaC [index [:, 2 ] == 0 ],
748755 triaD [index [:, 2 ] == 0 ],
749- # 2nd subdiv. of octahedron
750- triaE [index [:, 2 ] == 1 ],
756+ triaE [index [:, 2 ] == 1 ], # subdiv. 2
751757 triaF [index [:, 2 ] == 1 ],
752758 triaG [index [:, 2 ] == 1 ],
753759 triaH [index [:, 2 ] == 1 ],
754- # 3rd subdiv. of octahedron
755- triaI [index [:, 2 ] == 2 ],
760+ triaI [index [:, 2 ] == 2 ], # subdiv. 3
756761 triaJ [index [:, 2 ] == 2 ],
757762 triaK [index [:, 2 ] == 2 ],
758- triaL [index [:, 2 ] == 2 ]), axis = 0 )
763+ triaL [index [:, 2 ] == 2 ]
764+ ), axis = 0 )
759765
760766 return
761-
762-
763-
0 commit comments