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
157 stars 98 forks source link

[WIP] Compile and install 3D Euler with gravity example #723

Closed carlosmunozmoncayo closed 2 months ago

carlosmunozmoncayo commented 3 months ago

The pyclaw/examples/euler_gravity_3d example is compiled and installed at run-time. ~The Fortran source is now located in this directory~.

The changes in this PR are tested here, along with #721 (although this PR does not depend on #721).

~If this PR is merged, the files euler3d_mappedGrid.f90, rpn3_euler_mapgrid.f90, rpt3_euler_mapgrid.f90, and rptt3_euler_mapgrid.f90 could be removed from src directory in the riemann repository.~

ketch commented 3 months ago

Is there a reason for moving the Riemann solver out of the Riemann repository and into PyClaw? That's generally the opposite of what we want to do.

carlosmunozmoncayo commented 3 months ago

@ketch I tried to do something similar to pyclaw/examples/advection_reaction_2d, avoiding using a relative path to the riemann repository in the Makefile. I guess the Makefile will not be necessary anymore if the Riemann solver and the mapGrid module are compiled at installation.

Then, I will leave the Riemann solver in the riemann repository, compile it at installation there, and update the imports in this example.

Should the mapGrid module euler3d_mappedGrid.f90 also stay in riemann/src, or should it be moved here?

ketch commented 3 months ago

I should have been more clear before. I think that all we want to do is add the code required for meson to compile what is already in this example directory.

ketch commented 3 months ago

I tried to do something similar to pyclaw/examples/advection_reaction_2d

That specific example is provided to show users how to incorporate their own Riemann solver. For all other examples, we keep the Riemann solver in Riemann.

I guess the Makefile will not be necessary anymore if the Riemann solver and the mapGrid module are compiled at installation.

That's correct.

Should the mapGrid module euler3d_mappedGrid.f90 also stay in riemann/src, or should it be moved here?

That's a good question; technically that code is not "Riemann solver" code, but it's basically required whenever one uses the 3D Euler mapped grid Riemann solver, so I think it makes sense to leave it in Riemann.

carlosmunozmoncayo commented 3 months ago

Ok, I'll add just the necessary changes for that in this PR and create another one for the compilation in the Riemann repository.

carlosmunozmoncayo commented 3 months ago

I made the changes. The imports in rising_hot_sphere.py and rising_hot_sphere_spherical.py rely on https://github.com/clawpack/riemann/pull/178 to work.