[petsc-users] Some questions regarding VecNest type.

Vijay S. Mahadevan vijay.m at gmail.com
Wed Oct 12 16:26:27 CDT 2011


> I meant the two pieces of code. It's more to maintain and test. Needing to
> choose at compile time is lame, but even if you could do it at run-time, it
> would not be fun to maintain.

Not fun, yes, but two different code paths are inevitable. You can
choose to do block solves or monolithic inversions but both do need a
different data structure representation. In your example mat X vs Y.

Anyway, I was trying to create a simple test case and was stopped
immediately in my progress. I found the hard way that VecCreateNest is
the only way to create a Nest vector ? The usual
VecCreate+SetFromOptions doesn't seem to do the trick. Or am I missing
some call here ? (Code attached)

Petsc doesn't seem to like VecSetType(x, VECNEST) either. I get an
error "Unknown vector type: nest!".

On Wed, Oct 12, 2011 at 3:28 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Wed, Oct 12, 2011 at 15:25, Vijay S. Mahadevan <vijay.m at gmail.com> wrote:
>>
>> What do you mean ? The blocks are formed in memory and handed over to
>> the algebraic preconditioner (controlled at runtime). Why would the
>> user have to change the preconditioner manually ? This made use of the
>> block PC object in petsc-ext which I assume is replaced by FieldSplit
>> ? I eventually do have to handle this elegantly and will need some
>> input when I get there.
>>
>> If you are talking about the compile time switch, then yes, that was a
>> little painful. But hopefully pure petsc will give me some peace !
>
> I meant the two pieces of code. It's more to maintain and test. Needing to
> choose at compile time is lame, but even if you could do it at run-time, it
> would not be fun to maintain. In my opinion, we want one code where we can
> do
> -mat_type X -pc_type fieldsplit
> and
> -mat_type Y -pc_type lu
> and have efficient data structures used in both cases.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testnest2.c
Type: text/x-csrc
Size: 567 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111012/1321c02f/attachment.c>


More information about the petsc-users mailing list