AMR in PyClaw?

13 views
Skip to first unread message

Wes Lowrie

unread,
Jul 16, 2019, 2:30:50 PM7/16/19
to claw-dev
Hi,

I'm wondering what the current status of AMR is in PyClaw?  Looking through claw-dev, claw-users, and the git wiki I see that there had been some activity and talk about best approaches, and maybe some development during code sprints, but I was wondering what state it might be in?  Obviously there is amrclaw for classic clawpack, but it does not seem like there is a simple way to incorporate that code into PyClaw for a number of reasons.

Thanks for the guidance,
Wes

Kyle Mandli

unread,
Jul 16, 2019, 3:53:39 PM7/16/19
to claw-dev
Hi Wes,

We had goals to do so but it never quite came to fruition.  Probably the closest it came was a Python wrapper around BoxLib.  In principle this or some other library that concentrates on spatial discretization, similar to how we use PETSc, would be the best way forward.

Kyle
--
You received this message because you are subscribed to the Google Groups "claw-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw-dev+u...@googlegroups.com.
To post to this group, send email to claw...@googlegroups.com.
Visit this group at https://groups.google.com/group/claw-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/claw-dev/0d724b68-e2a9-4e4e-bbba-51d2ce84e3ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wes Lowrie

unread,
Jul 16, 2019, 4:35:59 PM7/16/19
to claw-dev
Hi Kyle,
That would be nice to have a library akin to PETSc that could provide AMR.  I wonder if the successor to BoxLib, AMReX (https://amrex-codes.github.io/amrex/) has capabilities as such?

Thanks,
Wes

On Tuesday, July 16, 2019 at 12:53:39 PM UTC-7, Kyle Mandli wrote:
Hi Wes,

We had goals to do so but it never quite came to fruition.  Probably the closest it came was a Python wrapper around BoxLib.  In principle this or some other library that concentrates on spatial discretization, similar to how we use PETSc, would be the best way forward.

Kyle
On Jul 16, 2019, 12:30 PM -0600, Wes Lowrie <wesl...@gmail.com>, wrote:
Hi,

I'm wondering what the current status of AMR is in PyClaw?  Looking through claw-dev, claw-users, and the git wiki I see that there had been some activity and talk about best approaches, and maybe some development during code sprints, but I was wondering what state it might be in?  Obviously there is amrclaw for classic clawpack, but it does not seem like there is a simple way to incorporate that code into PyClaw for a number of reasons.

Thanks for the guidance,
Wes

--
You received this message because you are subscribed to the Google Groups "claw-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw...@googlegroups.com.

Donna Calhoun

unread,
Jul 16, 2019, 6:25:45 PM7/16/19
to claw...@googlegroups.com
Hi Wes, 

AMREx is a well-established DOE code, and as such would of course be an excellent place to start. 

Alternatively, you might check out ForestClaw (www.forestclaw.org), an adaptive mesh code based on a quadtree/octree refinement.  It is currently set up to work with Clawpack solvers, so should be very familiar to Clawpack users.  The adaptivity is based on p4est (www.p4est.org), a highly scalable quadtree/octree meshing library designed for solving PDEs. A PyClaw wrapper to ForestClaw would be a do-able project. 

I’d be happy to give you more details, if you are interested. 

Take care, 

Donna


To unsubscribe from this group and stop receiving emails from it, send an email to claw-dev+u...@googlegroups.com.

To post to this group, send email to claw...@googlegroups.com.
Visit this group at https://groups.google.com/group/claw-dev.

Wes Lowrie

unread,
Jul 16, 2019, 7:13:53 PM7/16/19
to claw-dev
Hi Donna,
Thanks, that's good to hear  At this point I am assessing options for some sort of mesh refinement in an already developed PyClaw based code.

The way I see it, some good options are:
1) Modify existing PyClaw code to work with classic clawpack and then just use forestclaw or amrclaw.
2) Develop a PyClaw wrapper to ForestClaw as you suggest
3) Incorporate an existing AMR library into PyClaw

#1 is probably the easiest, but it would abandon some of the nice features of PyClaw.  I like your suggestion (#2) as the AMR has already been developed in clawpack and might be mostly compatible with PyClaw?

Yes, any additional details are appreciated!

Thanks,
Wes

Donna Calhoun

unread,
Jul 16, 2019, 7:23:24 PM7/16/19
to claw...@googlegroups.com
Hi Wes, 

Well, I have written ForestClaw with the idea that it can be wrapped.   It is written in C (with Clawpack extensions written in the original Fortran), so should play well with PyClaw.  

I am not clear on the difference between #1 and #2.  I guess I don’t know how PyClaw is structured to really know how #1 would work.  But I think a PyClaw wrapper would be quite doable.  Basically, PyClaw can handle the time stepping, and setup parameters, etc.  ForestClaw works with all the Riemann solvers in the riemann repo (in fact, it handles both 4.x and 5.x versions of clawpack).  I’ve worked pretty hard to encapsulate everything so that much of the hard work is encapsulated in a single time step on a coarse grid, which can be called from PyClaw. 

Anyhow, I’d be happy to be involved in a project like this, if you are interested.  

A few Forestclaw limitations at this point : 

* It is only 2d, but we can solve on 3d extruded meshes (2d refinement, with 3d patches).  3d is the next big project.
* We are just now getting elliptic solvers working. 
* Still need work on getting wider range of output and vis formats, but maybe PyClaw has done work on this already.

Take care, 

Donna


To unsubscribe from this group and stop receiving emails from it, send an email to claw-dev+u...@googlegroups.com.

To post to this group, send email to claw...@googlegroups.com.
Visit this group at https://groups.google.com/group/claw-dev.

David Ketcheson

unread,
Jul 17, 2019, 5:30:21 AM7/17/19
to claw-dev
As others have already said, this is something we have always wanted but never got quite enough impetus to develop.  If you want to pursue it, I would be happy to support that in any way possible (including if you and/or a student wanted to come for a visit to KAUST to work together on it for some time).

-David

Kyle Mandli

unread,
Jul 17, 2019, 11:26:49 AM7/17/19
to claw-dev
To add to that I am sure we could also spend sometime and catch you up on what’s been going on and what has been done.

Kyle
On Jul 17, 2019, 3:30 AM -0600, David Ketcheson <dke...@gmail.com>, wrote:
As others have already said, this is something we have always wanted but never got quite enough impetus to develop.  If you want to pursue it, I would be happy to support that in any way possible (including if you and/or a student wanted to come for a visit to KAUST to work together on it for some time).

-David

--

You received this message because you are subscribed to the Google Groups "claw-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw-dev+u...@googlegroups.com.
To post to this group, send email to claw...@googlegroups.com.
Visit this group at https://groups.google.com/group/claw-dev.

Wes Lowrie

unread,
Jul 17, 2019, 6:45:21 PM7/17/19
to claw-dev
Hi Donna,

For #1 I was just thinking of abandoning PyClaw entirely, and just using classic clawpack/forestclaw/amrclaw directly.  Some modification of my current code would be necessary, but the AMR work is already mature and working so that would be a benefit.  The downside is that it would lose any of the features unique to PyClaw.

With that said I like the idea of developing a wrapper for forestclaw.  Glad you had the foresight encapsulate everything, I'm sure that will make things much easier!
We do use a full 3D geometry, including mapped grids (typically a spherical grid).  2D AMR with extrusions into 3D might be sufficient in the near term though.

PyClaw outputs in ASCII, binary, hdf5, and netcdf formats.  I have been using HDF5 output along with a simple script to generate xdmf files so it can be read by Visit and Paraview.

Best,
Wes

Wes Lowrie

unread,
Jul 17, 2019, 6:46:43 PM7/17/19
to claw-dev
Happy to hear there is interest in this.  I'm sure many would benefit from the inclusion of AMR in PyClaw.

Wes


On Wednesday, July 17, 2019 at 8:26:49 AM UTC-7, Kyle Mandli wrote:
To add to that I am sure we could also spend sometime and catch you up on what’s been going on and what has been done.

Kyle
On Jul 17, 2019, 3:30 AM -0600, David Ketcheson <dke...@gmail.com>, wrote:
As others have already said, this is something we have always wanted but never got quite enough impetus to develop.  If you want to pursue it, I would be happy to support that in any way possible (including if you and/or a student wanted to come for a visit to KAUST to work together on it for some time).

-David

--
You received this message because you are subscribed to the Google Groups "claw-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to claw...@googlegroups.com.

Donna Calhoun

unread,
Jul 17, 2019, 8:25:40 PM7/17/19
to claw...@googlegroups.com
Hi Wes, 

What kind of sphere mapping are you using? ForestClaw can do a 3d extruded mesh on the cubed sphere, if that is on any interest.  In fact, I have spent considerable effort to get mapped grids working in ForestClaw (including recent work on the conservative fix for this special case). 

What unique features in PyClaw are you making use of and that are not available in AMRClaw or the classic version? 

Take care, 

Donna

To unsubscribe from this group and stop receiving emails from it, send an email to claw-dev+u...@googlegroups.com.

To post to this group, send email to claw...@googlegroups.com.
Visit this group at https://groups.google.com/group/claw-dev.

Wes Lowrie

unread,
Jul 18, 2019, 5:53:40 PM7/18/19
to claw-dev
Hi Donna,

We typically do not mesh an entire sphere, but just a spherical shell section.  As you could probably guess since we are using PyClaw, we have a structured hex mesh that is logically a cube, and then is mapped into a spherical grid.  To be specific, it is a earth centered spherical mesh that represents some portion of the Earth's atmosphere.

I am not 100% familiar with all the current differences between clawpack and PyClaw, but I think the unique features of PyClaw that we use are:
  • python driver script to specify IC, BCs, and source terms
  • parallelism via PETSc
  • HDF5 output
  • ??maybe others??
Possibly with the exception of PETSc, all the other aspects could easily be rewritten for classic clawpack (or possible forestclaw and amrclaw).  The convenience of Python is important, but maybe worth giving up to test AMR features.

Thanks,
Wes
Donna

Reply all
Reply to author
Forward
0 new messages