[petsc-users] BDDC assembly question

Hoang Giang Bui hgbk2008 at gmail.com
Wed Jun 7 09:55:17 CDT 2017


Hi Stefano

I used case B) to not change the current code significantly. Nevertheless
case A) is worth to look when the number of domains grow. In case B) I
noticed that the l2g passing to MatSetLocalToGlobalMapping must also
contain the off-proc entries, in order to assemble correctly. As you said,
calling MatSetValues with non-owned dof will raise error, so we have to
include that in the current sub-domain. I used v3.7.4 though.

Thanks all for the help.
Giang

On Wed, Jun 7, 2017 at 3:35 PM, Stefano Zampini <stefano.zampini at gmail.com>
wrote:

> 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 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/cb876cb8/attachment.html>


More information about the petsc-users mailing list