<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Thanks.
<div>I had figured out the ordering by stratum but was dreading reconstructing the ordering on test and hexes…</div>
<div><br>
</div>
<div>Blaise</div>
<div><br>
<div><br>
<blockquote type="cite">
<div>On Nov 7, 2022, at 12:14 PM, Matthew Knepley <knepley@gmail.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div dir="ltr">On Mon, Nov 7, 2022 at 10:51 AM Blaise Bourdin <<a href="mailto:bourdin@mcmaster.ca">bourdin@mcmaster.ca</a>> wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
How are degree of freedom ordered in calls to DMPlexVec[Set/Get/Restore]Closure?<br>
Given a FE mesh and a section for P2-Lagrange elements (i.e. 1 dof per vertex and edge), I was naively assuming that the “local” vector would contain dof at vertices then edges (in this order), since it matches the section ordering, but it looks like I get
edges then vertices…<br>
<br>
Here is my section (my mesh has 8 cells, 16 edges, and 9 vertices)<br>
PetscSection Object: U 1 MPI process<br>
type not yet set<br>
1 fields<br>
field 0 with 1 components<br>
Process 0:<br>
( 0) dim 0 offset 0<br>
( 1) dim 0 offset 0<br>
( 2) dim 0 offset 0<br>
( 3) dim 0 offset 0<br>
( 4) dim 0 offset 0<br>
( 5) dim 0 offset 0<br>
( 6) dim 0 offset 0<br>
( 7) dim 0 offset 0<br>
( 8) dim 1 offset 0<br>
( 9) dim 1 offset 1<br>
( 10) dim 1 offset 2<br>
( 11) dim 1 offset 3<br>
( 12) dim 1 offset 4<br>
( 13) dim 1 offset 5<br>
( 14) dim 1 offset 6<br>
( 15) dim 1 offset 7<br>
( 16) dim 1 offset 8<br>
( 17) dim 1 offset 9<br>
( 18) dim 1 offset 10<br>
( 19) dim 1 offset 11<br>
( 20) dim 1 offset 12<br>
( 21) dim 1 offset 13<br>
( 22) dim 1 offset 14<br>
( 23) dim 1 offset 15<br>
( 24) dim 1 offset 16<br>
( 25) dim 1 offset 17<br>
( 26) dim 1 offset 18<br>
( 27) dim 1 offset 19<br>
( 28) dim 1 offset 20<br>
( 29) dim 1 offset 21<br>
( 30) dim 1 offset 22<br>
( 31) dim 1 offset 23<br>
( 32) dim 1 offset 24<br>
<br>
Start from the following local vector:<br>
Vec Object: U 1 MPI process<br>
type: seq<br>
1.<br>
2.<br>
3.<br>
4.<br>
5.<br>
6.<br>
7.<br>
8.<br>
9.<br>
10.<br>
11.<br>
12.<br>
13.<br>
14.<br>
15.<br>
16.<br>
17.<br>
18.<br>
19.<br>
20.<br>
21.<br>
22.<br>
23.<br>
24.<br>
25.<br>
<br>
Call PetscCallA(DMPlexVecGetClosure(dmU,sectionU,U,0_Ki,UArray,ierr)) and get the following for Array:<br>
10.000000000000000 11.000000000000000 12.000000000000000 1.0000000000000000 2.0000000000000000 3.0000000000000000<br>
<br>
Is this ordering predictable and documented somewhere? Is it ordered by stratum?<br>
</blockquote>
<div><br>
</div>
<div>The ordering is determined. It follows the same order that DMPlexGetTransitiveClosure() gives for the points.</div>
<div><br>
</div>
<div>Transitive closure orders points by stratum. It is a BFS of the Hasse Diagram, starting from the initial point. For</div>
<div>your triangle, it would be </div>
<div><br>
</div>
<div> tri0, e0, e1, e2, v0, v1, v2</div>
<div><br>
</div>
<div>For each cell type, the order of faces is specified in Table 1.2 of the attached. This gives an order to each level</div>
<div>of the BFS.</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
Regards,<br>
Blaise<br>
<br>
—<span class="Apple-converted-space"> </span><br>
Canada Research Chair in Mathematical and Computational Aspects of Solid Mechanics (Tier 1)<br>
Professor, Department of Mathematics & Statistics<br>
Hamilton Hall room 409A, McMaster University<br>
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada<span class="Apple-converted-space"> </span><br>
<a href="https://www.math.mcmaster.ca/bourdin" rel="noreferrer" target="_blank">https://www.math.mcmaster.ca/bourdin</a><span class="Apple-converted-space"> </span>| +1 (905) 525 9140 ext. 27243<br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
--<span class="Apple-converted-space"> </span><br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<span id="cid:f_la71ml760"><PlexBook.pdf></span></div>
</blockquote>
</div>
<br>
<div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div>— <br>
Canada Research Chair in Mathematical and Computational Aspects of Solid Mechanics (Tier 1)</div>
<div>Professor, Department of Mathematics & Statistics<br>
Hamilton Hall room 409A, McMaster University<br>
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada <br>
https://www.math.mcmaster.ca/bourdin | +1 (905) 525 9140 ext. 27243</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</body>
</html>