Commit ecb03dd2 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

import lammps-netcdf code as USER-NC-DUMP package

parent 0eb7fbf3
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
# Settings that the LAMMPS build will import when a package using the
# netCDF library is installed. This tries to automate configuration
# via the nc-config tool, which is part of the netCDF installation.

ifeq ($(shell nc-config --has-pnetcdf),no)

netcdf_SYSINC = $(shell nc-config --cflags)
netcdf_SYSLIB = $(shell nc-config --libs)
netcdf_SYSPATH =

endif

ifeq ($(shell nc-config --has-pnetcdf),yes)

netcdf_SYSINC = -DLMP_HAS_PNETCDF $(nc-config --cflags)
netcdf_SYSLIB = $(shell nc-config --libs)
netcdf_SYSPATH =

endif
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ PACKUSER = user-atc user-awpmd user-cg-cmm user-colvars \

PACKLIB = compress gpu kim kokkos meam mpiio poems python reax voronoi \
	  user-atc user-awpmd user-colvars user-h5md user-lb user-molfile \
	  user-qmmm user-quip user-vtk
	  user-nc-dump user-qmmm user-quip user-vtk

PACKALL = $(PACKAGE) $(PACKUSER)

+63 −0
Original line number Diff line number Diff line
# Install/unInstall package files in LAMMPS
# mode = 0/1/2 for uninstall/install/update

mode=$1

# enforce using portable C locale
LC_ALL=C
export LC_ALL

# arg1 = file, arg2 = file it depends on

action () {
  if (test $mode = 0) then
    rm -f ../$1
  elif (! cmp -s $1 ../$1) then
    if (test -z "$2" || test -e ../$2) then
      cp $1 ..
      if (test $mode = 2) then
        echo "  updating src/$1"
      fi
    fi
  elif (test -n "$2") then
    if (test ! -e ../$2) then
      rm -f ../$1
    fi
  fi
}

for file in *.cpp *.h; do
  action $file
done

# edit 2 Makefile.package files to include/exclude package info

if (test $1 = 1) then

  if (test -e ../Makefile.package) then
    sed -i -e 's/[^ \t]*netcdf[^ \t]* //g' ../Makefile.package
    sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(netcdf_SYSINC) |' ../Makefile.package
    sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(netcdf_SYSLIB) |' ../Makefile.package
    sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(netcdf_SYSPATH) |' ../Makefile.package
  fi

  if (test -e ../Makefile.package.settings) then
    sed -i -e '/^include.*netcdf.*$/d' ../Makefile.package.settings
    # multiline form needed for BSD sed on Macs
    sed -i -e '4 i \
include ..\/..\/lib\/netcdf\/Makefile.lammps
' ../Makefile.package.settings

  fi

elif (test $1 = 0) then

  if (test -e ../Makefile.package) then
    sed -i -e 's/[^ \t]*netcdf[^ \t]* //g' ../Makefile.package
  fi

  if (test -e ../Makefile.package.settings) then
    sed -i -e '/^include.*netcdf.*$/d' ../Makefile.package.settings
  fi

fi
+37 −0
Original line number Diff line number Diff line
USER-NC-DUMP
============

This package provides the nc and (optionally) the nc/mpiio dump styles.

PACKAGE DESCRIPTION
-------------------

This is a LAMMPS (http://lammps.sandia.gov/) dump style for output into a NetCDF
database. The database format follows the AMBER NetCDF trajectory convention
(http://ambermd.org/netcdf/nctraj.xhtml), but includes extensions to this
convention. These extension are:
* A variable "cell_origin" (of dimension "frame", "cell_spatial") that contains
  the bottom left corner of the simulation cell.
* Any number of additional variables corresponding to per atom scalar, vector
  or tensor quantities available within LAMMPS. Tensor quantities are written in
  Voigt notation. An additional dimension "Voigt" of length 6 is created for
  this purpose.
* Possibility to output to an HDF5 database.

NetCDF files can be directly visualized with the following tools:
* Ovito (http://www.ovito.org/). Ovito supports the AMBER convention and all of
  the above extensions.
* VMD (http://www.ks.uiuc.edu/Research/vmd/).
* AtomEye (http://www.libatoms.org/). The libAtoms version of AtomEye contains
  a NetCDF reader that is not present in the standard distribution of AtomEye.

The person who created these files is Lars Pastewka at
Karlsruhe Institute of Technology (lars.pastewka@kit.edu).
Contact him directly if you have questions.

Lars Pastewka  
Institute for Applied Materials (IAM)  
Karlsruhe Institute of Technology (KIT)  
Kaiserstraße 12, 76131 Karlsruhe  
e-mail: lars.pastewka@kit.edu
+1144 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading