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

This commit is contained in:
sjplimp
2010-01-08 22:54:13 +00:00
parent 654e03d382
commit e3c029753d
26 changed files with 2110 additions and 136 deletions

View File

@ -11,6 +11,7 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "math.h"
#include "stdlib.h"
#include "string.h"
#include "region.h"
@ -83,3 +84,30 @@ void Region::options(int narg, char **arg)
}
else xscale = yscale = zscale = 1.0;
}
/* ----------------------------------------------------------------------
generate list of contact points for interior or exterior regions
------------------------------------------------------------------------- */
int Region::surface(double *x, double cutoff)
{
if (interior) return surface_interior(x,cutoff);
return surface_exterior(x,cutoff);
}
/* ----------------------------------------------------------------------
add a single contact at Nth location in contact array
x = particle position
xp,yp,zp = region surface point
------------------------------------------------------------------------- */
void Region::add_contact(int n, double *x, double xp, double yp, double zp)
{
double delx = x[0] - xp;
double dely = x[1] - yp;
double delz = x[2] - zp;
contact[n].r = sqrt(delx*delx + dely*dely + delz*delz);
contact[n].delx = delx;
contact[n].dely = dely;
contact[n].delz = delz;
}