[petsc-users] problem for using PCBDDC

ziming xiong xiongziming2010 at gmail.com
Mon May 15 09:03:52 CDT 2023


Hello sir,
I am a PhD student and am trying to use the PCBDDC method in petsc to solve
the matrix, but the final result is wrong. So I would like to ask you a few
questions.
First I will describe the flow of my code, I first used the finite element
method to build the total matrix in CSR format (total boundary conditions
have been imposed), where I did not build the total matrix, but only the
parameters ia, ja,value in CSR format, through which the parameters of the
metis (xadj, adjncy) are derived. The matrix is successfully divided into 2
subdomains using metis. After getting the global index of the points of
each subdomain by the part parameter of metis. I apply
ISLocalToGlobalMappingCreate to case mapping and use
ISGlobalToLocalMappingApply to convert the global index of points within
each process to local index and use MatSetValueLocal to populate the
corresponding subdomain matrix for each process. Here I am missing the
relationship of the boundary points between subdomains, and by using
ISGlobalToLocalMappingApply (I use IS_GTOLM_MASK to get the points outside
the subdomains converted to -1) I can get the index of the missing
relationship in the global matrix as well as the value. After creating the
global MATIS use MatISSetLocalMat to synchronize the subdomain matrix to
the global MATIS. After using MatSetValues to add the relationship of the
boundary points between subdomains into the global MATIS. The final
calculation is performed, but the final result is not correct.
My question is:
1. in PetscCall(MatAssemblyBegin(matIS, MAT_FINAL_ASSEMBLY)).
    PetscCall(MatAssemblyEnd(matIS, MAT_FINAL_ASSEMBLY)).
After that, when viewing the matrix by
PetscCall(MatView(matIS,PETSC_VIEWER_STDOUT_WORLD));, each process will
output the non-zero items of the matrix separately, but this index is the
local index is this normal?
2. I found that after using MatSetValues to add the relationship of
boundary points between subdomains into the global MATIS, the calculation
result does not change. Why is this? Can I interpolate directly into the
global MATIS if I know the global matrix index of the missing relations?


Best regards,
Ziming XIONG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230515/0e364477/attachment.html>


More information about the petsc-users mailing list