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

This commit is contained in:
sjplimp
2016-04-22 17:54:49 +00:00
parent 184d5dc0f0
commit 08271a0200
12 changed files with 272 additions and 39 deletions

View File

@ -15,12 +15,13 @@
Contributing author: Carsten Svaneborg (SDU)
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "improper_zero.h"
#include "atom.h"
#include "force.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
@ -28,7 +29,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ImproperZero::ImproperZero(LAMMPS *lmp) : Improper(lmp) {}
ImproperZero::ImproperZero(LAMMPS *lmp) : Improper(lmp), coeffflag(1) {}
/* ---------------------------------------------------------------------- */
@ -49,6 +50,19 @@ void ImproperZero::compute(int eflag, int vflag)
/* ---------------------------------------------------------------------- */
void ImproperZero::settings(int narg, char **arg)
{
if ((narg != 0) && (narg != 1))
error->all(FLERR,"Illegal improper_style command");
if (narg == 1) {
if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0;
else error->all(FLERR,"Illegal improper_style command");
}
}
/* ---------------------------------------------------------------------- */
void ImproperZero::allocate()
{
allocated = 1;
@ -59,12 +73,14 @@ void ImproperZero::allocate()
}
/* ----------------------------------------------------------------------
set coeffs for one type
set coeffs for one or more types
------------------------------------------------------------------------- */
void ImproperZero::coeff(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Incorrect args for improper coefficients");
if ((narg < 1) || (coeffflag && narg > 1))
error->all(FLERR,"Incorrect args for improper coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -94,3 +110,13 @@ void ImproperZero::read_restart(FILE *fp)
allocate();
for (int i = 1; i <= atom->nimpropertypes; i++) setflag[i] = 1;
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
void ImproperZero::write_data(FILE *fp) {
for (int i = 1; i <= atom->nimpropertypes; i++)
fprintf(fp,"%d\n",i);
}