[petsc-dev] Problem with SNES and FieldSplit

2011-03-16 Thread Jed Brown
On Wed, Mar 16, 2011 at 00:16, Matthew Knepley wrote: > without the MatNest (I do not see what it adds here). It makes it easy to drop special things into other slots, implements MatMult, MatView, etc. -- next part -- An HTML attachment was scrubbed... URL:

[petsc-dev] Problem with SNES and FieldSplit

2011-03-16 Thread Jed Brown
On Wed, Mar 16, 2011 at 00:09, Barry Smith wrote: > Why not pass your Mat (maybe a global MPIAIJ) as the mat and pass your > MatNest as your pmat and have some of the subblocks in the MatNest be > defined by submatrices of of the MPIAIJ matrix. That's what I had in mind. By retaining ownershi

[petsc-dev] Problem with SNES and FieldSplit

2011-03-16 Thread Jed Brown
On Tue, Mar 15, 2011 at 23:50, Matthew Knepley wrote: > That is not what I have here. I want to change a portion, but outside of > that I want it to fall back to a global matrix. You were going to put your MatShell in the "pmat" slot, right? What are you going to use for preconditioning the oth

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Jed Brown
On Tue, Mar 15, 2011 at 23:33, Matthew Knepley wrote: > If it does exactly what I just said, I will. However, from my reading, it > does not. You can do it with MatNestGetSubMats(), modify one entry, MatNestSetSubMats(). But if you plan to do this often, add MatNestUpdateSubMat(). Hmm, seems li

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Jed Brown
On Tue, Mar 15, 2011 at 23:28, Matthew Knepley wrote: > What I have now is a MatShell that implements MatGetSubMatrix(), > I did this for a couple years, but now we have MatNest, why not use it? -- next part -- An HTML attachment was scrubbed... URL:

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Jed Brown
On Tue, Mar 15, 2011 at 22:07, Matthew Knepley wrote: > I guess I have no problem with MatGetSubMatrix() being the interface for > this, since all solvers get the Mat object. However, my point was > really that the interface for creating such things is horrible. There is no > easy way for me to d

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Jed Brown
On Tue, Mar 15, 2011 at 21:51, Matthew Knepley wrote: > Really? That seems perverse. I have to build some global PC matrix, with > pieces I do not even have. How is that going to happen? Is > this really how we want to handle it? > The alternatives don't compose properly, we'd need a whole new i

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Jed Brown
On Tue, Mar 15, 2011 at 21:39, Matthew Knepley wrote: > Here is the scenario. I have a FieldSplit solve with 4 splits. For the 4th > split, I have > a good preconditioner matrix. In the linear case, KSP, I am just doing > this: > > err = KSPSetUp(_ksp); > err = KSPGetPC(_ksp, &pc); >

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Barry Smith
On Mar 15, 2011, at 6:16 PM, Matthew Knepley wrote: > On Tue, Mar 15, 2011 at 6:09 PM, Barry Smith wrote: > > On Mar 15, 2011, at 6:03 PM, Matthew Knepley wrote: > > > On Tue, Mar 15, 2011 at 6:00 PM, Jed Brown wrote: > > On Tue, Mar 15, 2011 at 23:50, Matthew Knepley wrote: > > That is not

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
On Tue, Mar 15, 2011 at 6:09 PM, Barry Smith wrote: > > On Mar 15, 2011, at 6:03 PM, Matthew Knepley wrote: > > > On Tue, Mar 15, 2011 at 6:00 PM, Jed Brown wrote: > > On Tue, Mar 15, 2011 at 23:50, Matthew Knepley > wrote: > > That is not what I have here. I want to change a portion, but outsi

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Barry Smith
On Mar 15, 2011, at 6:03 PM, Matthew Knepley wrote: > On Tue, Mar 15, 2011 at 6:00 PM, Jed Brown wrote: > On Tue, Mar 15, 2011 at 23:50, Matthew Knepley wrote: > That is not what I have here. I want to change a portion, but outside of that > I want it to fall back to a global matrix. > > You

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Dmitry Karpeev
On Tue, Mar 15, 2011 at 6:03 PM, Barry Smith wrote: > > On Mar 15, 2011, at 6:00 PM, Jed Brown wrote: > >> >> >> >> Related: What do people think about having MatGetSubMatrix() retain >> ownership of the submatrix? > > ?You mean keep a reference to it? A reference would be natural. > > ?Barry > >

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Barry Smith
On Mar 15, 2011, at 6:00 PM, Jed Brown wrote: > > > > Related: What do people think about having MatGetSubMatrix() retain ownership > of the submatrix? You mean keep a reference to it? Barry

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
On Tue, Mar 15, 2011 at 6:00 PM, Jed Brown wrote: > On Tue, Mar 15, 2011 at 23:50, Matthew Knepley wrote: > >> That is not what I have here. I want to change a portion, but outside of >> that I want it to fall back to a global matrix. > > > You were going to put your MatShell in the "pmat" slot,

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
On Tue, Mar 15, 2011 at 5:41 PM, Jed Brown wrote: > On Tue, Mar 15, 2011 at 23:33, Matthew Knepley wrote: > >> If it does exactly what I just said, I will. However, from my reading, it >> does not. > > > You can do it with MatNestGetSubMats(), modify one entry, > MatNestSetSubMats(). But if you

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
On Tue, Mar 15, 2011 at 5:29 PM, Jed Brown wrote: > On Tue, Mar 15, 2011 at 23:28, Matthew Knepley wrote: > >> What I have now is a MatShell that implements MatGetSubMatrix(), >> > > I did this for a couple years, but now we have MatNest, why not use it? > If it does exactly what I just said, I

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
On Tue, Mar 15, 2011 at 4:10 PM, Jed Brown wrote: > On Tue, Mar 15, 2011 at 22:07, Matthew Knepley wrote: > >> I guess I have no problem with MatGetSubMatrix() being the interface for >> this, since all solvers get the Mat object. However, my point was >> really that the interface for creating s

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
On Tue, Mar 15, 2011 at 3:57 PM, Jed Brown wrote: > On Tue, Mar 15, 2011 at 21:51, Matthew Knepley wrote: > >> Really? That seems perverse. I have to build some global PC matrix, with >> pieces I do not even have. How is that going to happen? Is >> this really how we want to handle it? >> > > Th

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
On Tue, Mar 15, 2011 at 3:46 PM, Jed Brown wrote: > On Tue, Mar 15, 2011 at 21:39, Matthew Knepley wrote: > >> Here is the scenario. I have a FieldSplit solve with 4 splits. For the 4th >> split, I have >> a good preconditioner matrix. In the linear case, KSP, I am just doing >> this: >> >>

[petsc-dev] Problem with SNES and FieldSplit

2011-03-15 Thread Matthew Knepley
Here is the scenario. I have a FieldSplit solve with 4 splits. For the 4th split, I have a good preconditioner matrix. In the linear case, KSP, I am just doing this: err = KSPSetUp(_ksp); err = KSPGetPC(_ksp, &pc); err = PCFieldSplitGetSubKSP(pc, &num, &ksps); MatStructure flag;