Diamond Scheme

Mathematical Introduction

The multi-Hamiltonian PDE is \begin{equation} K\mathbf{z}_t + L\mathbf{z}_x = \nabla S(\mathbf{z}), \label{eqn:hampde} \end{equation} where \(K\) and \(L\) are constant \(n \times n\) real skew-symmetric matrices, $\mathbf{z}: \mathbb{R}^2 \Rightarrow \mathbb{R}^n$, and $S: \mathbb{R}^n \rightarrow \mathbb{R}$. As an example, by introducing $\mathbf{z} = (u, v, w)$, $v = u_t$ and $w = u_x$ the one dimensional wave equation, $u_{tt} - u_{xx} = f'(u)$, can be written in this multi-Hamiltonian form with \begin{equation} \label{eqn:1dwaveeqn} K = \begin{pmatrix} 0 & -1 & 0\\1 & 0 & 0\\0 & 0 & 0 \end{pmatrix}, \quad L = \begin{pmatrix} 0 & 0 & 1\\0 & 0 & 0\\-1 & 0 & 0 \end{pmatrix}, \quad \mathrm{and} \quad \nabla S(\mathbf{z}) = \begin{pmatrix} -f'(u)\\v\\-w\end{pmatrix}. \end{equation} Other equations that can be written in this form include Schrödinger's equation, the Korteweg-de Vries equation, and Maxwell's electromagnetic wave equation. The solution to this PDE satisfies the multi-symplectic conservation law \begin{equation} \omega_t + \kappa_x = 0, \label{eqn:symlaw} \end{equation} where $\omega = \frac{1}{2} (d\mathbf{z} \wedge K d\mathbf{z})$ and $\kappa = \frac{1}{2} (d\mathbf{z} \wedge L d\mathbf{z})$. A numerical method that satisfies a discrete version of this conservation law is called a multi-symplectic integrator. The Euler-box and Preissman/Keller-box schemes are two such methods; both have order two. A higher order method is given by Reich. It only works when $n$ is odd, and for problems with periodic boundary conditions, it also requires an expensive non-linear solve at each time step. The method presented here, which is based on Reich's work, overcomes these problems.

Code Introduction

The Diamond Scheme numerically solves the multi-Hamiltonian PDE given above. Downloads are below. Currently there are uniprocessor and MPI python implementations, and a uniprocessor C version. Any problem with periodic boundary conditions is supported. There is a README in the latest version that describes how to run it.

Downloads

diamond-0.05.tar.gzFor ease of development the C uniprocessor version is gone. The MPI C version supersedes it (and if you don't have mpich2 installed, a fake mpi library is used and you will get uniprocessor performance)
diamond-0.04.tar.gzIncludes an MPI C version
diamond-0.03.tar.gzIncludes a non-MPI C version (60 times faster than non-MPI python version)
diamond-0.02.tar.gzMerged uniprocessor and MPI versions, gracefully handles no MPI libraries
Removed ability to output at internal edge points and average initialization
General clean up
diamond-0.01.tar.gzSeparate uniprocessor and MPI versions.
Can output data at internal edge points
Can do the average initialization to compare SDS and r=1 methods