Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2016-04-27 Thread Dave May
> It is also inconsistent with some of the other DMShellSetXXX() as some > type check the type (e.g. DMShellSetCreateMatrix), whilst some do, e.g. > DMShellSetCoarsen(). > > ooops - I meant some setters DO check types and some DON'T DMShellSetCreateMatrix() --> doesn't check the type

Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2016-04-27 Thread Dave May
On 27 April 2016 at 22:49, Jed Brown wrote: > Dave May writes: > > This always bugged me. > > I prefer to access the pointer as at least it's clear what I am doing and > > when reading the code later, I am not required to ask myself whether the > DM >

Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2016-04-27 Thread Jed Brown
Dave May writes: > This always bugged me. > I prefer to access the pointer as at least it's clear what I am doing and > when reading the code later, I am not required to ask myself whether the DM > is actually a shell or not. > > Why doesn't there exist a generic setter

Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2016-04-26 Thread Dave May
On 26 April 2016 at 23:58, Jed Brown wrote: > Dave May writes: > > You are always free to over-ride the method > > dm->ops->creatematrix > > with your own custom code to create > > and preallocate the matrix. > > DMShellSetCreateMatrix() > > No need

Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2016-04-26 Thread Jed Brown
Dave May writes: > You are always free to over-ride the method > dm->ops->creatematrix > with your own custom code to create > and preallocate the matrix. DMShellSetCreateMatrix() No need to include the private header. I know this isn't great. signature.asc

Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2016-04-26 Thread Dave May
On 26 April 2016 at 16:50, Gautam Bisht wrote: > I want to follow up on this old thread. If a user knows the exact fill > pattern of the off-diagonal block (i.e. d_nz+o_nz or d_nnz+o_nnz ), can > one still not preallocate memory for the off-diagonal matrix when using >

Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2016-04-26 Thread Gautam Bisht
I want to follow up on this old thread. If a user knows the exact fill pattern of the off-diagonal block (i.e. d_nz+o_nz or d_nnz+o_nnz ), can one still not preallocate memory for the off-diagonal matrix when using DMComposite? -Gautam. On Tue, Sep 30, 2014 at 3:48 PM, Jed Brown

[petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2014-09-30 Thread Gautam Bisht
Hi, The comment on line 419 of SNES ex 28.c http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex28.c.html says that the approach used in this example is not the best way to allocate off-diagonal blocks. Is there an example that shows a better way off allocating memory for

Re: [petsc-users] Allocating memory for off-diagonal matrix blocks when using DMComposite

2014-09-30 Thread Jed Brown
Gautam Bisht gbi...@lbl.gov writes: Hi, The comment on line 419 of SNES ex 28.c http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex28.c.html says that the approach used in this example is not the best way to allocate off-diagonal blocks. Is there an example that shows