Skip to content

Instantly share code, notes, and snippets.

View ketch's full-sized avatar

David Ketcheson ketch

View GitHub Profile
@ketch
ketch / setplot.py
Created May 29, 2013 14:38
Code for running the LY stegoton experiment with moving wall boundary condition.
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
#--------------------------
@ketch
ketch / DC_general.py
Created June 12, 2013 11:56
Generalized deferred correction tableau construction
def DC_general(nnodes,niterations,theta=0,grid='eq'):
""" Spectral deferred correction methods.
For now, based on explicit Euler and equispaced points.
This version allows the number of nodes and iterations to be different.
**Input**: s -- number of grid points & number of correction iterations
**Output**: A ExplicitRungeKuttaMethod
Note that the number of stages is NOT equal to s. The order
@ketch
ketch / acoustics_3d.py
Created July 13, 2013 10:30
3D acoustics problem setup for comparison with Clawpack 4.3.
#!/usr/bin/env python
# encoding: utf-8
import numpy as np
def acoustics3D(iplot=False,htmlplot=False,use_petsc=False,outdir='./_output',solver_type='classic',disable_output=False,**kwargs):
"""
Example python script for solving the 3d acoustics equations.
"""
@ketch
ketch / quadrants.py
Created July 15, 2013 06:24
Quadrants test in PyClaw
#!/usr/bin/env python
# encoding: utf-8
"""
Solve the Euler equations of compressible fluid dynamics.
"""
from clawpack import pyclaw
from clawpack import riemann
solver = pyclaw.ClawSolver2D(riemann.rp2_euler_4wave)
@ketch
ketch / pyclaw_shaheen.sh
Last active December 21, 2015 16:28
Script to install PyClaw on Shaheen, written by Aron Ahmadia. See full instructions here: https://github.com/clawpack/pyclaw/wiki/Installing-and-running-on-Shaheen
echo "\nPrep/Setup"
echo "~~~~~~~~~~"
echo "pyclaw_prep - set up build environment"
pyclaw_prep() {
projdir=/your/chosen/directory
sandbox=${projdir}/sandbox
echo "sandbox=${sandbox}"
builddir=${projdir}/opt/share
@ketch
ketch / gist:6333443
Last active December 21, 2015 16:28
Submit test job for PyClaw on Shaheen
#!/usr/bin/env bash
#
# @ job_name = test_pyclaw
# @ job_type = bluegene
# @ output = ./$(job_name)_$(jobid).out
# @ error = ./$(job_name)_$(jobid).err
# @ environment = COPY_ALL;
# @ wall_clock_limit = 0:15:00,0:15:00
# @ notification = always
# @ bg_size = 64
@ketch
ketch / Intro to PyClaw -- IPython notebook
Last active January 2, 2016 16:49
This notebook gives a quick introduction to PyClaw. #pyclaw
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@ketch
ketch / quadrants.ipynb
Created January 9, 2014 11:59
An example showing how to solve the 2D Euler equations in PyClaw, as an IPython notebook.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ketch
ketch / stegotons.ipynb
Last active January 4, 2016 02:19
This is an IPython notebook showing how to reproduce the solitary waves called stegotons, discovered by LeVeque & Yong in 2003.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ketch
ketch / shallow_water_diffraction.ipynb
Last active May 31, 2018 07:10
Shallow water solitary waves over periodic bathymetry. #pyclaw #shallow-water #periodic-media
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.