[petsc-users] MATNEST with shell matrices

Boyce Griffith griffith at cims.nyu.edu
Thu Feb 21 17:12:58 CST 2013


Sorry I couldn't jump in earlier --- I had a proposal going out today 
and am just now catching up on other email.

Amneet is trying to solve a system the couples together some field data 
that is described using SAMRAI data structures along with particles that 
are stored in a standard PETSc Vec.  The hook between the SAMRAI data 
and PETSc is via a version of Bobby Philip's SAMRAI-to-PETSc interface 
that I've bastardized for my own purposes.  There is no support for 
{Mat,Vec}SetValues here --- the wrapper just provides standard vector 
space operations required by Krylov and Newton-Krylov solvers.

I used to have some code to make collections of Mat's and Vec's to make 
it feasible to solve systems involving both native and non-native PETSc 
data structures.  (It was similar to some code for making Vec's of Vec's 
that someone --- Dave May? --- used to maintain.)  I ripped this stuff 
out of my code a while ago, and I suggested that Amneet investigate 
{Vec,Mat}Nest before we tried to resurrect that old code.

-- Boyce

On 2/21/13 5:27 PM, Jed Brown wrote:
> 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
> <mailto: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
>     <mailto:knepley at gmail.com>> wrote:
>
>         On Thu, Feb 21, 2013 at 4:20 PM, Amneet Bhalla
>         <mail2amneet at gmail.com <mailto:mail2amneet at gmail.com>> wrote:
>
>
>             On Thu, Feb 21, 2013 at 2:57 PM, Jed Brown
>             <jedbrown at mcs.anl.gov <mailto: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
>
>
>
>


More information about the petsc-users mailing list