[petsc-users] Question about DMDA BOUNDARY_CONDITION set

Wenbo Zhao zhaowenbo.npic at gmail.com
Mon Apr 3 12:10:36 CDT 2017


Barry,
Hi. I am sorry for too late to reply you.
I read the code you send to me which create a VecScatter for ghost points
on rotation boundary.
But I am still not clear to how to use it to assemble the matrix.

I studied the example "$SLEPC_DIR/src/eps/examples/tutorials/ex19.c", which
is a 3D eigenvalue problem.

The example uses DMCreateMatrix and MatSetValuesStencil.
In addition, I use MatSetValues to insert value about rotation boundary
condtion.

I run it with command "mpirun -n 1 ./step-2 -eps_nev 3 -eps_ncv 9"
Error message is listed below:
"
3-D Laplacian Eigenproblem

 Grid partitioning: 1 1 1
[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: Argument out of range
[0]PETSC ERROR: Inserting a new nonzero at (91,100) in the matrix
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.7.4, Oct, 02, 2016
[0]PETSC ERROR: ./step-2 on a arch-linux2-c-debug named ubuntu by zhaowenbo
Mon Apr  3 09:39:08 2017
[0]PETSC ERROR: Configure options --with-cc=mpicc --with-cxx=mpicxx
--with-fc=mpif90 --with-shared-libraries=1 --with-hypre=1
--with-hypre-dir=/usr/local/hypre
[0]PETSC ERROR: #1 MatSetValues_SeqAIJ() line 484 in
/home/zhaowenbo/research/petsc/petsc-3.7.4/src/mat/impls/aij/seq/aij.c
[0]PETSC ERROR: #2 MatSetValues() line 1190 in
/home/zhaowenbo/research/petsc/petsc-3.7.4/src/mat/interface/matrix.c
[0]PETSC ERROR: #3 FillMatrix() line 107 in
/home/zhaowenbo/test_slepc/step-2/step-2.c
[0]PETSC ERROR: #4 main() line 152 in
/home/zhaowenbo/test_slepc/step-2/step-2.c
[0]PETSC ERROR: PETSc Option Table entries:
[0]PETSC ERROR: -eps_ncv 9
[0]PETSC ERROR: -eps_nev 3
[0]PETSC ERROR: ----------------End of Error Message -------send entire
error message to petsc-maint at mcs.anl.gov----------
"
I think the reason is Mat Prellocation. If so, I need to create matrix
using MatCreate by myself  according to the src code of DMCreateMatrix_DA?
Is it correct?

Could you give some explanation about how to use VecScatter?
In the $PETSC_DIR/src/ksp/ksp/examples/tutorials/ex2.c, I did not find the
VecScatter.
I found VecScatter is created in the src code of dm/impls/da/da1.c but i am
not clear about it.

BEST,
Wenbo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170404/ebc2ae49/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: step-2.c
Type: text/x-csrc
Size: 10267 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170404/ebc2ae49/attachment.c>


More information about the petsc-users mailing list