[petsc-users] BDDC assembly question

Stefano Zampini stefano.zampini at gmail.com
Wed Jun 7 08:35:44 CDT 2017


Which version of PETSc are you using? If you use the dev version and try to call MatSetValues on a MATIS with a non-owned (subdomain-wise) dof it will raise an error, as MATIS does not implement any caching mechanisms for off-proc entries.
Off-proc entries are a concept related with the AIJ format.

The local row and columns distribution of a Mat (any type, MATAIJ, MATIS or whatever type you want to use) are related with the local sizes of the vectors used in MatMult;
for MATIS, the size of the subdomain problem (call it nl) is inferred from the size of the ISLocalToGlobalMapping object used in the constructor (or passed in via MatSetLocalToGlobalMapping).

So, you can either do

A) loop over elements and call MatSetValuesLocal(A,element_dofs_in_subdomain_ordering…)
B) loop over elements and call MatSetValues(A,element_dofs_in_global_ordering…)

in case A), if you want a code independent on the matrix type (AIJ or IS), you need to call MatSetLocalToGlobalMapping(A,l2g,l2g) before being able to call MatSetValuesLocal. The l2g map should map dofs from subdomain (0 to nl) to global ordering

in case B), the l2g map is only needed to create the MATIS object; in this case, when you call MatSetValues, the dofs in global ordering are mapped back to the subdomain ordering via ISGlobalToLocalMappingApply, that may not be memory scalable. So this is why Barry suggested you to use approach A).


You may want to take a look at http://epubs.siam.org/doi/abs/10.1137/15M1025785 <http://epubs.siam.org/doi/abs/10.1137/15M1025785> to better understand how MATIS works.
 
> On Jun 7, 2017, at 3:18 PM, Hoang Giang Bui <hgbk2008 at gmail.com> wrote:
> 
> <A00.ps>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170607/b6be9bc9/attachment.html>


More information about the petsc-users mailing list