[petsc-users] problem for using PCBDDC
Stefano Zampini
stefano.zampini at gmail.com
Mon May 15 09:22:13 CDT 2023
BDDC is a domain decomposition solver of the non-overlapping type and
cannot be used on assembled operators.
If you want to use it, you need to restructure your code a bit.
I presume from your message that your current approach is
1) generate_assembled_csr
2) decompose_csr? or decompose_mesh?
3) get_subdomain_relevant_entries
4) set in local matrix
this is wrong since you are summing up redundant matrix values in the final
MATIS format (you can check that MatMultEqual return false if you compare
the assembled operator and the MATIS operator)
You should restructure your code as
1) decompose mesh
2) generate_csr_only_for_local_subdomain
3) set values in local ordering into the MATIS object
you can start with a simple 2 cells problem, each assigned to a different
process to understand how to move forward.
You can play with src/ksp/ksp/tutorials/ex71.c which uses a structured grid
to understand how to setup a MATIS for a PDE solve
Hope this helps
Il giorno lun 15 mag 2023 alle ore 17:08 ziming xiong <
xiongziming2010 at gmail.com> ha scritto:
> 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
>
>
--
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230515/34aa617e/attachment.html>
More information about the petsc-users
mailing list