~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to src/CLASS2/improper_class2.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2013-11-20 22:41:36 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20131120224136-tzx7leh606fqnckm
Tags: 0~20131119.git7162cf0-1
* [e65b919] Imported Upstream version 0~20131119.git7162cf0
* [f7bddd4] Fix some problems, introduced by upstream recently.
* [3616dfc] Use wrap-and-sort script.
* [7e92030] Ignore quilt dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
/* ---------------------------------------------------------------------- */
38
38
 
39
 
ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp) {}
 
39
ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp)
 
40
{
 
41
  writedata = 1;
 
42
}
40
43
 
41
44
/* ---------------------------------------------------------------------- */
42
45
 
532
535
  if (strcmp(arg[1],"aa") == 0) {
533
536
    if (narg != 8) error->all(FLERR,"Incorrect args for improper coefficients");
534
537
 
535
 
    double k1_one = force->numeric(arg[2]);
536
 
    double k2_one = force->numeric(arg[3]);
537
 
    double k3_one = force->numeric(arg[4]);
538
 
    double theta0_1_one = force->numeric(arg[5]);
539
 
    double theta0_2_one = force->numeric(arg[6]);
540
 
    double theta0_3_one = force->numeric(arg[7]);
 
538
    double k1_one = force->numeric(FLERR,arg[2]);
 
539
    double k2_one = force->numeric(FLERR,arg[3]);
 
540
    double k3_one = force->numeric(FLERR,arg[4]);
 
541
    double theta0_1_one = force->numeric(FLERR,arg[5]);
 
542
    double theta0_2_one = force->numeric(FLERR,arg[6]);
 
543
    double theta0_3_one = force->numeric(FLERR,arg[7]);
541
544
 
542
545
    // convert theta0's from degrees to radians
543
546
 
555
558
  } else {
556
559
    if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients");
557
560
 
558
 
    double k0_one = force->numeric(arg[1]);
559
 
    double chi0_one = force->numeric(arg[2]);
 
561
    double k0_one = force->numeric(FLERR,arg[1]);
 
562
    double chi0_one = force->numeric(FLERR,arg[2]);
560
563
 
561
564
    // convert chi0 from degrees to radians
562
565
 
835
838
{
836
839
  return (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]);
837
840
}
 
841
 
 
842
/* ----------------------------------------------------------------------
 
843
   proc 0 writes to data file
 
844
------------------------------------------------------------------------- */
 
845
 
 
846
void ImproperClass2::write_data(FILE *fp)
 
847
{
 
848
  for (int i = 1; i <= atom->nimpropertypes; i++)
 
849
    fprintf(fp,"%d %g %g\n",i,k0[i],chi0[i]);
 
850
 
 
851
  fprintf(fp,"\nAngleAngle Coeffs\n\n");
 
852
  for (int i = 1; i <= atom->nimpropertypes; i++)
 
853
    fprintf(fp,"%d %g %g %g %g %g %g\n",i,aa_k1[i],aa_k2[i],aa_k3[i],
 
854
            aa_theta0_1[i]*180.0/MY_PI,aa_theta0_2[i]*180.0/MY_PI,
 
855
            aa_theta0_3[i]*180.0/MY_PI);  
 
856
}