Package: gsml
OverviewDISCLAIMER - this is adevelopmentversion and has not been fully tested.GSML is a Python-based software library that implements manySpectral methodswhich are typically used for the solution of partial differential equations. This library is mainly focused on Fourier-type spectral methods, including a recently introduced Fourier continuation (FC) methodFC(Gram)[1]. The main benefit of spectral methods is that they have optimal convergence properties, so-called “exponential” convergence, for approximating functions and their derivatives.This library is being developed to address a few key problems that face researchers when trying to solve complex differential equations:High-order approximations: for many use-cases low-order approximations require unreasonably, many times infeasibly, fine spatial discretization. Access to higher-order approximations, in addition to increasing spatial refinement, is an intuitive approach to solving complex differential equations.Parallel computing: parallel computing has been a key enabler of the growth of computational science, usage of the FC(Gram) method has been shown to exhibit optimal parallel scaling when solving the Navier-Stokes equation [2].Heterogenous computing: Fourier spectral method and its derivatives, such as FC(Gram), utilize the Fast Fourier Transform which benefits from the presence of SIMD accelerators. Thus the combination of parallel operation and SIMD acceleration is ideal for newly emerging heterogeneous computing environments. The main focus for GSML is fused CPU/GPU architectures.Ease of use: Python is used as the user interface and high-level development language for GSML with NumPy and GMPy “under the hood.”In this current development release, the first and last of these goals have been addressed. SIMD accelerator/GPU support is planned for the next development release, followed by parallelization restricted to Cartesian domains.[1] Bruno and Lyon (2010) J. Comp. Phys.link 1/link 2[2] Bruno and Albin (2011) J. Comp. Phys.linkInstallationThis package uses the setuptools-enhancement of Python’s Distutils, so installation is quite simple:Check for the latest version of GSMLhttps://launchpad.net/gsmlInstall GSML’s dependencies, NumPy and GMPyOnce the package has been downloaded, install the package locally:cd gsml-0.1.0
./setup.py install --userRun GSML’s tests, but these do not currently exist, so instead try one of the examples/ to determine if the library is functioning properly.Documentation and HelpCurrently no documentation beyond the docstrings exists for GSML. Several useful examples have been provided, so if these do not provide enough information to get started, you can find help here:https://answers.launchpad.net/gsml.ExamplesMany examples of GSML’s usage can be found in the examples/ directory including:Interpolation of a 1D nonperiodic function.Interpolation of a 1D periodic function.Interpolation of a 2D function on a mixed periodic and nonperiodic domain.Solution of the transient 1D diffusion equation with natural/Dirichlet boundary conditions.Solution of the transient 1D wave equation with natural/Dirichlet boundary conditions.A simple example similar to example #1 from above is:from numpy import *
import pylab

import gsml

# the exact function
u = lambda x: sin(x) + cos(x)

# configure the parameters of the simulation, a periodic domain with
# x=[0,2*pi) and 10 collocation points
params = {
    'shape' : (10,),        # the number of collocation points
    'scale': (2.*pi,),      # the scale of the domain
    'periodicity' : (True,), # domain is periodic => Fourier Spectral Method
    }

# initialize GSML
grid = gsml.CartesianGrid(params)

x = grid.x

# approximate the first and third derivative of u(x)
ux = grid.dudx(u(x),1)
uxxx = grid.dudx(u(x),3)Contributors and ContributingIf you are interested in contributing, please see GSML’s current blueprintbugsandblueprint. GSML’s Development team can be contacted through Launchpad herehttps://launchpad.net/~gsml-developers.GSML is currently being developed by:N.M. Abukhdeir, Department of Chemical Engineering, University of WaterlooPomorski, SHARCNET, University of WaterlooAcknowledgementsThis work was made possible byNatural Sciences and Engineering Research Council of Canada(NMA), theShared Hierarchical Academic Research Computing Network, and Compute Canada.