[petsc-dev] code duplication in snes ex12.c

Matthew Knepley knepley at gmail.com
Thu Nov 14 15:03:50 CST 2013


On Thu, Nov 14, 2013 at 2:01 PM, Geoffrey Irving <irving at naml.us> wrote:

> The SetupElement, SetupMaterialElement, and SetupBdElement functions
> are almost entirely duplicates of each other:
>
>     ./src/snes/examples/tutorials/ex12.c
>
> This makes it a bit difficult to understand what's going on: I'm new
> the code, so I had to run a diff to confirm that the boundary spaces
> are allocated identically to the interior spaces (I naively expected a
> difference, but it's apparently elsewhere in the code).
>
> Are there any objections to me refactoring the code a bit to avoid the
> duplication?


No, however it would be nice to verify that the current tests run:

  ./config/builder2.py check src/snes/examples/tutorials/ex12.c

The copying was intentional, since I never refactor the first time I am
writing things. Now that it has started to work, that is appropriate.

  Thanks,

     Matt


>
> Geoffrey
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131114/11192195/attachment.html>


More information about the petsc-dev mailing list