[petsc-users] Problem with MatZeroRowsColumnsIS()

Püsök, Adina-Erika puesoek at uni-mainz.de
Tue May 6 07:23:40 CDT 2014


Hello!

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).

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.
The global indices of the velocity points within the Dirichlet block are contained in the arrays rowid_array.

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.
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.

Thanks,
Adina Pusok

// Create an IS required by MatZeroRows()
ierr = ISCreateGeneral(PETSC_COMM_WORLD,numRowsx,rowidx_array,PETSC_COPY_VALUES,&isx);  CHKERRQ(ierr);
ierr = ISCreateGeneral(PETSC_COMM_WORLD,numRowsy,rowidy_array,PETSC_COPY_VALUES,&isy);  CHKERRQ(ierr);
ierr = ISCreateGeneral(PETSC_COMM_WORLD,numRowsz,rowidz_array,PETSC_COPY_VALUES,&isz);  CHKERRQ(ierr);

1) /* ierr = MatZeroRowsColumnsIS(VV_MAT,isx,v_vv,x_push,rhs);  CHKERRQ(ierr);
ierr = MatZeroRowsColumnsIS(VV_MAT,isy,v_vv,x_push,rhs);  CHKERRQ(ierr);
ierr = MatZeroRowsColumnsIS(VV_MAT,isz,v_vv,x_push,rhs);  CHKERRQ(ierr);*/

2) ierr = MatZeroRowsIS(VV_MAT,isx,v_vv,x_push,rhs);  CHKERRQ(ierr);
ierr = MatZeroRowsIS(VV_MAT,isy,v_vv,x_push,rhs);  CHKERRQ(ierr);
ierr = MatZeroRowsIS(VV_MAT,isz,v_vv,x_push,rhs);  CHKERRQ(ierr);

ierr = MatZeroRowsIS(VP_MAT,isx,v_vp,PETSC_NULL,PETSC_NULL);  CHKERRQ(ierr);
ierr = MatZeroRowsIS(VP_MAT,isy,v_vp,PETSC_NULL,PETSC_NULL);  CHKERRQ(ierr);
ierr = MatZeroRowsIS(VP_MAT,isz,v_vp,PETSC_NULL,PETSC_NULL);  CHKERRQ(ierr);

ierr = ISDestroy(&isx); CHKERRQ(ierr);
ierr = ISDestroy(&isy); CHKERRQ(ierr);
ierr = ISDestroy(&isz); CHKERRQ(ierr);


Results (velocity) with MatZeroRowsColumnsIS().
1cpu[cid:779A0024-2BBB-4F8D-AB25-114C5B3D111C at Geo.Uni-Mainz.DE] 4cpu[cid:9FAA7278-A3FE-4A5D-B7A1-05AAFCA43181 at Geo.Uni-Mainz.DE]

Results (velocity) with MatZeroRowsIS():
1cpu[cid:C0C73566-0D52-484C-A858-01A184C23597 at Geo.Uni-Mainz.DE] 4cpu[cid:7A9FD8A2-C2FC-41B3-88BF-11F77628E874 at Geo.Uni-Mainz.DE]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/eb2c9945/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_1cpu_rows_columns.png
Type: image/png
Size: 28089 bytes
Desc: r01_1cpu_rows_columns.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/eb2c9945/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_rows_columns.png
Type: image/png
Size: 28325 bytes
Desc: r01_rows_columns.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/eb2c9945/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_1cpu_rows.png
Type: image/png
Size: 28089 bytes
Desc: r01_1cpu_rows.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/eb2c9945/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_rows.png
Type: image/png
Size: 28045 bytes
Desc: r01_rows.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/eb2c9945/attachment-0007.png>


More information about the petsc-users mailing list