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

This commit is contained in:
sjplimp
2016-03-28 15:04:09 +00:00
parent 1103448232
commit 7cea607190
5 changed files with 60 additions and 37 deletions

View File

@ -389,6 +389,21 @@ Angle *Force::new_angle(const char *style, int trysuffix, int &sflag)
return NULL;
}
/* ----------------------------------------------------------------------
return ptr to current angle class or hybrid sub-class if matches style
------------------------------------------------------------------------- */
Angle *Force::angle_match(const char *style)
{
if (strcmp(angle_style,style) == 0) return angle;
else if (strcmp(angle_style,"hybrid") == 0) {
AngleHybrid *hybrid = (AngleHybrid *) angle;
for (int i = 0; i < hybrid->nstyles; i++)
if (strcmp(hybrid->keywords[i],style) == 0) return hybrid->styles[i];
}
return NULL;
}
/* ----------------------------------------------------------------------
create a dihedral style, called from input script or restart file
------------------------------------------------------------------------- */
@ -455,6 +470,21 @@ Dihedral *Force::new_dihedral(const char *style, int trysuffix, int &sflag)
return NULL;
}
/* ----------------------------------------------------------------------
return ptr to current angle class or hybrid sub-class if matches style
------------------------------------------------------------------------- */
Dihedral *Force::dihedral_match(const char *style)
{
if (strcmp(dihedral_style,style) == 0) return dihedral;
else if (strcmp(dihedral_style,"hybrid") == 0) {
DihedralHybrid *hybrid = (DihedralHybrid *) dihedral;
for (int i = 0; i < hybrid->nstyles; i++)
if (strcmp(hybrid->keywords[i],style) == 0) return hybrid->styles[i];
}
return NULL;
}
/* ----------------------------------------------------------------------
create an improper style, called from input script or restart file
------------------------------------------------------------------------- */