[petsc-users] MATNEST with shell matrices

Jed Brown jedbrown at mcs.anl.gov
Thu Feb 21 16:27:52 CST 2013


Start by looking as src/snes/examples/tutorials/ex28.c, then try to
structure your code similarly. You can also look at
src/ksp/ksp/examples/tests/ex22.c.

I will also strengthen my previous statement. You will be doing yourself a
disservice in terms of understanding of PETSc, testability, and
practicality if you try to write everything using MatShell now. Don't do
it. Use normal matrices and follow the structure of ex28.c. Even if your
eventual goal is to do everything with MatShell, you'll get there sooner
(and have a better code) if you DON'T start out using MatShell.


On Thu, Feb 21, 2013 at 4:19 PM, Amneet Bhalla <mail2amneet at gmail.com>wrote:

> Can you guys comment on what example case would be best to start off for
> shell
> operators with FieldSplit? The examples I am looking into all start with
> creating native
> PETSc matrices and vectors.
>
> If possible could you write down steps that would be needed in setting
> such system...
>
> a) Create matrices using XXXX (?) b) Create vectors using YYYY ....
>
>
> On Thu, Feb 21, 2013 at 3:24 PM, Matthew Knepley <knepley at gmail.com>wrote:
>
>> On Thu, Feb 21, 2013 at 4:20 PM, Amneet Bhalla <mail2amneet at gmail.com>wrote:
>>
>>>
>>> On Thu, Feb 21, 2013 at 2:57 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>>>
>>>> that you're happy with and that performs well with fieldsplit or custom
>>>> preconditioning that will be amenable to your MatShells
>>>
>>>
>>> Is fieldsplit an alternative approach to MatNest and VecNest? The
>>> problem is that I am working on nonnative PETSc
>>> data; so I am not sure which recent methods would support shell
>>> approach. All I want is to use PETSc's algorithm
>>> for solving multicomponent system of equation. I am not bothering about
>>> preconditioning yet, as I will be trying
>>> a custom preconditioner down the road.
>>>
>>
>> MatNest is just an optimization matrix format. Get your stuff working
>> with FieldSplit and then think about optimization.
>>
>>    Matt
>>
>>
>>>
>>> --
>>> Amneet
>>>
>>>
>>>
>>>
>>
>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>
>
>
> --
> Amneet
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130221/31801dee/attachment.html>


More information about the petsc-users mailing list