<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hello!
<div><br>
</div>
<div>I was trying to implement some internal Dirichlet boundary conditions into an aij matrix of the form: A=( VV VP; PV PP ). The idea was to create an internal block (let's say Dirichlet block) that moves with constant velocity within the domain (i.e.
check all the dofs within the block and set the values accordingly to the desired motion).</div>
<div><br>
</div>
<div>Ideally, this means to zero the rows and columns in VV, VP, PV corresponding to the dirichlet dofs and modify the corresponding rhs values. However, since we have submatrices and not a monolithic matrix A, we can choose to modify only VV and PV matrices. </div>
<div>The global indices of the velocity points within the Dirichlet block are contained in the arrays rowid_array. </div>
<div><br>
</div>
<div>What I want to point out is that the function MatZeroRowsColumnsIS() seems to create parallel artefacts, compared to MatZeroRowsIS() when run on more than 1 processor. Moreover, the results on 1 cpu are identical. </div>
<div>See below the results of the test (the Dirichlet block is outlined in white) and the piece of the code involved where the 1) - 2) parts are the only difference. </div>
<div><br>
</div>
<div>Thanks,</div>
<div>Adina Pusok</div>
<div><br>
</div>
<div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(80, 143, 115); ">
<span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre"></span></span>// Create an IS required by MatZeroRows()</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
ISCreateGeneral</span>(PETSC_COMM_WORLD,numRowsx,rowidx_array,<span style="color: #0034c9">PETSC_COPY_VALUES</span>,&isx);
<span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
ISCreateGeneral</span>(PETSC_COMM_WORLD,numRowsy,rowidy_array,<span style="color: #0034c9">PETSC_COPY_VALUES</span>,&isy);
<span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
ISCreateGeneral</span>(PETSC_COMM_WORLD,numRowsz,rowidz_array,<span style="color: #0034c9">PETSC_COPY_VALUES</span>,&isz);
<span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(80, 143, 115); ">
<span style="color: #000000">1)<span class="Apple-tab-span" style="white-space:pre">
</span></span>/*<span class="Apple-tab-span" style="white-space:pre"> </span><span style="text-decoration: underline">ierr</span> = MatZeroRowsColumnsIS(VV_MAT,<span style="text-decoration: underline">isx</span>,v_vv,x_push,<span style="text-decoration: underline">rhs</span>);
CHKERRQ(<span style="text-decoration: underline">ierr</span>);</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(80, 143, 115); ">
<span class="Apple-tab-span" style="white-space:pre"></span><span style="text-decoration: underline">ierr</span> = MatZeroRowsColumnsIS(VV_MAT,<span style="text-decoration: underline">isy</span>,v_vv,x_push,<span style="text-decoration: underline">rhs</span>);
CHKERRQ(<span style="text-decoration: underline">ierr</span>);</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(80, 143, 115); ">
<span class="Apple-tab-span" style="white-space:pre"></span><span style="text-decoration: underline">ierr</span> = MatZeroRowsColumnsIS(VV_MAT,<span style="text-decoration: underline">isz</span>,v_vv,x_push,<span style="text-decoration: underline">rhs</span>);
CHKERRQ(<span style="text-decoration: underline">ierr</span>);*/</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
2)<span class="Apple-tab-span" style="white-space:pre"> </span>ierr = <span style="color: #774191">
MatZeroRowsIS</span>(VV_MAT,isx,v_vv,x_push,rhs); <span style="text-decoration: underline">
CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
MatZeroRowsIS</span>(VV_MAT,isy,v_vv,x_push,rhs); <span style="text-decoration: underline">
CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
MatZeroRowsIS</span>(VV_MAT,isz,v_vv,x_push,rhs); <span style="text-decoration: underline">
CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
MatZeroRowsIS</span>(VP_MAT,isx,v_vp,<span style="text-decoration: underline">PETSC_NULL</span>,<span style="text-decoration: underline">PETSC_NULL</span>);
<span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
MatZeroRowsIS</span>(VP_MAT,isy,v_vp,<span style="text-decoration: underline">PETSC_NULL</span>,<span style="text-decoration: underline">PETSC_NULL</span>);
<span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
MatZeroRowsIS</span>(VP_MAT,isz,v_vp,<span style="text-decoration: underline">PETSC_NULL</span>,<span style="text-decoration: underline">PETSC_NULL</span>);
<span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
ISDestroy</span>(&isx); <span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
ISDestroy</span>(&isy); <span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-tab-span" style="white-space:pre"></span>ierr = <span style="color: #774191">
ISDestroy</span>(&isz); <span style="text-decoration: underline">CHKERRQ(ierr)</span>;</div>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
Results (velocity) with <span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">MatZeroRowsColumnsIS().</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">1cpu<img height="224" width="320" apple-width="yes" apple-height="yes" id="83b502d4-bee2-447b-b1a0-a07fb63ebc29" src="cid:779A0024-2BBB-4F8D-AB25-114C5B3D111C@Geo.Uni-Mainz.DE"> </span>4cpu<img height="224" width="320" apple-width="yes" apple-height="yes" id="b5aa4f3f-4d63-4d74-8e79-1a8cea4ba0b7" src="cid:9FAA7278-A3FE-4A5D-B7A1-05AAFCA43181@Geo.Uni-Mainz.DE"></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
Results (velocity)<span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "> </span>with <span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">MatZeroRowsIS():</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">
<span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">1cpu<img height="224" width="320" apple-width="yes" apple-height="yes" id="5c2ac45f-24c1-4a9c-9533-a6a0d3ed689b" src="cid:C0C73566-0D52-484C-A858-01A184C23597@Geo.Uni-Mainz.DE"> 4cpu</span><img height="224" width="320" apple-width="yes" apple-height="yes" id="c16dd5c6-145b-435b-9473-485794334e6d" src="cid:7A9FD8A2-C2FC-41B3-88BF-11F77628E874@Geo.Uni-Mainz.DE"></div>
</body>
</html>