Ed, 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. --Junchao Zhang
On Fri, Oct 30, 2020 at 9:00 PM Ed Bueler <elbue...@alaska.edu> wrote: > Junchao-- > > > 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. > > 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.) > > First, the example programs are in a completely public spot: > https://github.com/bueler/p4pdes > 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. > > In fact, here are things one may observe about the petsc tutorial > src/XX/tutorials/exN.c) examples: > > 1. They may or may not point to a clear document(s) which can help a > beginner know how they are designed. > 2. They don't have a uniform style because of different authorship. > 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.) > 4. Their features evolve over time as developers work with the examples > as regression/feature tests. (See src/snes/tutorials/ex5.c.) > > 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. > > 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. > > Does that make sense? > > Needless to say, fork my repo all you want! The MIT license is nice and > permissive. > > Ed > > > > On Fri, Oct 30, 2020 at 4:50 PM Junchao Zhang <junchao.zh...@gmail.com> > wrote: > >> Prof. Ed Bueler, >> Congratulations on your book. I am eager to read it. >> 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. >> --Junchao Zhang >> >> >> On Thu, Oct 29, 2020 at 8:29 PM Ed Bueler <elbue...@alaska.edu> wrote: >> >>> All -- >>> >>> SIAM Press just published my new book "PETSc for Partial Differential >>> Equations: Numerical Solutions in C and Python": >>> >>> https://my.siam.org/Store/Product/viewproduct/?ProductId=32850137 >>> >>> The book is available both as a paperback and an e-book with working >>> links. A SIAM member discount is available, of course. >>> >>> 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. >>> >>> The book is based on a collection of example programs at >>> https://github.com/bueler/p4pdes. 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. >>> >>> 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! >>> >>> Ed >>> >>> -- >>> Ed Bueler >>> Dept of Mathematics and Statistics >>> University of Alaska Fairbanks >>> Fairbanks, AK 99775-6660 >>> 306C Chapman >>> >> > > -- > Ed Bueler > Dept of Mathematics and Statistics > University of Alaska Fairbanks > Fairbanks, AK 99775-6660 > 306C Chapman >