<div dir="ltr">Ed,<div>  I agree with all what you said.  My thought is we don't need to add each of your examples into corresponding src/XX/tutorials/.  Your repo can be a standalone directory and we just need PETSc CI to be able to run them.<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--Junchao Zhang</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 30, 2020 at 9:00 PM Ed Bueler <<a href="mailto:elbueler@alaska.edu">elbueler@alaska.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Junchao--<div><br></div><div>> I was wondering if it is feasible to add your example programs to PETSc tests so that readers will always be able to run your code.</div><div><br></div><div>Thanks for asking.  There was a deliberate idea here, which I want to explain, and the petsc-dev list is the right spot.  (Sorry if this is more than you want to know.)</div><div><br></div><div>First, the example programs are in a completely public spot:</div><div>    <a href="https://github.com/bueler/p4pdes" target="_blank">https://github.com/bueler/p4pdes</a></div><div>No one needs to own the book to run the codes, for example.  I welcome corrections/feedback/improvements through the issues interface at that repo, whether or not connected they are connected to the book text.</div><div><br></div><div>In fact, here are things one may observe about the petsc tutorial src/XX/tutorials/exN.c) examples:</div><div><br></div><div>1.  They may or may not point to a clear document(s) which can help a beginner know how they are designed.</div><div>2.  They don't have a uniform style because of different authorship.</div><div>3.  They are not ordered by difficulty in any clear way.  (E.g. ex1.c may not be the best example to start with, and the beginner would not be able to grep to find "easy" even if they can find some function from the API that way.)</div><div>4.  Their features evolve over time as developers work with the examples as regression/feature tests.  (See src/snes/tutorials/ex5.c.)</div><div><br></div><div>Note that all of these facts are exactly what petsc devs would want!  That is, the way the set of examples in the petsc tree are structured helps with fast development by a diverse dev team.</div><div><br></div><div>However the same facts make the examples less friendly to those who don't already know petsc.  Thus my opinion about the book's example codes is that a single source of stable examples, ordered by difficulty, closely tied to beginner documentation, of uniform style, and kinda boring to most petsc devs, is something I can supply and maintain.  So I'll be acting as editor to preserve the intent and simplicity of the examples.</div><div><br></div><div>Does that make sense?</div><div><br></div><div>Needless to say, fork my repo all you want!  The MIT license is nice and permissive.</div><div><br></div><div>Ed</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 30, 2020 at 4:50 PM Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com" target="_blank">junchao.zhang@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Prof. Ed Bueler,<div>   Congratulations on your book. I am eager to read it.</div><div>   I was wondering if it is feasible to add your example programs to PETSc tests so that readers will always be able to run your code.</div><div><div><div dir="ltr"><div dir="ltr">--Junchao Zhang</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 29, 2020 at 8:29 PM Ed Bueler <<a href="mailto:elbueler@alaska.edu" target="_blank">elbueler@alaska.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>All --</div><div><br></div>SIAM Press just published my new book "PETSc for Partial Differential Equations: Numerical Solutions in C and Python":<div><br><div>  <a href="https://my.siam.org/Store/Product/viewproduct/?ProductId=32850137" target="_blank">https://my.siam.org/Store/Product/viewproduct/?ProductId=32850137</a><div><br></div><div>The book is available both as a paperback and an e-book with working links.  A SIAM member discount is available, of course.</div><div><br></div><div>This book is a genuine introduction which does not assume you have used PETSc before, and which should make sense even if your differential equations knowledge is basic.  The prerequisites are a bit of programming in C and a bit of numerical linear algebra, roughly like the main ideas of Trefethen and Bau, but even that is reviewed and summarized.  I've made an effort to introduce discretizations from the beginning, especially finite differences and elements.</div><div><br></div><div>The book is based on a collection of example programs at <a href="https://github.com/bueler/p4pdes" target="_blank">https://github.com/bueler/p4pdes</a>.  Most of these codes call PETSc directly through the C API, but the last two chapters have Python codes using UFL and Firedrake.  Nonetheless the book contains ideas, mathematical and computational; it complements, but does not replace, the PETSc User's Manual and the tutorial examples in the PETSc source.  Concepts are explained and illustrated, with sufficient context to facilitate further development. Performance (optimality) and parallel scalability are the primary goals, so preconditioners including multigrid are central threads, and run-time solver options are explored in both the text and the exercises.</div><div><br></div><div>Here is the place to appreciate the usual PETSc suspects for their comments on drafts, and help in writing this book: Barry, Jed, Matt, Dave, Rich, Lois, Patrick, Mark, Satish, David K., and many others.  Also let me say that SIAM Press has nothing but professionals who are nice to work with too; send them your book idea!<br><div><br></div><div>Ed<br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Ed Bueler<br>Dept of Mathematics and Statistics<br>University of Alaska Fairbanks<br>Fairbanks, AK 99775-6660<br>306C Chapman<br></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Ed Bueler<br>Dept of Mathematics and Statistics<br>University of Alaska Fairbanks<br>Fairbanks, AK 99775-6660<br>306C Chapman<br></div></div></div></div></div></div></div>
</blockquote></div>