[petsc-users] Problem with MatZeroRowsColumnsIS()

Matthew Knepley knepley at gmail.com
Tue May 6 09:22:52 CDT 2014


On Tue, May 6, 2014 at 7:23 AM, Püsök, Adina-Erika <puesoek at uni-mainz.de>wrote:

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

I am assuming that you are showing the result of solving the equations. It
would be more useful, and presumably just as easy
to say:

  a) Are the correct rows zeroed out?

  b) Is the diagonal element correct?

  c) Is the rhs value correct?

  d) Are the columns zeroed correctly?

If we know where the problem is, its easier to fix. For example, if the rhs
values are
correct and the rows are zeroed, then something is wrong with the solution
procedure.
Since ZeroRows() works and ZeroRowsColumns() does not, this is a distinct
possibility.

  Thanks,

     Matt


> 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 4cpu
>
>  Results (velocity) with MatZeroRowsIS():
>  1cpu 4cpu
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/9bf403e0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_1cpu_rows_columns.png
Type: image/png
Size: 28089 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/9bf403e0/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_1cpu_rows.png
Type: image/png
Size: 28089 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/9bf403e0/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_rows_columns.png
Type: image/png
Size: 28325 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/9bf403e0/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r01_rows.png
Type: image/png
Size: 28045 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140506/9bf403e0/attachment-0007.png>


More information about the petsc-users mailing list