<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div class="elementToProof">I got an error when using  DMSTAG_UP for DMStagVec array indexing in a 2D DMStag Mesh.</div>
<div><br>
</div>
<div>I used the following code for accessing the getting the index for local vector data stored at the left and up locations (edge).</div>
<div><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color: rgb(0, 0, 255);">
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span>PetscInt </span><span style="color:#001080">idFup</span><span>[</span><span style="color:#098658">4</span><span>], </span><span style="color:#001080">dFleft</span><span>[</span><span style="color:#098658">4</span><span>]</span><span>;</span></span></div>
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span>
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal">
<span><span style="color:#af00db">for</span><span> (</span><span style="color:#001080">ii</span><span> =
</span><span style="color:#098658">0</span><span>; </span><span style="color:#001080">ii</span><span> <
</span><span style="color:#098658">4</span><span>; </span><span style="color:#001080">ii</span><span>++)</span></span><br>
<span><span>        </span><span style="color:#795e26">DMStagGetLocationSlot</span><span>(</span><span style="color:#001080">ctx</span><span>-></span><span style="color:#001080">dmF</span><span>,
</span><span style="color:#0000ff">LEFT</span><span>, </span><span style="color:#001080">ii</span><span>, &</span><span style="color:#001080">idFleft</span><span>[</span><span style="color:#001080">ii</span><span>]);</span></span></div>
</span></span></div>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color: rgb(0, 0, 255);">
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span style="color:#af00db">for</span><span> (</span><span style="color:#001080">ii</span><span> =
</span><span style="color:#098658">0</span><span>; </span><span style="color:#001080">ii</span><span> <
</span><span style="color:#098658">4</span><span>; </span><span style="color:#001080">ii</span><span>++)</span></span><br>
</div>
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span>        </span><span style="color:#795e26">DMStagGetLocationSlot</span><span>(</span><span style="color:#001080">ctx</span><span>-></span><span style="color:#001080">dmF</span><span>,
</span><span style="color:#0000ff">RIGHT</span><span>, </span><span style="color:#001080">ii</span><span>, &</span><span style="color:#001080">idFright</span><span>[</span><span style="color:#001080">ii</span><span>]);</span></span></div>
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span><br>
</span></span></div>
</span></div>
<div>
<div>And I used the following sample code for getting the data:</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color: rgb(0, 0, 255);">
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span><br>
</span></span></div>
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span>
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal">
<span><span style="color:#001080">a = UArr</span><span>[</span><span style="color:#001080">ey</span><span>][</span><span style="color:#001080">ex</span><span>][</span><span style="color:#001080"><span style="background-color:rgb(255, 255, 255);display:inline !important">idFright</span></span><span>[</span><span style="color:#001080">ii</span><span>]])</span></span></div>
</span></span></div>
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span><br>
</span></span></div>
</span></div>
<div>However, after the calculation, I found there are weird fluctuations at the boundary of the mesh blocks assigned to each processor as shown in the Figure below.(The yellow lines, 5 processors were used in this case.) There seemed to be a communication
 error when using DMSTAG_UP. And I also found the value of idFright[ii] was much larger than the index for the locations of left, right, or elements. It's on a level of 400+, while the other was only like 1 to 10. </div>
<div><br>
</div>
<div>Was there any I did wrong when setting up the 2D DMStag?</div>
<div><br>
</div>
<div>Thank you and best regards.</div>
<div><br>
</div>
<div>Sijie Zhang</div>
<div><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="color: rgb(0, 0, 255);">
<div style="color:#000000;background-color:#ffffff;font-family:'Droid Sans Mono', 'monospace', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span><img style="max-width:100%" class="w-408 h-949" size="20901" contenttype="image/png" data-outlook-trace="F:1|T:1" src="cid:94a295bd-6851-489d-83d8-44d2a6d80314"><br>
</span></span></div>
<br>
</span></div>
</body>
</html>