Astrophysics Simulation Codes

Castro: compressible hydrodynamics
Castro is our fully compressible hydrodynamics code built on the adaptive mesh refinement library AMReX. It supports selfgravity, diffusion, general equations of state, nuclear reactions, and more. 
MAESTROeX: low Mach number stratified flows
MAESTROeX is a low Mach number hydrodynamics code built on the AMReX library. It supports a general equation of state and is designed for problems involving stellar convection. 
AMReXAstro Microphysics
AMReXAstro Microphysics is a collection of reaction networks, EOSes, and other physics modules for use in our AMReXAstrophysics suite of hydrodynamics codes.

pyro: a python hydro code
pyro is a tutorial code designed to introduce new students into computational hydrodynamics. The python code implements 2d solvers for linear advection, compressible hydrodynamics, multigrid, implicit diffusion, and incompressible hydrodynamics. 
pynucastro: python for nuclear astrophysics
pynucastro interfaces to nuclear reaction rate databases and allows for the exploration of reaction networks and the output of network ODE righthand sides for integrating in a stellar physics code. 
PPMpy: python piecewise parabolic method
ppmpy is a simple 1d compressible hydrodynamics code that implements the piecewise parabolic method. It is written in python and has many methods to visualize the steps that PPM is taking in the reconstruction of the data.
Astronomy / Numerical Methods Education Codes

Intro astronomy animations
A set of introductory astronomy animations (Kepler's laws, Doppler shifts, parallax, ...) coded in python. These are also available on YouTube.

Computational Astro Jupyter Book
An interactive introduction to the core numerical methods used in astrophysics, including those for astrophysical simulations, written as a collection of Jupyter notebooks that can run in the cloud.
Simple Numerical PDE Examples

Godunov methods for linear advection
A simple 1d secondorder accurate finitevolume method for the linear advection equation. A choice of reconstruction is provided: Godunov (piecewise constant), piecewise linear, and piecewise parabolic (PPM). The code is structured to with the subroutines you would find in a typical hydrodynamics code.
Fortran version:
advect.f90python version (no ppm):
advection.py 
Multigrid examples
A simple python class for solving 1d Poisson and constantcoefficient Helmholtz equations on a finitevolume grid. The driver program (mg_test.py) solves u_{xx} = sin(x), u(0)=0, u(1)=0. The discretization is second order (mgconverge.png).Also see pyro for a 2d solver.

Diffusion
Simple 1d secondorder explicit and implicit diffusion codes. The implicit code uses a CrankNicolson time discretization and the banded matrix solver from SciPy.diffusion_explicit.py
diffusion_implicit.pyAlso see pyro for a 2d solver.

2^{nd} order finite volume method for Burgers' equation
A simple secondorder accurate finitevolume method for the 1d Inviscid Burgers' Equation:
u_{t} + [1/2 u^{2}]_{x} = 0
A choice of limiters is provided, and periodic BCs are implemented. The code is structured to with the subroutines you would find in a typical hydrodynamics code.Fortran version:
burger.f90python version:
burgers.py 
Viscous Burgers' equation solver
Solve:
u_{t} + [ 1/2 u^{2} ]_{x} = ε u_{xx}
using a secondorder Godunov method for advection and CrankNicolson implicit diffusion for the viscous term. The two processes are coupled together. 
Diffusionreaction equation
Solve:
φ_{t} = κ φ_{xx} + (1/τ) R(φ)
using CrankNicolson diffusion and Strangsplit reactions. This setup gives rises to a spreading burning front.
Parallel Programming

OpenMP Relaxation Solver of Poisson's Equation
Solve the 2d Poisson equation with pure relaxation (we do a fixed number of iterations). This is parallelized with OpenMP. 
MPI Relaxation Solver of Poisson's Equation
Solve the 2d Poisson equation with pure relaxation (we do a fixed number of iterations). This is parallelized with MPI, doing a onedimensional domain decomposition in the x direction.

Parallel I/O Tutorial
A simple parallel I/O tutorial showing various ways to output data from a parallel hydrodynamics code into a single HDF5 file.
Utilities / Other Examples

Simple Backup Script
A simple script for automatically backing up several directories in your home directory to another disk mounted on your local system. To have this run automatically, set it up as a cron job.

Research Journal
A python script to manage a research journal / logbook in restructured text / Sphinx. It is distributed (uses git under the hood), so you can use it on all of the machines you work on and keep things in sync, and it is commandline driven, so the barrier to entry to make a journal entry is very low. It supports images in an entry, editing previous entries, and has simple subcommands to build and display your webbased journal.