Lines Matching full:n
7 "Decoding the DMPlex\n",
8 "===================\n",
9 "\n",
19 "from __future__ import print_function\n",
20 "import sys,petsc4py\n",
21 "petsc4py.init(sys.argv)\n",
22 "from petsc4py import PETSc\n",
39 "dim = 2\n",
40 "coords = np.asarray([[0.0, 0.0],\n",
41 " [0.5, 0.0],\n",
42 " [1.0, 0.0],\n",
43 " [0.0, 0.5],\n",
44 " [0.5, 0.5],\n",
45 " [1.0, 0.5],\n",
46 " [0.0, 1.0],\n",
47 " [0.5, 1.0],\n",
48 " [1.0, 1.0]])\n",
49 "cells = np.asarray([[0,1,4,3],\n",
50 " [1,2,5,4],\n",
51 " [3,4,7,6],\n",
91 … it would be good to make some kind of plot with all points numbered, I suggest sketching one.)\n",
92 "\n",
93 "Cones and Supports\n",
94 "------------------\n",
95 "\n",
108 "point = 0 \tcone = [13 14 15 16]\n",
109 "point = 1 \tcone = [17 18 19 14]\n",
110 "point = 2 \tcone = [15 20 21 22]\n",
111 "point = 3 \tcone = [19 23 24 20]\n",
112 "point = 4 \tcone = []\n",
113 "point = 5 \tcone = []\n",
114 "point = 6 \tcone = []\n",
115 "point = 7 \tcone = []\n",
116 "point = 8 \tcone = []\n",
117 "point = 9 \tcone = []\n",
118 "point = 10 \tcone = []\n",
119 "point = 11 \tcone = []\n",
120 "point = 12 \tcone = []\n",
121 "point = 13 \tcone = [4 5]\n",
122 "point = 14 \tcone = [5 8]\n",
123 "point = 15 \tcone = [8 7]\n",
124 "point = 16 \tcone = [7 4]\n",
125 "point = 17 \tcone = [5 6]\n",
126 "point = 18 \tcone = [6 9]\n",
127 "point = 19 \tcone = [9 8]\n",
128 "point = 20 \tcone = [ 8 11]\n",
129 "point = 21 \tcone = [11 10]\n",
130 "point = 22 \tcone = [10 7]\n",
131 "point = 23 \tcone = [ 9 12]\n",
132 "point = 24 \tcone = [12 11]\n"
137 "pStart,pEnd = plex.getChart()\n",
138 "for i in range(pStart,pEnd):\n",
146 …original mesh encoding. Here we summarize what we observe from the cones of the chart entities.\n",
147 "\n",
148 …f 4 integers which refer to the lower dimensional entities which make up that cell--the edges. \n",
149 …orrespond to vertices. These are the lowest dimensional object we have and thus they are empty.\n",
150 "* Points 13 through 24 correspond to edges. Each edge is made up of two vertices.\n",
151 "\n",
164 "point = 0 \tsupport = []\n",
165 "point = 1 \tsupport = []\n",
166 "point = 2 \tsupport = []\n",
167 "point = 3 \tsupport = []\n",
168 "point = 4 \tsupport = [13 16]\n",
169 "point = 5 \tsupport = [13 14 17]\n",
170 "point = 6 \tsupport = [17 18]\n",
171 "point = 7 \tsupport = [15 16 22]\n",
172 "point = 8 \tsupport = [14 15 19 20]\n",
173 "point = 9 \tsupport = [18 19 23]\n",
174 "point = 10 \tsupport = [21 22]\n",
175 "point = 11 \tsupport = [20 21 24]\n",
176 "point = 12 \tsupport = [23 24]\n",
177 "point = 13 \tsupport = [0]\n",
178 "point = 14 \tsupport = [0 1]\n",
179 "point = 15 \tsupport = [0 2]\n",
180 "point = 16 \tsupport = [0]\n",
181 "point = 17 \tsupport = [1]\n",
182 "point = 18 \tsupport = [1]\n",
183 "point = 19 \tsupport = [1 3]\n",
184 "point = 20 \tsupport = [2 3]\n",
185 "point = 21 \tsupport = [2]\n",
186 "point = 22 \tsupport = [2]\n",
187 "point = 23 \tsupport = [3]\n",
188 "point = 24 \tsupport = [3]\n"
193 "for i in range(pStart,pEnd):\n",
201 …* Points 0 through 3 (quads) have no support, there is nothing of higher dimension in this mesh\n",
202 …s 4 through 12 (vertices) have at least 2 edges in their support and the middle (8) has 4 edges\n",
203 "* Points 13 through 24 (edges) have at least 1 cell in their support as many as 2\n",
204 "\n",
205 … using the appropriate *set* routines or with other kinds of constructors available in the API.\n",
206 "\n",
207 "Labeling\n",
208 "--------\n",
209 "\n",
222 "label name = celltype \tlabel size = 3\n",
223 "label name = depth \tlabel size = 3\n"
228 "for i in range(plex.getNumLabels()):\n",
229 " name = plex.getLabelName(i)\n",
249 "point = 0 \tlabel(depth) = 2\n",
250 "point = 1 \tlabel(depth) = 2\n",
251 "point = 2 \tlabel(depth) = 2\n",
252 "point = 3 \tlabel(depth) = 2\n",
253 "point = 4 \tlabel(depth) = 0\n",
254 "point = 5 \tlabel(depth) = 0\n",
255 "point = 6 \tlabel(depth) = 0\n",
256 "point = 7 \tlabel(depth) = 0\n",
257 "point = 8 \tlabel(depth) = 0\n",
258 "point = 9 \tlabel(depth) = 0\n",
259 "point = 10 \tlabel(depth) = 0\n",
260 "point = 11 \tlabel(depth) = 0\n",
261 "point = 12 \tlabel(depth) = 0\n",
262 "point = 13 \tlabel(depth) = 1\n",
263 "point = 14 \tlabel(depth) = 1\n",
264 "point = 15 \tlabel(depth) = 1\n",
265 "point = 16 \tlabel(depth) = 1\n",
266 "point = 17 \tlabel(depth) = 1\n",
267 "point = 18 \tlabel(depth) = 1\n",
268 "point = 19 \tlabel(depth) = 1\n",
269 "point = 20 \tlabel(depth) = 1\n",
270 "point = 21 \tlabel(depth) = 1\n",
271 "point = 22 \tlabel(depth) = 1\n",
272 "point = 23 \tlabel(depth) = 1\n",
273 "point = 24 \tlabel(depth) = 1\n"
278 "for i in range(pStart,pEnd):\n",
298 "depth = 0 \tdepth stratum = (4, 13) \theight stratum = (0, 4)\n",
299 "depth = 1 \tdepth stratum = (13, 25) \theight stratum = (13, 25)\n",
300 "depth = 2 \tdepth stratum = (0, 4) \theight stratum = (4, 13)\n"
305 "for i in range(plex.getDepth()+1):\n",
325 "point = 0 \tlabel(boundary) = -1\n",
326 "point = 1 \tlabel(boundary) = -1\n",
327 "point = 2 \tlabel(boundary) = -1\n",
328 "point = 3 \tlabel(boundary) = -1\n",
329 "point = 4 \tlabel(boundary) = -1\n",
330 "point = 5 \tlabel(boundary) = -1\n",
331 "point = 6 \tlabel(boundary) = -1\n",
332 "point = 7 \tlabel(boundary) = -1\n",
333 "point = 8 \tlabel(boundary) = -1\n",
334 "point = 9 \tlabel(boundary) = -1\n",
335 "point = 10 \tlabel(boundary) = -1\n",
336 "point = 11 \tlabel(boundary) = -1\n",
337 "point = 12 \tlabel(boundary) = -1\n",
338 "point = 13 \tlabel(boundary) = 1\n",
339 "point = 14 \tlabel(boundary) = -1\n",
340 "point = 15 \tlabel(boundary) = -1\n",
341 "point = 16 \tlabel(boundary) = 1\n",
342 "point = 17 \tlabel(boundary) = 1\n",
343 "point = 18 \tlabel(boundary) = 1\n",
344 "point = 19 \tlabel(boundary) = -1\n",
345 "point = 20 \tlabel(boundary) = -1\n",
346 "point = 21 \tlabel(boundary) = 1\n",
347 "point = 22 \tlabel(boundary) = 1\n",
348 "point = 23 \tlabel(boundary) = 1\n",
349 "point = 24 \tlabel(boundary) = 1\n"
354 "plex.createLabel(\"boundary\")\n",
355 "for i in range(pStart,pEnd):\n",
356 " if plex.getLabelValue(\"depth\",i) == 1: # this is an edge\n",
357 " if plex.getSupportSize(i) == 1: # only one cell has it as an edge\n",
358 " plex.setLabelValue(\"boundary\",i,1)\n",
375 "vis = plex.getStratumIS(\"depth\",0)\n",
392 "vis = plex.getVertexNumbering()\n",
393 "vis.view()\n",
394 "cis = plex.getCellNumbering()\n",
402 "Meets and Joins\n",
403 "---------------\n",
404 "\n",
417 "meet = [14] \tjoin = []\n"
422 "# Two cells, meet is the common edge, no join\n",
423 "pnts = [0,1]\n",
436 "meet = [8] \tjoin = [1]\n"
441 "# Two edges, meet is the common vertex, join is the cell to which they are both connected\n",
442 "pnts = [14,19]\n",
455 "meet = [] \tjoin = [20]\n"
460 "# Two vertices, no meet, join is the common edge to which they are both connected\n",
461 "pnts = [8,11]\n",
469 "Transitive Closure\n",
470 "------------------\n",
471 "\n",
484 "point = 0 \tclosure(cone) = [ 0 13 14 15 16 4 5 8 7] \tclosure(supp) = [0]\n",
485 "point = 1 \tclosure(cone) = [ 1 17 18 19 14 5 6 9 8] \tclosure(supp) = [1]\n",
486 "point = 2 \tclosure(cone) = [ 2 15 20 21 22 7 8 11 10] \tclosure(supp) = [2]\n",
487 "point = 3 \tclosure(cone) = [ 3 19 23 24 20 8 9 12 11] \tclosure(supp) = [3]\n",
488 "point = 4 \tclosure(cone) = [4] \tclosure(supp) = [ 4 13 16 0]\n",
489 "point = 5 \tclosure(cone) = [5] \tclosure(supp) = [ 5 13 14 17 0 1]\n",
490 "point = 6 \tclosure(cone) = [6] \tclosure(supp) = [ 6 17 18 1]\n",
491 "point = 7 \tclosure(cone) = [7] \tclosure(supp) = [ 7 15 16 22 0 2]\n",
492 "point = 8 \tclosure(cone) = [8] \tclosure(supp) = [ 8 14 15 19 20 0 1 2 3]\n",
493 "point = 9 \tclosure(cone) = [9] \tclosure(supp) = [ 9 18 19 23 1 3]\n",
494 "point = 10 \tclosure(cone) = [10] \tclosure(supp) = [10 21 22 2]\n",
495 "point = 11 \tclosure(cone) = [11] \tclosure(supp) = [11 20 21 24 2 3]\n",
496 "point = 12 \tclosure(cone) = [12] \tclosure(supp) = [12 23 24 3]\n",
497 "point = 13 \tclosure(cone) = [13 4 5] \tclosure(supp) = [13 0]\n",
498 "point = 14 \tclosure(cone) = [14 5 8] \tclosure(supp) = [14 0 1]\n",
499 "point = 15 \tclosure(cone) = [15 8 7] \tclosure(supp) = [15 0 2]\n",
500 "point = 16 \tclosure(cone) = [16 7 4] \tclosure(supp) = [16 0]\n",
501 "point = 17 \tclosure(cone) = [17 5 6] \tclosure(supp) = [17 1]\n",
502 "point = 18 \tclosure(cone) = [18 6 9] \tclosure(supp) = [18 1]\n",
503 "point = 19 \tclosure(cone) = [19 9 8] \tclosure(supp) = [19 1 3]\n",
504 "point = 20 \tclosure(cone) = [20 8 11] \tclosure(supp) = [20 2 3]\n",
505 "point = 21 \tclosure(cone) = [21 11 10] \tclosure(supp) = [21 2]\n",
506 "point = 22 \tclosure(cone) = [22 10 7] \tclosure(supp) = [22 2]\n",
507 "point = 23 \tclosure(cone) = [23 9 12] \tclosure(supp) = [23 3]\n",
508 "point = 24 \tclosure(cone) = [24 12 11] \tclosure(supp) = [24 3]\n"
513 "for i in range(pStart,pEnd):\n",
514 " coneclose,orient = plex.getTransitiveClosure(i)\n",
515 " suppclose,orient = plex.getTransitiveClosure(i,useCone=False)\n",