<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 26 April 2016 at 23:58, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">Dave May <<a href="mailto:dave.mayhem23@gmail.com">dave.mayhem23@gmail.com</a>> writes:<br>
> You are always free to over-ride the method<br>
> dm->ops->creatematrix<br>
> with your own custom code to create<br>
> and preallocate the matrix.<br>
<br>
</span>DMShellSetCreateMatrix()<br>
<br>
No need to include the private header. I know this isn't great.<br></blockquote><div><br></div><div>This always bugged me. <br>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.<br><br></div><div>Why doesn't there exist a generic setter for each object which allows one to set a method for a particular operation?<br><br></div><div>The implementation for Mat defines typedef enum { } MatOperation.<br></div>Using this, we could have<br> PetscErrorCode MatSetOperation(Mat mat,MatOperation op,zzzzz)<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">If there was a similar typedef enum for all other objects, an XXXSetOperation() would be viable. <br><br>Is there a good reason to not have such a setter in the library?<br></div><div class="gmail_quote"><br><br><div>Thanks,<br></div><div> Dave<br></div></div><br></div></div>