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

This commit is contained in:
sjplimp
2016-07-28 13:51:40 +00:00
parent f2f9fe0a65
commit c95ec24d1a
6 changed files with 25 additions and 9 deletions

View File

@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
void WriteCoeff::command(int narg, char **arg)
{
if (domain->box_exist == 0)
error->all(FLERR,"write_coeff command before simulation box is defined");
error->all(FLERR,"Write_coeff command before simulation box is defined");
if (narg != 1) error->all(FLERR,"Illegal write_coeff command");
@ -43,6 +43,9 @@ void WriteCoeff::command(int narg, char **arg)
strcpy(file,"tmp.");
strcat(file,arg[0]);
// initialize relevant styles
force->init();
if (comm->me == 0) {
char str[256], coeff[256];
FILE *one = fopen(file,"wb+");
@ -52,7 +55,6 @@ void WriteCoeff::command(int narg, char **arg)
}
if (force->pair && force->pair->writedata) {
force->pair->init();
fprintf(one,"# pair_style %s\npair_coeff\n",force->pair_style);
force->pair->write_data_all(one);
fprintf(one,"end\n");
@ -68,12 +70,14 @@ void WriteCoeff::command(int narg, char **arg)
fprintf(one,"end\n");
}
if (force->dihedral && force->dihedral->writedata) {
fprintf(one,"# dihedral_style %s\ndihedral_coeff\n",force->dihedral_style);
fprintf(one,"# dihedral_style %s\ndihedral_coeff\n",
force->dihedral_style);
force->dihedral->write_data(one);
fprintf(one,"end\n");
}
if (force->improper && force->improper->writedata) {
fprintf(one,"# improper_style %s\nimproper_coeff\n",force->improper_style);
fprintf(one,"# improper_style %s\nimproper_coeff\n",
force->improper_style);
force->improper->write_data(one);
fprintf(one,"end\n");
}