git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12053 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-05-30 13:48:37 +00:00
parent 2e521b2a67
commit 4e3bc9d059
5 changed files with 175 additions and 115 deletions

View File

@ -1,12 +1,10 @@
Kokkos library
Carter Edwards, Christian Trott, others ??? (CT NOTE)
Carter Edwards, Christian Trott, Daniel Sunderland
Sandia National Labs
CT NOTE: Version ???
27 May 2014
CT NOTE: Pointer to Kokkos web page???
29 May 2014
http://trilinos.sandia.gov/packages/kokkos/
-------------------------
@ -22,14 +20,14 @@ application like LAMMPS. First, it allows a single implementation of
an application kernel (e.g. a pair style) to run efficiently on
different kinds of hardware (GPU, Intel Phi, many-core chip).
Second, it adjusts the memory layout of basic data structures like 2d
and 3d arrays specifically for the chosen hardware. These are used in
LAMMPS to store atom coordinates or forces or neighbor lists. The
layout is chosen to optimize performance on different platforms.
Again this operation is hidden from the developer, and does not affect
how the single implementation of the kernel is coded.
CT NOTE: More details???
Second, it provides data abstractions to adjust (at compile time) the
memory layout of basic data structures like 2d and 3d arrays and allow
the transparent utilization of special hardware load and store units.
Such data structures are used in LAMMPS to store atom coordinates or
forces or neighbor lists. The layout is chosen to optimize
performance on different platforms. Again this operation is hidden
from the developer, and does not affect how the single implementation
of the kernel is coded.
To build LAMMPS with Kokkos, you should not need to make any changes
to files in this directory. You can overrided defaults that are set
@ -43,3 +41,4 @@ CUDA_PATH setting in Makefile.lammps needs to point to the
installation of the Cuda software on your machine. The normal default
location is /usr/local/cuda. If this is not correct, you need to edit
Makefile.lammps.

View File

@ -1,6 +1,13 @@
Axel Kohlmeyer is the current maintainer of the msi2lmp tool.
Please send any inquiries about msi2lmp to the lammps-users mailing list.
27 May 2014 Axel Kohlmeyer <akohlmey@gmail.com>
Added TopoTools style type hints as comments to all Mass, PairCoeff,
BondCoeff, AngleCoeff, DihedralCoeff, ImproperCoeff entries.
This should make it easier to identify force field entries with
the structure and force field map in the data file later.
06 Mar 2014 Axel Kohlmeyer <akohlmey@gmail.com>
Fixed a bug in handling of triclinic cells, where the matrices to
@ -69,7 +76,7 @@ see msi2lmp/TriclinicModification.pdf doc for details
This program uses the .car and .mdf files from MSI/Biosyms's INSIGHT
program to produce a LAMMPS data file.
1. Building msi2lmp3
1. Building msi2lmp
Use the Makefile in the src directory. It is
currently set up for gcc. You will have to modify
@ -154,7 +161,7 @@ see msi2lmp/TriclinicModification.pdf doc for details
****************************************************************
*
* Msi2lmp3
* msi2lmp
*
* This is the third version of a program that generates a LAMMPS
* data file based on the information in MSI .car (atom

View File

@ -30,8 +30,10 @@ void WriteDataFile(char *nameroot)
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA)) total_no_angle_angles = 0;
fprintf(DatF, "LAMMPS data file. msi2lmp " MSI2LMP_VERSION
" / CGCMM for %s\n\n", nameroot);
if (hintflag) fprintf(DatF, "LAMMPS data file. msi2lmp " MSI2LMP_VERSION
" / CGCMM for %s\n\n", nameroot);
else fprintf(DatF, "LAMMPS data file. msi2lmp " MSI2LMP_VERSION
" for %s\n\n", nameroot);
fprintf(DatF, " %6d atoms\n", total_no_atoms);
fprintf(DatF, " %6d bonds\n", total_no_bonds);
fprintf(DatF, " %6d angles\n",total_no_angles);
@ -76,8 +78,10 @@ void WriteDataFile(char *nameroot)
/* MASSES */
fprintf(DatF, "\nMasses\n\n");
for(k=0; k < no_atom_types; k++)
fprintf(DatF, " %3d %10.6f\n",k+1,atomtypes[k].mass);
for(k=0; k < no_atom_types; k++) {
if (hintflag) fprintf(DatF, " %3d %10.6f # %s\n",k+1,atomtypes[k].mass,atomtypes[k].potential);
else fprintf(DatF, " %3d %10.6f\n",k+1,atomtypes[k].mass);
}
fputs("\n",DatF);
@ -85,17 +89,19 @@ void WriteDataFile(char *nameroot)
fputs("Pair Coeffs",DatF);
if (hintflag) {
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA))
fputs(" # lj/cut/coul/long\n\n",DatF);
else if (forcefield & FF_TYPE_CLASS2)
fputs(" # lj/class2/coul/long\n\n",DatF);
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA))
fputs(" # lj/cut/coul/long\n\n",DatF);
else if (forcefield & FF_TYPE_CLASS2)
fputs(" # lj/class2/coul/long\n\n",DatF);
} else fputs("\n\n",DatF);
for (i=0; i < no_atom_types; i++) {
fprintf(DatF, " %3i ", i+1);
for ( j = 0; j < 2; j++)
fprintf(DatF, "%14.10f ", atomtypes[i].params[j]);
fputs("\n",DatF);
fprintf(DatF, "%14.10f ",atomtypes[i].params[j]);
if (hintflag) fprintf(DatF, "# %s\n",atomtypes[i].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
@ -107,17 +113,20 @@ void WriteDataFile(char *nameroot)
fputs("Bond Coeffs",DatF);
if (hintflag) {
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA))
fputs(" # harmonic\n\n",DatF);
else if (forcefield & FF_TYPE_CLASS2)
fputs(" # class2\n\n",DatF);
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA))
fputs(" # harmonic\n\n",DatF);
else if (forcefield & FF_TYPE_CLASS2)
fputs(" # class2\n\n",DatF);
} else fputs("\n\n",DatF);
for (i=0; i < no_bond_types; i++) {
fprintf(DatF, "%3i ", i+1);
fprintf(DatF, " %3i", i+1);
for ( j = 0; j < m; j++)
fprintf(DatF, "%10.4f ", bondtypes[i].params[j]);
fputs("\n",DatF);
fprintf(DatF, " %10.4f", bondtypes[i].params[j]);
if (hintflag) fprintf(DatF," # %s-%s\n",atomtypes[bondtypes[i].types[0]].potential,
atomtypes[bondtypes[i].types[1]].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
}
@ -130,109 +139,151 @@ void WriteDataFile(char *nameroot)
fputs("Angle Coeffs",DatF);
if (hintflag) {
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA))
fputs(" # harmonic\n\n",DatF);
else if (forcefield & FF_TYPE_CLASS2)
fputs(" # class2\n\n",DatF);
if (forcefield & (FF_TYPE_CLASS1|FF_TYPE_OPLSAA))
fputs(" # harmonic\n\n",DatF);
else if (forcefield & FF_TYPE_CLASS2)
fputs(" # class2\n\n",DatF);
} else fputs("\n\n",DatF);
for (i=0; i < no_angle_types; i++) {
fprintf(DatF, "%3i ", i+1);
fprintf(DatF, " %3i", i+1);
for ( j = 0; j < m; j++)
fprintf(DatF, " %10.4f", angletypes[i].params[j]);
fprintf(DatF, "%10.4f ", angletypes[i].params[j]);
fputs("\n",DatF);
if (hintflag) fprintf(DatF," # %s-%s-%s\n",
atomtypes[angletypes[i].types[0]].potential,
atomtypes[angletypes[i].types[1]].potential,
atomtypes[angletypes[i].types[2]].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
}
if (no_dihedral_types > 0) {
fputs("Dihedral Coeffs",DatF);
if (forcefield & FF_TYPE_CLASS1) {
fputs("Dihedral Coeffs",DatF);
if (forcefield & FF_TYPE_CLASS1) {
if (hintflag) fputs(" # harmonic\n\n",DatF);
else fputs("\n\n",DatF);
if (hintflag) fputs(" # harmonic\n\n",DatF);
else fputs("\n\n",DatF);
for (i=0; i < no_dihedral_types; i++)
fprintf(DatF, "%3i %10.4f %3i %3i\n", i+1,
dihedraltypes[i].params[0],
(int) dihedraltypes[i].params[1],
(int) dihedraltypes[i].params[2]);
} else if (forcefield & FF_TYPE_OPLSAA) {
if (hintflag) fputs(" # opls\n\n",DatF);
else fputs("\n\n",DatF);
for (i=0; i < no_dihedral_types; i++) {
fprintf(DatF, "%3i",i+1);
for ( j = 0; j < 4; j++)
fprintf(DatF, " %10.4f",dihedraltypes[i].params[j]);
fputs("\n",DatF);
}
} else if (forcefield & FF_TYPE_CLASS2) {
if (hintflag) fputs(" # class2\n\n",DatF);
else fputs("\n\n",DatF);
for (i=0; i < no_dihedral_types; i++) {
fprintf(DatF, "%3i",i+1);
for ( j = 0; j < 6; j++)
fprintf(DatF, " %10.4f",dihedraltypes[i].params[j]);
fputs("\n",DatF);
}
for (i=0; i < no_dihedral_types; i++) {
fprintf(DatF, "%3i %10.4f %3i %3i", i+1,
dihedraltypes[i].params[0],
(int) dihedraltypes[i].params[1],
(int) dihedraltypes[i].params[2]);
if (hintflag) fprintf(DatF," # %s-%s-%s-%s\n",
atomtypes[dihedraltypes[i].types[0]].potential,
atomtypes[dihedraltypes[i].types[1]].potential,
atomtypes[dihedraltypes[i].types[2]].potential,
atomtypes[dihedraltypes[i].types[3]].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
} else if (forcefield & FF_TYPE_OPLSAA) {
if (hintflag) fputs(" # opls\n\n",DatF);
else fputs("\n\n",DatF);
for (i=0; i < no_dihedral_types; i++) {
fprintf(DatF, " %3i",i+1);
for ( j = 0; j < 4; j++)
fprintf(DatF, " %10.4f",dihedraltypes[i].params[j]);
if (hintflag) fprintf(DatF," # %s-%s-%s-%s\n",
atomtypes[dihedraltypes[i].types[0]].potential,
atomtypes[dihedraltypes[i].types[1]].potential,
atomtypes[dihedraltypes[i].types[2]].potential,
atomtypes[dihedraltypes[i].types[3]].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
} else if (forcefield & FF_TYPE_CLASS2) {
if (hintflag) fputs(" # class2\n\n",DatF);
else fputs("\n\n",DatF);
for (i=0; i < no_dihedral_types; i++) {
fprintf(DatF, " %3i",i+1);
for ( j = 0; j < 6; j++)
fprintf(DatF, " %10.4f",dihedraltypes[i].params[j]);
if (hintflag) fprintf(DatF,"# %s-%s-%s-%s\n",
atomtypes[dihedraltypes[i].types[0]].potential,
atomtypes[dihedraltypes[i].types[1]].potential,
atomtypes[dihedraltypes[i].types[2]].potential,
atomtypes[dihedraltypes[i].types[3]].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
}
}
if (forcefield & FF_TYPE_CLASS1) {
if (no_oop_types > 0) {
/* cvff improper coeffs are: type K0 d n */
if (hintflag) fputs("Improper Coeffs # cvff\n\n",DatF);
else fputs("Improper Coeffs\n\n",DatF);
if (no_oop_types > 0) {
/* cvff improper coeffs are: type K0 d n */
if (hintflag) fputs("Improper Coeffs # cvff\n\n",DatF);
else fputs("Improper Coeffs\n\n",DatF);
for (i=0; i < no_oop_types; i++) {
fprintf(DatF,"%5i %10.4f %3i %3i\n",i+1,
ooptypes[i].params[0], (int) ooptypes[i].params[1],
(int) ooptypes[i].params[2]);
}
fputs("\n",DatF);
for (i=0; i < no_oop_types; i++) {
fprintf(DatF,"%5i %10.4f %3i %3i ",i+1,
ooptypes[i].params[0], (int) ooptypes[i].params[1],
(int) ooptypes[i].params[2]);
if (hintflag) fprintf(DatF,"# %s-%s-%s-%s\n",
atomtypes[ooptypes[i].types[0]].potential,
atomtypes[ooptypes[i].types[1]].potential,
atomtypes[ooptypes[i].types[2]].potential,
atomtypes[ooptypes[i].types[3]].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
}
} else if (forcefield & FF_TYPE_OPLSAA) {
if (no_oop_types > 0) {
/* opls improper coeffs are like cvff: type K0 d(=-1) n(=2) */
if (hintflag) fputs("Improper Coeffs # cvff\n\n",DatF);
else fputs("Improper Coeffs\n\n",DatF);
if (no_oop_types > 0) {
/* opls improper coeffs are like cvff: type K0 d(=-1) n(=2) */
if (hintflag) fputs("Improper Coeffs # cvff\n\n",DatF);
else fputs("Improper Coeffs\n\n",DatF);
for (i=0; i < no_oop_types; i++) {
fprintf(DatF,"%5i %10.4f %3i %3i\n",i+1,
ooptypes[i].params[0], (int) ooptypes[i].params[1],
(int) ooptypes[i].params[2]);
}
fputs("\n",DatF);
for (i=0; i < no_oop_types; i++) {
fprintf(DatF,"%5i %10.4f %3i %3i ",i+1,
ooptypes[i].params[0], (int) ooptypes[i].params[1],
(int) ooptypes[i].params[2]);
if (hintflag) fprintf(DatF,"# %s-%s-%s-%s\n",
atomtypes[ooptypes[i].types[0]].potential,
atomtypes[ooptypes[i].types[1]].potential,
atomtypes[ooptypes[i].types[2]].potential,
atomtypes[ooptypes[i].types[3]].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);
}
} else if (forcefield & FF_TYPE_CLASS2) {
if ((no_oop_types + no_angleangle_types) > 0) {
if (hintflag) fputs("Improper Coeffs # class2\n\n",DatF);
else fputs("Improper Coeffs\n\n",DatF);
if ((no_oop_types + no_angleangle_types) > 0) {
if (hintflag) fputs("Improper Coeffs # class2\n\n",DatF);
else fputs("Improper Coeffs\n\n",DatF);
for (i=0; i < no_oop_types; i++) {
fprintf(DatF, "%3i ", i+1);
for ( j = 0; j < 2; j++)
fprintf(DatF, "%10.4f ", ooptypes[i].params[j]);
fputs("\n",DatF);
}
for (i=0; i < no_angleangle_types; i++) {
fprintf(DatF, "%3i ", i+no_oop_types+1);
for ( j = 0; j < 2; j++)
fprintf(DatF, "%10.4f ", 0.0);
fputs("\n",DatF);
}
fputs("\n",DatF);
for (i=0; i < no_oop_types; i++) {
fprintf(DatF, "%3i ", i+1);
for ( j = 0; j < 2; j++)
fprintf(DatF, "%10.4f ", ooptypes[i].params[j]);
if (hintflag) fprintf(DatF,"# %s-%s-%s-%s\n",
atomtypes[ooptypes[i].types[0]].potential,
atomtypes[ooptypes[i].types[1]].potential,
atomtypes[ooptypes[i].types[2]].potential,
atomtypes[ooptypes[i].types[3]].potential);
else fputs("\n",DatF);
}
for (i=0; i < no_angleangle_types; i++) {
fprintf(DatF, "%3i ", i+no_oop_types+1);
for ( j = 0; j < 2; j++)
fprintf(DatF, "%10.4f ", 0.0);
fputs("\n",DatF);
}
fputs("\n",DatF);
}
}
if (forcefield & FF_TYPE_CLASS2) {
@ -338,7 +389,7 @@ void WriteDataFile(char *nameroot)
for(k=0; k < total_no_atoms; k++) {
int typ = atoms[k].type;
fprintf(DatF," %6i %6i %3i %9.6f %15.9f %15.9f %15.9f %3i %3i %3i # %s\n",
fprintf(DatF," %6i %6i %3i %9.6f %15.9f %15.9f %15.9f %3i %3i %3i",
k+1,
atoms[k].molecule,
typ+1,
@ -348,8 +399,9 @@ void WriteDataFile(char *nameroot)
atoms[k].x[2],
atoms[k].image[0],
atoms[k].image[1],
atoms[k].image[2],
atomtypes[typ].potential);
atoms[k].image[2]);
if (hintflag) fprintf(DatF," # %s\n",atomtypes[typ].potential);
else fputs("\n",DatF);
}
fputs("\n",DatF);

View File

@ -2,6 +2,8 @@
*
* msi2lmp.exe
*
* v3.9.5 AK- Add TopoTools style force field parameter type hints
*
* v3.9.4 AK- Make force field style hints optional with a flag
*
* v3.9.3 AK- Bugfix for triclinic cells.
@ -108,7 +110,7 @@
*
****************************************************************
*
* Msi2lmp3
* msi2lmp
*
* This is the third version of a program that generates a LAMMPS
* data file based on the information in a MSI car file (atom
@ -266,7 +268,7 @@ int main (int argc, char *argv[])
iflag = 1;
} else if (strncmp(argv[n],"-n",4) == 0 ) {
centerflag = 0;
} else if (strncmp(argv[n],"-o",4) == 0 ) {
} else if (strncmp(argv[n],"-o",2) == 0 ) {
hintflag = 0;
} else if (strncmp(argv[n],"-p",2) == 0) {
n++;

View File

@ -36,7 +36,7 @@
# include <stdio.h>
#define MSI2LMP_VERSION "v3.9.4 / 11 Mar 2014"
#define MSI2LMP_VERSION "v3.9.5 / 27 May 2014"
#define PI_180 0.01745329251994329576