[petsc-dev] BlockGetIndices and GetBlockIndices

Pierre Jolivet pierre.jolivet at enseeiht.fr
Sun Oct 20 23:52:57 CDT 2019



> On 21 Oct 2019, at 6:42 AM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
> 
>  Could you provide a use case where you want to access/have a block size of a IS that is not an ISBlock? 

In the end, all I really want is get access to the underlying is->data->idx without having to worry about the subclass of is.
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…).
Again, my goal is just to avoid having to write something like: https://www.mcs.anl.gov/petsc/petsc-dev/src/vec/is/utils/isltog.c.html#line322 <https://www.mcs.anl.gov/petsc/petsc-dev/src/vec/is/utils/isltog.c.html#line322>
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:
ISGetBlockIndices(is,&indices)
ISLocalToGlobalMappingCreate(comm,bs,n/bs,indices,PETSC_COPY_VALUES,mapping)

Thanks,
Pierre

> 
>> On Oct 16, 2019, at 2:50 AM, Pierre Jolivet via petsc-dev <petsc-dev at mcs.anl.gov> wrote:
>> 
>> Hello,
>> I’m trying to understand what is the rationale for naming a function ISBlockGetIndices and another ISLocalToGlobalMappingGetBlockIndices (BlockGet vs. GetBlock).
>> Also, it looks to me like the implementation of ISBlockGetIndices is somehow less versatile than ISLocalToGlobalMappingGetBlockIndices.
>> 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., https://www.mcs.anl.gov/petsc/petsc-current/src/vec/is/is/examples/tutorials/ex3.c.html#line58 or this (IMHO) ugly code duplication https://www.mcs.anl.gov/petsc/petsc-dev/src/vec/is/utils/isltog.c.html#line322.
>> 
>> Thoughts and/or comments? Would it make sense to add an ISGetBlockIndices/ISRestoreBlockIndices or would that be too confusing for the user?
>> 
>> Thanks,
>> Pierre
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20191021/a165f726/attachment.html>


More information about the petsc-dev mailing list