[petsc-users] MATNEST with shell matrices

Geoffrey Irving irving at naml.us
Thu Feb 21 18:25:19 CST 2013


On Thu, Feb 21, 2013 at 4:22 PM, Boyce Griffith <griffith at cims.nyu.edu> wrote:
>
>
> On 2/21/13 7:11 PM, Jed Brown wrote:
>>
>>
>> On Thu, Feb 21, 2013 at 6:07 PM, Boyce Griffith <griffith at cims.nyu.edu
>> <mailto:griffith at cims.nyu.edu>> wrote:
>>
>>
>>     Yes there is a local and global size.  They are both 0.  :-)
>>
>>
>>
>> Heh, interesting. Most finite-dimensional vector spaces have a
>> dimension. May as well use VecNestGetSubVec() when needed. I don't think
>> there is any code that will short-circuit in the zero-size case, but I'd
>> still encourage you to state a dimension that's not obviously bogus.
>
>
> For better or for worse, the "size" of the wrapped data can change
> dynamically.  Somehow it seems less dishonest to set the size to 0 instead
> of, e.g., 1.  At least when you get 0 you know that the size is bogus!  :-)
> We've been using this stuff for ... a while now, and it hasn't caused any
> problems.

Jed is saying that if you have to use a sentinel size, use a large
integer rather than zero.  Petsc can't detect that you're lying in
this case (unless it were to perform that many Krylov iterations in
exact arithmetic), so it won't be able to break.

> That said, I would prefer to have tighter integration with PETSc.  I think
> that DMComposite is what I was thinking might work.

Geoffrey


More information about the petsc-users mailing list