clawpack / pyclaw

PyClaw is a Python-based interface to the algorithms of Clawpack and SharpClaw. It also contains the PetClaw package, which adds parallelism through PETSc.
http://www.clawpack.com/pyclaw
BSD 3-Clause "New" or "Revised" License
165 stars 99 forks source link

We need more checks to avoid simple errors in setting up a problem #737

Open ketch opened 3 days ago

ketch commented 3 days ago

Recently I ran across a couple of things that we don't check and which I wasted significant time debugging in my own scripts:

mandli commented 3 days ago

First idea sounds good to me. Maybe a broader consistency check but we kind of do that already I suppose with num_eqn, etc.

The aux arrays may not be able to be filled in until after run is called although we could initialize the aux array to something temporarily. I might hesitate to do this as reasonable initial values may lead to more difficulty when debugging as NaNs would be easier to spot.

ketch commented 2 days ago

I guess you are right about the second one. Since we use a setter function for the aux array, we could add a flag that gets set the first time the setter is called. But that's a potential performance hit every time aux is modified, just to avoid a rather rare stupid mistake, so probably not worth it.

I've opened PRs that handle the fwave issue.