<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=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 21 Oct 2019, at 6:42 AM, Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" class="">bsmith@mcs.anl.gov</a>> wrote:</div><div class=""><div class=""><br class="">  Could you provide a use case where you want to access/have a block size of a IS that is not an ISBlock? <br class=""></div></div></blockquote><div><br class=""></div><div><div><span style="orphans: 2; widows: 2;" class="">In the end, all I really want is get access to the underlying </span><span style="orphans: 2; widows: 2;" class="">is->data->idx without having to worry about the subclass of is.</span></div><div><span style="orphans: 2; widows: 2;" class="">I don’t have such a use case, but I don’t think this is really related to what I want to achieve (or maybe it is…).</span></div><div><span style="orphans: 2; widows: 2;" class="">Again, my goal is just to avoid having to write something like: </span><a href="https://www.mcs.anl.gov/petsc/petsc-dev/src/vec/is/utils/isltog.c.html#line322" class="">https://www.mcs.anl.gov/petsc/petsc-dev/src/vec/is/utils/isltog.c.html#line322</a></div><div>If things were done as in ISLocalToGlobalMapping (which I know is not the same at all as IS/ISBlock), I think this could just read:</div><div>ISGetBlockIndices(is,&indices)</div><div>ISLocalToGlobalMappingCreate(comm,bs,n/bs,indices,PETSC_COPY_VALUES,mapping)</div><div><br class=""></div><div style="orphans: 2; widows: 2;">Thanks,</div><div style="orphans: 2; widows: 2;">Pierre</div></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">On Oct 16, 2019, at 2:50 AM, Pierre Jolivet via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a>> wrote:<br class=""><br class="">Hello,<br class="">I’m trying to understand what is the rationale for naming a function ISBlockGetIndices and another ISLocalToGlobalMappingGetBlockIndices (BlockGet vs. GetBlock).<br class="">Also, it looks to me like the implementation of ISBlockGetIndices is somehow less versatile than ISLocalToGlobalMappingGetBlockIndices.<br class="">Indeed, I may call ISLocalToGlobalMappingGetBlockIndices with an underlying non-block IS, while I can’t for ISBlockGetIndices, so a check must be performed by the user, e.g., <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/vec/is/is/examples/tutorials/ex3.c.html#line58" class="">https://www.mcs.anl.gov/petsc/petsc-current/src/vec/is/is/examples/tutorials/ex3.c.html#line58</a> or this (IMHO) ugly code duplication <a href="https://www.mcs.anl.gov/petsc/petsc-dev/src/vec/is/utils/isltog.c.html#line322" class="">https://www.mcs.anl.gov/petsc/petsc-dev/src/vec/is/utils/isltog.c.html#line322</a>.<br class=""><br class="">Thoughts and/or comments? Would it make sense to add an ISGetBlockIndices/ISRestoreBlockIndices or would that be too confusing for the user?<br class=""><br class="">Thanks,<br class="">Pierre<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></body></html>