<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Jose,<div class=""><br class=""></div><div class="">The local size of the matrix (the one you use in MatSetSizes) tells Petsc what is the size of the local portion of the vectors involved in matrix vector products.<div class="">It has nothing to do with the size of the local Neumann problem needed by MatIS. These are inferred from the local to global mapping of the degrees of freedom</div><div class="">In your case, the  l2g object needs to map all the dofs that corresponds to the local mesh to their global dof numbering (you can take a look here <a href="https://epubs.siam.org/doi/abs/10.1137/15M1025785" class="">https://epubs.siam.org/doi/abs/10.1137/15M1025785</a>)</div><div class=""><br class=""></div><div class="">MatCreate(comm,&A)</div><div class="">MatSetSizes(A,PETSC_DECIDE,PETSC_DECIDE,N,N)<br class=""><div>MatSetType(A,MATIS)</div><div>MatSetLocalToGlobalMapping(A,l2g,l2g)// this creates the local Neumann matrices</div><div><br class=""></div><div>For n = 1: number_of_local_elements</div><div>  Construct element matrix</div><div>  // you have two alternitives</div><div>  MatSetValuesLocal(A, // using local ordering of dofs</div><div>  //or MatSetValues(A, // using global ordering of dofs</div><div>end</div><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 14, 2019, at 5:09 AM, José Lorenzo via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><p class="">I am working with Nedelec Finite Elements and using ghost vectors to 
store the ghost values of the solution in the edges that do not belong 
to current processor.<br class="">
</p><p class="">Since I have a large contrast in material properties I would like to 
try the PCBDDC preconditioner in PETSC. Apparently, my matrix needs to 
be of type MatIS, but I don't get to understand how MatCreateIS would 
work in my particular case, although I did have a look at mat/ex3.c and 
ksp/ex59.c</p><p class="">I set the local size m to the number of edges in current processor, 
but I do not know whether I should include the number of ghost edges. 
And for the local size n should I use the total number of DOFs or 
proceed as with m? <br class="">
</p><p class=""><br class="">
</p><p class="">Thanks,</p><p class="">Jose</p>
</div>
</div></blockquote></div><br class=""></div></div></body></html>