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

This commit is contained in:
sjplimp 2008-02-08 19:47:58 +00:00
parent cbe6927348
commit a15113ed1f
14 changed files with 37 additions and 14 deletions

View File

@ -21,6 +21,7 @@
#include "fix_npt_asphere.h"
#include "math_extra.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "compute.h"
#include "kspace.h"
@ -34,9 +35,10 @@ using namespace LAMMPS_NS;
FixNPTASphere::FixNPTASphere(LAMMPS *lmp, int narg, char **arg) :
FixNPT(lmp, narg, arg)
{
if (!atom->quat_flag || !atom->angmom_flag || !atom->torque_flag)
if (!atom->quat_flag || !atom->angmom_flag || !atom->torque_flag ||
!atom->avec->shape_type)
error->all("Fix npt/asphere requires atom attributes "
"quat, angmom, torque");
"quat, angmom, torque, shape");
}
/* ----------------------------------------------------------------------

View File

@ -21,6 +21,7 @@
#include "fix_nve_asphere.h"
#include "math_extra.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "update.h"
#include "memory.h"
@ -36,9 +37,10 @@ using namespace LAMMPS_NS;
FixNVEASphere::FixNVEASphere(LAMMPS *lmp, int narg, char **arg) :
FixNVE(lmp, narg, arg)
{
if (!atom->quat_flag || !atom->angmom_flag || !atom->torque_flag)
if (!atom->quat_flag || !atom->angmom_flag || !atom->torque_flag ||
!atom->avec->shape_type)
error->all("Fix nve/asphere requires atom attributes "
"quat, angmom, torque");
"quat, angmom, torque, shape");
inertia =
memory->create_2d_double_array(atom->ntypes+1,3,"fix_temp_sphere:inertia");
}

View File

@ -21,6 +21,7 @@
#include "fix_nvt_asphere.h"
#include "math_extra.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "comm.h"
#include "group.h"
@ -36,9 +37,10 @@ using namespace LAMMPS_NS;
FixNVTASphere::FixNVTASphere(LAMMPS *lmp, int narg, char **arg) :
FixNVT(lmp, narg, arg)
{
if (!atom->quat_flag || !atom->angmom_flag || !atom->torque_flag)
if (!atom->quat_flag || !atom->angmom_flag || !atom->torque_flag ||
!atom->avec->shape_type)
error->all("Fix nvt/asphere requires atom attributes "
"quat, angmom, torque");
"quat, angmom, torque, shape");
}
/* ---------------------------------------------------------------------- */

View File

@ -15,6 +15,7 @@
#include "string.h"
#include "fix_nve_dipole.h"
#include "atom.h"
#include "atom_vec.h"
#include "force.h"
#include "update.h"
#include "respa.h"
@ -33,7 +34,7 @@ FixNVEDipole::FixNVEDipole(LAMMPS *lmp, int narg, char **arg) :
{
if (narg != 3) error->all("Illegal fix nve/dipole command");
if (!atom->mu_flag || !atom->omega_flag ||
!atom->torque_flag || atom->shape == NULL)
!atom->torque_flag || !atom->avec->shape_type)
error->all("Fix nve/dipole requires atom attributes "
"mu, omega, torque, shape");
inertia = new double[atom->ntypes+1];

View File

@ -31,6 +31,7 @@ AtomVecDPD::AtomVecDPD(LAMMPS *lmp, int narg, char **arg) :
{
mass_type = 1;
comm_x_only = 0;
ghost_velocity = 1;
size_comm = 6;
size_reverse = 3;
size_border = 9;

View File

@ -20,6 +20,7 @@
#include "stdlib.h"
#include "pair_dpd.h"
#include "atom.h"
#include "atom_vec.h"
#include "comm.h"
#include "update.h"
#include "force.h"
@ -250,17 +251,14 @@ void PairDPD::coeff(int narg, char **arg)
void PairDPD::init_style()
{
// check that atom style is dpd or hybrid with dpd
// else compute() will not have ghost atom velocities
if (atom->style_match("dpd") == 0)
error->all("Pair style dpd requires atom style dpd");
if (atom->avec->ghost_velocity == 0)
error->all("Pair dpd requires ghost atoms store velocity");
// if newton off, forces between atoms ij will be double computed
// using different random numbers
if (force->newton_pair == 0 && comm->me == 0) error->warning(
"Pair style dpd needs newton pair on for momentum conservation");
"Pair dpd needs newton pair on for momentum conservation");
int irequest = neighbor->request(this);
}

View File

@ -32,6 +32,7 @@ AtomVecGranular::AtomVecGranular(LAMMPS *lmp, int narg, char **arg) :
AtomVec(lmp, narg, arg)
{
comm_x_only = comm_f_only = 0;
ghost_velocity = 1;
size_comm = 9;
size_reverse = 6;
size_border = 14;

View File

@ -21,6 +21,7 @@
#include "string.h"
#include "pair_gran_history.h"
#include "atom.h"
#include "atom_vec.h"
#include "domain.h"
#include "force.h"
#include "update.h"
@ -326,6 +327,8 @@ void PairGranHistory::init_style()
if (!atom->radius_flag || !atom->omega_flag || !atom->torque_flag)
error->all("Pair granular requires atom attributes radius, omega, torque");
if (atom->avec->ghost_velocity == 0)
error->all("Pair granular requires ghost atoms store velocity");
// need a half neigh list and optionally a granular history neigh list

View File

@ -32,7 +32,6 @@
using namespace LAMMPS_NS;
#define TOLERANCE 0.05
#define SMALL 0.001
/* ---------------------------------------------------------------------- */

View File

@ -26,6 +26,7 @@ AtomVec::AtomVec(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 0;
mass_type = shape_type = dipole_type = 0;
comm_x_only = comm_f_only = 1;
ghost_velocity = 0;
size_comm = size_reverse = size_border = 0;
}

View File

@ -28,6 +28,8 @@ class AtomVec : protected Pointers {
int dipole_type; // 1 if per-type dipole moments
int comm_x_only; // 1 if only exchange x in forward comm
int comm_f_only; // 1 if only exchange f in reverse comm
int ghost_velocity; // 1 if ghost atoms store velocity
int size_comm; // # of values per atom in comm
int size_reverse; // # in reverse comm
int size_border; // # in border comm

View File

@ -75,6 +75,8 @@ AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp, int narg, char **arg) :
dipole_type = MAX(dipole_type,styles[k]->dipole_type);
comm_x_only = MIN(comm_x_only,styles[k]->comm_x_only);
comm_f_only = MIN(comm_f_only,styles[k]->comm_f_only);
ghost_velocity = MAX(ghost_velocity,styles[k]->ghost_velocity);
size_comm += styles[k]->size_comm - 3;
size_reverse += styles[k]->size_reverse - 3;
size_border += styles[k]->size_border - 6;

View File

@ -712,3 +712,11 @@ double PairLJCut::single(int i, int j, int itype, int jtype, double rsq,
offset[itype][jtype];
return factor_lj*philj;
}
/* ---------------------------------------------------------------------- */
void *PairLJCut::extract(char *str)
{
if (strcmp(str,"sigma") == 0) return (void *) sigma;
return NULL;
}

View File

@ -37,6 +37,7 @@ class PairLJCut : public Pair {
void compute_inner();
void compute_middle();
void compute_outer(int, int);
void *extract(char *);
protected:
double cut_global;