git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6998 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
Stephanie Teich-McGoldrick (Sandai) is the current maintainer
|
||||||
|
of the msi2lmp tool. She can be contacted at steichm at sandia.gov
|
||||||
|
|
||||||
|
23 Sep 2011
|
||||||
|
|
||||||
|
added support for triclinic boxes
|
||||||
|
see msi2lmp/TriclinicModification.pdf doc for details
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
msi2lmp V3.6 4/10/2005
|
msi2lmp V3.6 4/10/2005
|
||||||
|
|
||||||
|
|||||||
BIN
tools/msi2lmp/TriclinicModification.pdf
Normal file
BIN
tools/msi2lmp/TriclinicModification.pdf
Normal file
Binary file not shown.
@ -736,8 +736,8 @@ void GetParameters(int Forcefield)
|
|||||||
ooptypes[i].types[3]);
|
ooptypes[i].types[3]);
|
||||||
|
|
||||||
ooptypes[i].angleangle_params[3] = tabc;
|
ooptypes[i].angleangle_params[3] = tabc;
|
||||||
ooptypes[i].angleangle_params[4] = tabd;
|
ooptypes[i].angleangle_params[4] = tcbd;
|
||||||
ooptypes[i].angleangle_params[5] = tcbd;
|
ooptypes[i].angleangle_params[5] = tabd;
|
||||||
|
|
||||||
k = find_angleangle_data(potential_types,ff_angang,kloc);
|
k = find_angleangle_data(potential_types,ff_angang,kloc);
|
||||||
if (k < 0) {
|
if (k < 0) {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ OBJS = $(SRCS:.c=.o)
|
|||||||
HEADERS = Msi2LMP2.h Forcefield.h
|
HEADERS = Msi2LMP2.h Forcefield.h
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O2
|
CFLAGS = -O3
|
||||||
FRCFILE = cvff.frc
|
FRCFILE = cvff.frc
|
||||||
FRCFILE2 = cff91.frc
|
FRCFILE2 = cff91.frc
|
||||||
README = README
|
README = README
|
||||||
|
|||||||
@ -61,6 +61,8 @@
|
|||||||
#define MAX_CONNECTIONS 6
|
#define MAX_CONNECTIONS 6
|
||||||
#define MAX_STRING 50
|
#define MAX_STRING 50
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct ResidueList {
|
struct ResidueList {
|
||||||
int start;
|
int start;
|
||||||
int end;
|
int end;
|
||||||
@ -168,6 +170,8 @@ _EX char rootname[20];
|
|||||||
_EX char path[20];
|
_EX char path[20];
|
||||||
_EX double pbc[9];
|
_EX double pbc[9];
|
||||||
_EX int periodic _ARG( 1 ); /* 0= nonperiodic 1= 3-D periodic */
|
_EX int periodic _ARG( 1 ); /* 0= nonperiodic 1= 3-D periodic */
|
||||||
|
// Added triclinic flag for non-orthogonal boxes Oct 5, 2010 SLTM
|
||||||
|
_EX int TriclinicFlag; // 1 for non-orthoganal boxes, 0 for orthogonal boxes
|
||||||
_EX int forcefield _ARG( 0 ); /* 0= ClassI 1= ClassII */
|
_EX int forcefield _ARG( 0 ); /* 0= ClassI 1= ClassII */
|
||||||
_EX int pflag;
|
_EX int pflag;
|
||||||
_EX int *no_atoms;
|
_EX int *no_atoms;
|
||||||
|
|||||||
@ -12,6 +12,13 @@ void ReadCarFile(void)
|
|||||||
int skip; /* lines to skip at beginning of file */
|
int skip; /* lines to skip at beginning of file */
|
||||||
double lowest, highest; /* temp coordinate finding variables */
|
double lowest, highest; /* temp coordinate finding variables */
|
||||||
double total_q;
|
double total_q;
|
||||||
|
double sq_c;
|
||||||
|
double cos_alpha; // Added by SLTM Sept 13, 2010
|
||||||
|
double cos_gamma;
|
||||||
|
double sin_gamma;
|
||||||
|
double cos_beta;
|
||||||
|
double sin_beta;
|
||||||
|
double A, B, C;
|
||||||
|
|
||||||
/* Open .car file for reading */
|
/* Open .car file for reading */
|
||||||
|
|
||||||
@ -39,10 +46,12 @@ void ReadCarFile(void)
|
|||||||
fgets(line,MAX_LINE_LENGTH,CarF); /* Date stamp */
|
fgets(line,MAX_LINE_LENGTH,CarF); /* Date stamp */
|
||||||
fscanf(CarF,"%*s %lf %lf %lf %lf %lf %lf %*s",
|
fscanf(CarF,"%*s %lf %lf %lf %lf %lf %lf %*s",
|
||||||
&pbc[0],&pbc[1],&pbc[2],&pbc[3],&pbc[4],&pbc[5]);
|
&pbc[0],&pbc[1],&pbc[2],&pbc[3],&pbc[4],&pbc[5]);
|
||||||
|
|
||||||
|
// Added triclinic flag for non-orthogonal boxes Oct 5, 2010 SLTM
|
||||||
if(pbc[3] != 90.0 || pbc[4] != 90.0 || pbc[5] != 90.0) {
|
if(pbc[3] != 90.0 || pbc[4] != 90.0 || pbc[5] != 90.0) {
|
||||||
fprintf(stderr,"The system is not rectangular- LAMMPS can't handle it!!");
|
TriclinicFlag = 1;
|
||||||
exit(2);
|
|
||||||
}
|
}
|
||||||
|
else TriclinicFlag = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
periodic = 0;
|
periodic = 0;
|
||||||
@ -142,6 +151,9 @@ void ReadCarFile(void)
|
|||||||
/* Search coordinates to find lowest and highest for x, y, and z */
|
/* Search coordinates to find lowest and highest for x, y, and z */
|
||||||
|
|
||||||
if (periodic == 0) {
|
if (periodic == 0) {
|
||||||
|
// Added if/else statment STLM Oct 5 2010
|
||||||
|
if (TriclinicFlag == 0)
|
||||||
|
{
|
||||||
for ( k = 0; k < 3; k++) {
|
for ( k = 0; k < 3; k++) {
|
||||||
lowest = atoms[0].x[k];
|
lowest = atoms[0].x[k];
|
||||||
highest = atoms[0].x[k];
|
highest = atoms[0].x[k];
|
||||||
@ -155,11 +167,44 @@ void ReadCarFile(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
printf("Code only works for periodic systems with triclinic boxes");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Modified lines 176 - 201 Oct 5th 2010
|
||||||
|
if (TriclinicFlag == 0) {
|
||||||
for (k=0; k < 3; k++) {
|
for (k=0; k < 3; k++) {
|
||||||
pbc[k+3] = pbc[k];
|
pbc[k+3] = pbc[k];
|
||||||
pbc[k] = 0.0;
|
pbc[k] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
sq_c = pbc[2]*pbc[2];
|
||||||
|
cos_alpha = cos(pbc[3]*3.14159265358979323846/180.0);
|
||||||
|
cos_gamma = cos(pbc[5]*3.14159265358979323846/180.0);
|
||||||
|
sin_gamma = sin(pbc[5]*3.14159265358979323846/180.0);
|
||||||
|
cos_beta = cos(pbc[4]*3.14159265358979323846/180.0);
|
||||||
|
sin_beta = sin(pbc[4]*3.14159265358979323846/180.0);
|
||||||
|
printf("pbc[3] %lf pbc[4] %lf pbc[5] %lf\n", pbc[3] ,pbc[4] ,pbc[5]);
|
||||||
|
printf("cos_alpha %lf cos_beta %lf cos_gamma %lf\n", cos_alpha ,cos_beta ,cos_gamma);
|
||||||
|
A = pbc[0];
|
||||||
|
B = pbc[1];
|
||||||
|
C = pbc[2];
|
||||||
|
|
||||||
|
|
||||||
|
pbc[0] = A;
|
||||||
|
pbc[1] = B*sin_gamma;
|
||||||
|
pbc[2] = sqrt(sq_c * sin_beta*sin_beta - C*(cos_alpha-cos_gamma*cos_beta)/sin_gamma);
|
||||||
|
pbc[3] = B * cos_gamma; // This is xy SLTM
|
||||||
|
pbc[4] = C * cos_beta; // This is xz SLTM
|
||||||
|
pbc[5] = C*(cos_alpha-cos_gamma*cos_beta)/sin_gamma; // This is yz SLTM
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* Close .car file */
|
/* Close .car file */
|
||||||
|
|
||||||
|
|||||||
@ -38,10 +38,13 @@ void WriteDataFile(FILE *DatF,char *nameroot,int forcefield)
|
|||||||
fprintf (DatF, " %3d improper types\n", no_oop_types);
|
fprintf (DatF, " %3d improper types\n", no_oop_types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fprintf(DatF, "\n");
|
fprintf(DatF, "\n");
|
||||||
fprintf(DatF, " %15.9f %15.9f xlo xhi\n", pbc[0], pbc[3]);
|
fprintf(DatF, " %15.9f %15.9f xlo xhi\n", 0.0, pbc[0]);
|
||||||
fprintf(DatF, " %15.9f %15.9f ylo yhi\n", pbc[1], pbc[4]);
|
fprintf(DatF, " %15.9f %15.9f ylo yhi\n", 0.0, pbc[1]);
|
||||||
fprintf(DatF, " %15.9f %15.9f zlo zhi\n", pbc[2], pbc[5]);
|
fprintf(DatF, " %15.9f %15.9f zlo zhi\n", 0.0, pbc[2]);
|
||||||
|
fprintf(DatF, " %15.9f %15.9f %15.9f xy xz yz\n", pbc[3], pbc[4], pbc[5]);
|
||||||
|
|
||||||
|
|
||||||
/* MASSES */
|
/* MASSES */
|
||||||
|
|
||||||
|
|||||||
@ -50,10 +50,23 @@ void WriteDataFile05(char *nameroot,int forcefield)
|
|||||||
fprintf (DatF, " %3d improper types\n", no_oop_types);
|
fprintf (DatF, " %3d improper types\n", no_oop_types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Modified by SLTM to print out triclinic box types 10/05/10 - lines 56-68
|
||||||
|
|
||||||
|
if (TriclinicFlag == 0) {
|
||||||
fprintf(DatF, "\n");
|
fprintf(DatF, "\n");
|
||||||
fprintf(DatF, " %15.9f %15.9f xlo xhi\n", pbc[0], pbc[3]);
|
fprintf(DatF, " %15.9f %15.9f xlo xhi\n", pbc[0], pbc[3]);
|
||||||
fprintf(DatF, " %15.9f %15.9f ylo yhi\n", pbc[1], pbc[4]);
|
fprintf(DatF, " %15.9f %15.9f ylo yhi\n", pbc[1], pbc[4]);
|
||||||
fprintf(DatF, " %15.9f %15.9f zlo zhi\n", pbc[2], pbc[5]);
|
fprintf(DatF, " %15.9f %15.9f zlo zhi\n", pbc[2], pbc[5]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fprintf(DatF, "\n");
|
||||||
|
fprintf(DatF, " %15.9f %15.9f xlo xhi\n", 0.0, pbc[0]);
|
||||||
|
fprintf(DatF, " %15.9f %15.9f ylo yhi\n", 0.0, pbc[1]);
|
||||||
|
fprintf(DatF, " %15.9f %15.9f zlo zhi\n", 0.0, pbc[2]);
|
||||||
|
fprintf(DatF, " %15.9f %15.9f %15.9f xy xz yz\n", pbc[3], pbc[4], pbc[5]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* MASSES */
|
/* MASSES */
|
||||||
|
|
||||||
@ -113,7 +126,10 @@ void WriteDataFile05(char *nameroot,int forcefield)
|
|||||||
for (i=0; i < no_dihedral_types; i++) {
|
for (i=0; i < no_dihedral_types; i++) {
|
||||||
fprintf(DatF, "%3i ", i+1);
|
fprintf(DatF, "%3i ", i+1);
|
||||||
for ( j = 0; j < m; j++)
|
for ( j = 0; j < m; j++)
|
||||||
|
// Modified on 10/05/2010 by STLM to match with lammps reading in integers for the all but the first coefficients
|
||||||
|
if (j == 0)
|
||||||
fprintf(DatF, "%10.4f ", dihedraltypes[i].params[j]);
|
fprintf(DatF, "%10.4f ", dihedraltypes[i].params[j]);
|
||||||
|
else fprintf(DatF, "%10.0f ", dihedraltypes[i].params[j]);
|
||||||
fprintf(DatF,"\n");
|
fprintf(DatF,"\n");
|
||||||
}
|
}
|
||||||
fprintf(DatF, "\n");
|
fprintf(DatF, "\n");
|
||||||
@ -124,7 +140,10 @@ void WriteDataFile05(char *nameroot,int forcefield)
|
|||||||
for (i=0; i < no_oop_types; i++) {
|
for (i=0; i < no_oop_types; i++) {
|
||||||
fprintf(DatF, "%3i ", i+1);
|
fprintf(DatF, "%3i ", i+1);
|
||||||
for ( j = 0; j < 3; j++)
|
for ( j = 0; j < 3; j++)
|
||||||
|
// Modified on 10/05/2010 by STLM to match with lammps reading in integers for the all but the first coefficients
|
||||||
|
if (j == 0)
|
||||||
fprintf(DatF, "%10.4f ", ooptypes[i].params[j]);
|
fprintf(DatF, "%10.4f ", ooptypes[i].params[j]);
|
||||||
|
else fprintf(DatF, "%10.0f ", ooptypes[i].params[j]);
|
||||||
fprintf(DatF, "\n");
|
fprintf(DatF, "\n");
|
||||||
}
|
}
|
||||||
fprintf(DatF, "\n");
|
fprintf(DatF, "\n");
|
||||||
|
|||||||
@ -142,7 +142,7 @@ int main (int argc, char *argv[])
|
|||||||
frc_dir_name = getenv("BIOSYM_LIBRARY");
|
frc_dir_name = getenv("BIOSYM_LIBRARY");
|
||||||
|
|
||||||
if (frc_dir_name == NULL) {
|
if (frc_dir_name == NULL) {
|
||||||
frc_file_name = strcpy(frc_file_name,"./cvff.frc");
|
frc_file_name = strcpy(frc_file_name,"../biosym_frc_files/clayff.frc");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (i=0; i < strlen(frc_dir_name); i++)
|
for (i=0; i < strlen(frc_dir_name); i++)
|
||||||
@ -150,6 +150,8 @@ int main (int argc, char *argv[])
|
|||||||
frc_file_name = strcat(frc_file_name,"/cvff.frc");
|
frc_file_name = strcat(frc_file_name,"/cvff.frc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (argc < 2) { /* If no rootname was supplied, prompt for it */
|
if (argc < 2) { /* If no rootname was supplied, prompt for it */
|
||||||
fprintf(stderr,"The rootname of the .car and .mdf files must be entered\n");
|
fprintf(stderr,"The rootname of the .car and .mdf files must be entered\n");
|
||||||
}
|
}
|
||||||
@ -223,13 +225,13 @@ int main (int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read in .car file */
|
/* Read in .car file */
|
||||||
|
printf("I am before read car file\n");
|
||||||
ReadCarFile();
|
ReadCarFile();
|
||||||
|
printf("I am after read car file\n");
|
||||||
/*Read in .mdf file */
|
/*Read in .mdf file */
|
||||||
|
|
||||||
ReadMdfFile();
|
ReadMdfFile();
|
||||||
|
printf("I am after read mdf file\n");
|
||||||
/* Define bonds, angles, etc...*/
|
/* Define bonds, angles, etc...*/
|
||||||
|
|
||||||
if (pflag > 0) fprintf(stderr,"\n Building internal coordinate lists \n");
|
if (pflag > 0) fprintf(stderr,"\n Building internal coordinate lists \n");
|
||||||
@ -237,6 +239,7 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
/* Read .frc file into memory */
|
/* Read .frc file into memory */
|
||||||
|
|
||||||
|
// Commented out to create conversion file suitable for non-orthogonal boxes Sept 13, 2010 SLTM
|
||||||
if (pflag > 0) fprintf(stderr,"\n Reading forcefield file \n");
|
if (pflag > 0) fprintf(stderr,"\n Reading forcefield file \n");
|
||||||
ReadFrcFile();
|
ReadFrcFile();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user