[petsc-dev] DMCreateMatrix_Shell

Stefano Zampini stefano.zampini at gmail.com
Fri Feb 8 05:44:59 CST 2019



> On Feb 8, 2019, at 2:37 PM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Fri, Feb 8, 2019 at 6:30 AM Stefano Zampini via petsc-dev <petsc-dev at mcs.anl.gov <mailto:petsc-dev at mcs.anl.gov>> wrote:
> I don’t understand the need of these checks (tacky and incomplete…, as per the comment) 
> 
> https://bitbucket.org/petsc/petsc/src/75aeaa18afd73be7f3020f94b788241b9e0ba3d7/src/dm/impls/shell/dmshell.c#lines-197 <https://bitbucket.org/petsc/petsc/src/75aeaa18afd73be7f3020f94b788241b9e0ba3d7/src/dm/impls/shell/dmshell.c#lines-197>
> 
> Why are these checks needed? I’m inclined to remove these lines, but I would like some comments before doing it.
> 
> This even looks wrong to me. Why would we accept a type different from the actual matrix type?
> 

The only reason I could think of is

DMSetMatType(shell,type1);
DMCreateMatrix(shell,&A);
DMSetMatType(shell,type2);
DMCreateMatrix(shell,&B); // B is type1, not type2

>    Matt
> 
> -- 
> 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
> 
> https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190208/0e967b4e/attachment.html>


More information about the petsc-dev mailing list