2
$\begingroup$

I have been writing an adaptive mesh refinement (amr) code. As a prototype for the code, I have been looking at an adaptive mesh refinement code written by my adviser (written in c). I find looking at their code to be useful, but the also does things like make heavy use of global variables, and I am wondering if there are potentially better ways of implementing Berger and Oliger syle amr.

Could someone point me to some source code for a simple (say one dimensional) amr code for hyperbolic pde? I'd like to compare and contrast with what my adviser wrote (which is not publicly available so I unfortunately cannot link to it here). I have been looking at the websites or other amr codes (e.g. chombo) but I haven't found simple example implementation of the basic Berger and Oliger algorithm. Links to, for example public github repositories would work.

EDIT: while there is now an "accepted" answer (a link to Berger's website which includes documentation on amr code), that code is mostly written in Fortran; I would certainly appreciate links to example amr codes with documentation written in other languages (e.g. c++)!

$\endgroup$
  • 1
    $\begingroup$ I can pretty much say with certainty that no code needs global variables. So the answer should be yes, there are better ways of implementing the software. I don’t know if and when you’ll find a good example code, but in the meantime you can work on laying out the sort of objects you need to represent, the operations that will be performed on and by them, what the data will be you’re working with.. and with this, you should be able to come up with a design that avoids global variables. $\endgroup$ – spektr Jul 31 '19 at 13:59
4
$\begingroup$

Marsha has made quite a bit of her source code available over the years. Some of it is no longer supported, but given that she is the Berger in Berger and Oliger, checking her website and the clawpack website (which also has her code and given that its a collaboration between her, Randy and others), seems like a good start.

https://cs.nyu.edu/berger/

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ This is very useful, although the amr code is mostly in Fortran and also uses some older constructs like gotos (e.g. the code example given in cs.nyu.edu/berger/amrsoftware.html) $\endgroup$ – Justin Aug 2 '19 at 1:26
0
$\begingroup$

Newer versions of Clawpack and AMRClaw/GeoClaw do include some 1D versions but I am not sure that's going to be entirely helpful. Donna Calhoun has a page that attempts to list some well-used codes that you might find interesting.

Also sorry for not getting to post this earlier.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.