forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5344 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
5d66783527
commit
4379417aba
|
@ -76,8 +76,6 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||
spin = NULL;
|
||||
eradius = ervel = erforce = NULL;
|
||||
|
||||
length = theta = NULL;
|
||||
|
||||
maxspecial = 1;
|
||||
nspecial = NULL;
|
||||
special = NULL;
|
||||
|
@ -104,7 +102,6 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
|
|||
quat_flag = omega_flag = angmom_flag = torque_flag = 0;
|
||||
radius_flag = density_flag = rmass_flag = vfrac_flag = 0;
|
||||
spin_flag = eradius_flag = ervel_flag = erforce_flag = 0;
|
||||
line_flag = 0;
|
||||
|
||||
// ntype-length arrays
|
||||
|
||||
|
@ -188,9 +185,6 @@ Atom::~Atom()
|
|||
memory->sfree(ervel);
|
||||
memory->sfree(erforce);
|
||||
|
||||
memory->sfree(length);
|
||||
memory->sfree(theta);
|
||||
|
||||
memory->sfree(molecule);
|
||||
|
||||
memory->destroy_2d_int_array(nspecial);
|
||||
|
@ -268,8 +262,7 @@ void Atom::create_avec(const char *style, int narg, char **arg)
|
|||
quat_flag = omega_flag = angmom_flag = torque_flag = 0;
|
||||
radius_flag = density_flag = rmass_flag = vfrac_flag = 0;
|
||||
spin_flag = eradius_flag = ervel_flag = erforce_flag = 0;
|
||||
line_flag = 0;
|
||||
|
||||
|
||||
avec = new_avec(style,narg,arg);
|
||||
int n = strlen(style) + 1;
|
||||
atom_style = new char[n];
|
||||
|
|
|
@ -55,8 +55,6 @@ class Atom : protected Pointers {
|
|||
int *spin;
|
||||
double *eradius,*ervel,*erforce;
|
||||
|
||||
double *length,*theta;
|
||||
|
||||
int **nspecial; // 0,1,2 = cummulative # of 1-2,1-3,1-4 neighs
|
||||
int **special; // IDs of 1-2,1-3,1-4 neighs of each atom
|
||||
int maxspecial; // special[nlocal][maxspecial]
|
||||
|
@ -86,7 +84,6 @@ class Atom : protected Pointers {
|
|||
int quat_flag,omega_flag,angmom_flag,torque_flag;
|
||||
int radius_flag,density_flag,rmass_flag,vfrac_flag;
|
||||
int spin_flag,eradius_flag,ervel_flag,erforce_flag;
|
||||
int line_flag;
|
||||
|
||||
// extra peratom info in restart file destined for fix & diag
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
//#define INERTIA 0.4 // moment of inertia for sphere
|
||||
#define INERTIA (1.0/12.0) // moment of inertia for sphere
|
||||
#define INERTIA 0.4 // moment of inertia for sphere
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
@ -38,13 +37,11 @@ ComputeERotateSphere::ComputeERotateSphere(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// error checks
|
||||
|
||||
/*
|
||||
if (!atom->omega_flag)
|
||||
error->all("Compute erotate/sphere requires atom attribute omega");
|
||||
if (!atom->radius_flag && !atom->avec->shape_type)
|
||||
error->all("Compute erotate/sphere requires atom attribute "
|
||||
"radius or shape");
|
||||
*/
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -56,7 +53,6 @@ void ComputeERotateSphere::init()
|
|||
// if shape used, check that all particles are spherical
|
||||
// point particles are allowed
|
||||
|
||||
/*
|
||||
if (atom->radius == NULL) {
|
||||
double **shape = atom->shape;
|
||||
int *type = atom->type;
|
||||
|
@ -72,7 +68,6 @@ void ComputeERotateSphere::init()
|
|||
"spherical particle shapes");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
pfactor = 0.5 * force->mvv2e * INERTIA;
|
||||
}
|
||||
|
@ -117,13 +112,6 @@ double ComputeERotateSphere::compute_scalar()
|
|||
|
||||
} else {
|
||||
if (rmass) {
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
erotate += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] +
|
||||
omega[i][2]*omega[i][2]) *
|
||||
atom->length[i]*atom->length[i]*rmass[i];
|
||||
}
|
||||
} else if (rmass) {
|
||||
for (i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit) {
|
||||
itype = type[i];
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "math.h"
|
||||
#include "string.h"
|
||||
#include "compute_property_atom.h"
|
||||
#include "atom.h"
|
||||
|
@ -219,37 +218,6 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||
"atom property that isn't allocated");
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_erforce;
|
||||
|
||||
} else if (strcmp(arg[iarg],"end1x") == 0) {
|
||||
if (!atom->line_flag)
|
||||
error->all("Compute property/atom for "
|
||||
"atom property that isn't allocated");
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_end1x;
|
||||
} else if (strcmp(arg[iarg],"end1y") == 0) {
|
||||
if (!atom->line_flag)
|
||||
error->all("Compute property/atom for "
|
||||
"atom property that isn't allocated");
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_end1y;
|
||||
} else if (strcmp(arg[iarg],"end1z") == 0) {
|
||||
if (!atom->line_flag)
|
||||
error->all("Compute property/atom for "
|
||||
"atom property that isn't allocated");
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_end1z;
|
||||
} else if (strcmp(arg[iarg],"end2x") == 0) {
|
||||
if (!atom->line_flag)
|
||||
error->all("Compute property/atom for "
|
||||
"atom property that isn't allocated");
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_end2x;
|
||||
} else if (strcmp(arg[iarg],"end2y") == 0) {
|
||||
if (!atom->line_flag)
|
||||
error->all("Compute property/atom for "
|
||||
"atom property that isn't allocated");
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_end2y;
|
||||
} else if (strcmp(arg[iarg],"end2z") == 0) {
|
||||
if (!atom->line_flag)
|
||||
error->all("Compute property/atom for "
|
||||
"atom property that isn't allocated");
|
||||
pack_choice[i] = &ComputePropertyAtom::pack_end2z;
|
||||
|
||||
} else error->all("Invalid keyword in compute property/atom command");
|
||||
}
|
||||
|
||||
|
@ -1132,102 +1100,3 @@ void ComputePropertyAtom::pack_erforce(int n)
|
|||
n += nvalues;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputePropertyAtom::pack_end1x(int n)
|
||||
{
|
||||
double **x = atom->x;
|
||||
double *length = atom->length;
|
||||
double *theta = atom->theta;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) buf[n] = x[i][0] - 0.5*length[i]*cos(theta[i]);
|
||||
else buf[n] = 0.0;
|
||||
n += nvalues;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputePropertyAtom::pack_end1y(int n)
|
||||
{
|
||||
double **x = atom->x;
|
||||
double *length = atom->length;
|
||||
double *theta = atom->theta;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) buf[n] = x[i][1] - 0.5*length[i]*sin(theta[i]);
|
||||
else buf[n] = 0.0;
|
||||
n += nvalues;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputePropertyAtom::pack_end1z(int n)
|
||||
{
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) buf[n] = x[i][2];
|
||||
else buf[n] = 0.0;
|
||||
n += nvalues;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputePropertyAtom::pack_end2x(int n)
|
||||
{
|
||||
double **x = atom->x;
|
||||
double *length = atom->length;
|
||||
double *theta = atom->theta;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) buf[n] = x[i][0] + 0.5*length[i]*cos(theta[i]);
|
||||
else buf[n] = 0.0;
|
||||
n += nvalues;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputePropertyAtom::pack_end2y(int n)
|
||||
{
|
||||
double **x = atom->x;
|
||||
double *length = atom->length;
|
||||
double *theta = atom->theta;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) buf[n] = x[i][1] + 0.5*length[i]*sin(theta[i]);
|
||||
else buf[n] = 0.0;
|
||||
n += nvalues;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputePropertyAtom::pack_end2z(int n)
|
||||
{
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) buf[n] = x[i][2];
|
||||
else buf[n] = 0.0;
|
||||
n += nvalues;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,12 +94,6 @@ class ComputePropertyAtom : public Compute {
|
|||
void pack_eradius(int);
|
||||
void pack_ervel(int);
|
||||
void pack_erforce(int);
|
||||
void pack_end1x(int);
|
||||
void pack_end1y(int);
|
||||
void pack_end1z(int);
|
||||
void pack_end2x(int);
|
||||
void pack_end2y(int);
|
||||
void pack_end2z(int);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue