.packageName <- "sjerd"
diffuse2d <- function(p, nx, ny, dx) {
  z <- .C("flux2d",
          as.double(p),
          as.integer(nx), as.integer(ny),
          flux = double(length(p)),
          as.double(dx))
  ## A check on the calculation is that the sum of the fluxes should be
  ## zero -- there should be no net creation or destruction of
  ## substance.
  
  z$flux
}
.First.lib <- function(lib, pkg)
  library.dynam("sjerd", pkg, lib)

.Last.lib <- function (libpath) {
  ## Run when the package is being unloaded.  This allows us to test
  ## packages within same session when dynlib is updated.
  library.dynam.unload("sjerd", libpath)
}
