On Fri, Jun 25, 2010 at 6:52 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, 24 Jun 2010 21:35:06 -0500, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
>    This brings up a "why the heck are we writing PETSc in C anyways" question<br>
><br>
>    We have<br>
><br>
>      KSPSetOptionsPrefix(), PC, SNES etc. AND PetscObjectSetOptionsPrefix() all do the same thing<br>
><br>
>      KSPSetFromOptions(), Vec, Mat, PC etc but NO PetscObjectSetFromOptions()<br>
><br>
>      PetscObjectSetName() but NO KSPSetName() etc<br>
><br>
>     If we have a XXXSetOptionsPrefix() for each separate class then why not a XXXAddOptionsHandler() for each separate class? Or should we remove all the XXXSetOptionsPrefix() but if we remove all of them why not remove all the XXXSetFromOptions() and just always call a PetscObjectSetFromOptions()<br>

<br>
</div>XXXSetFromOptions is a "beginner" level function, I don't like the<br>
(PetscObject) cast in this context.  Also, the manual page for the<br></blockquote><div><br></div><div>No cast needed in straight C :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

specific version still has relevant information in a reasonable location<br></blockquote><div><br></div><div>This is a reasonable objection.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

so I wouldn't be too eager to remove it in favor of always calling<br>
PetscObjectSetFromOptions.</blockquote><div><br></div><div>However, I still think its nice from the code reuse perspective, and these are</div><div>common functions to all objects.</div><div><br></div><div>   Matt</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888"><br>
Jed<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>