forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1470 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
cbe6927348
commit
a15113ed1f
|
@ -21,6 +21,7 @@
|
||||||
#include "fix_npt_asphere.h"
|
#include "fix_npt_asphere.h"
|
||||||
#include "math_extra.h"
|
#include "math_extra.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "atom_vec.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "compute.h"
|
#include "compute.h"
|
||||||
#include "kspace.h"
|
#include "kspace.h"
|
||||||
|
@ -34,9 +35,10 @@ using namespace LAMMPS_NS;
|
||||||
FixNPTASphere::FixNPTASphere(LAMMPS *lmp, int narg, char **arg) :
|
FixNPTASphere::FixNPTASphere(LAMMPS *lmp, int narg, char **arg) :
|
||||||
FixNPT(lmp, narg, 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 "
|
error->all("Fix npt/asphere requires atom attributes "
|
||||||
"quat, angmom, torque");
|
"quat, angmom, torque, shape");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "fix_nve_asphere.h"
|
#include "fix_nve_asphere.h"
|
||||||
#include "math_extra.h"
|
#include "math_extra.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "atom_vec.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
@ -36,9 +37,10 @@ using namespace LAMMPS_NS;
|
||||||
FixNVEASphere::FixNVEASphere(LAMMPS *lmp, int narg, char **arg) :
|
FixNVEASphere::FixNVEASphere(LAMMPS *lmp, int narg, char **arg) :
|
||||||
FixNVE(lmp, narg, 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 "
|
error->all("Fix nve/asphere requires atom attributes "
|
||||||
"quat, angmom, torque");
|
"quat, angmom, torque, shape");
|
||||||
inertia =
|
inertia =
|
||||||
memory->create_2d_double_array(atom->ntypes+1,3,"fix_temp_sphere:inertia");
|
memory->create_2d_double_array(atom->ntypes+1,3,"fix_temp_sphere:inertia");
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "fix_nvt_asphere.h"
|
#include "fix_nvt_asphere.h"
|
||||||
#include "math_extra.h"
|
#include "math_extra.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "atom_vec.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
|
@ -36,9 +37,10 @@ using namespace LAMMPS_NS;
|
||||||
FixNVTASphere::FixNVTASphere(LAMMPS *lmp, int narg, char **arg) :
|
FixNVTASphere::FixNVTASphere(LAMMPS *lmp, int narg, char **arg) :
|
||||||
FixNVT(lmp, narg, 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 "
|
error->all("Fix nvt/asphere requires atom attributes "
|
||||||
"quat, angmom, torque");
|
"quat, angmom, torque, shape");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "fix_nve_dipole.h"
|
#include "fix_nve_dipole.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "atom_vec.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "respa.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 (narg != 3) error->all("Illegal fix nve/dipole command");
|
||||||
if (!atom->mu_flag || !atom->omega_flag ||
|
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 "
|
error->all("Fix nve/dipole requires atom attributes "
|
||||||
"mu, omega, torque, shape");
|
"mu, omega, torque, shape");
|
||||||
inertia = new double[atom->ntypes+1];
|
inertia = new double[atom->ntypes+1];
|
||||||
|
|
|
@ -31,6 +31,7 @@ AtomVecDPD::AtomVecDPD(LAMMPS *lmp, int narg, char **arg) :
|
||||||
{
|
{
|
||||||
mass_type = 1;
|
mass_type = 1;
|
||||||
comm_x_only = 0;
|
comm_x_only = 0;
|
||||||
|
ghost_velocity = 1;
|
||||||
size_comm = 6;
|
size_comm = 6;
|
||||||
size_reverse = 3;
|
size_reverse = 3;
|
||||||
size_border = 9;
|
size_border = 9;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "pair_dpd.h"
|
#include "pair_dpd.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "atom_vec.h"
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
|
@ -250,17 +251,14 @@ void PairDPD::coeff(int narg, char **arg)
|
||||||
|
|
||||||
void PairDPD::init_style()
|
void PairDPD::init_style()
|
||||||
{
|
{
|
||||||
// check that atom style is dpd or hybrid with dpd
|
if (atom->avec->ghost_velocity == 0)
|
||||||
// else compute() will not have ghost atom velocities
|
error->all("Pair dpd requires ghost atoms store velocity");
|
||||||
|
|
||||||
if (atom->style_match("dpd") == 0)
|
|
||||||
error->all("Pair style dpd requires atom style dpd");
|
|
||||||
|
|
||||||
// if newton off, forces between atoms ij will be double computed
|
// if newton off, forces between atoms ij will be double computed
|
||||||
// using different random numbers
|
// using different random numbers
|
||||||
|
|
||||||
if (force->newton_pair == 0 && comm->me == 0) error->warning(
|
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);
|
int irequest = neighbor->request(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ AtomVecGranular::AtomVecGranular(LAMMPS *lmp, int narg, char **arg) :
|
||||||
AtomVec(lmp, narg, arg)
|
AtomVec(lmp, narg, arg)
|
||||||
{
|
{
|
||||||
comm_x_only = comm_f_only = 0;
|
comm_x_only = comm_f_only = 0;
|
||||||
|
ghost_velocity = 1;
|
||||||
size_comm = 9;
|
size_comm = 9;
|
||||||
size_reverse = 6;
|
size_reverse = 6;
|
||||||
size_border = 14;
|
size_border = 14;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "pair_gran_history.h"
|
#include "pair_gran_history.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "atom_vec.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
|
@ -326,6 +327,8 @@ void PairGranHistory::init_style()
|
||||||
|
|
||||||
if (!atom->radius_flag || !atom->omega_flag || !atom->torque_flag)
|
if (!atom->radius_flag || !atom->omega_flag || !atom->torque_flag)
|
||||||
error->all("Pair granular requires atom attributes radius, omega, torque");
|
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
|
// need a half neigh list and optionally a granular history neigh list
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
#define TOLERANCE 0.05
|
#define TOLERANCE 0.05
|
||||||
#define SMALL 0.001
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ AtomVec::AtomVec(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
||||||
bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 0;
|
bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 0;
|
||||||
mass_type = shape_type = dipole_type = 0;
|
mass_type = shape_type = dipole_type = 0;
|
||||||
comm_x_only = comm_f_only = 1;
|
comm_x_only = comm_f_only = 1;
|
||||||
|
ghost_velocity = 0;
|
||||||
size_comm = size_reverse = size_border = 0;
|
size_comm = size_reverse = size_border = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ class AtomVec : protected Pointers {
|
||||||
int dipole_type; // 1 if per-type dipole moments
|
int dipole_type; // 1 if per-type dipole moments
|
||||||
int comm_x_only; // 1 if only exchange x in forward comm
|
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 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_comm; // # of values per atom in comm
|
||||||
int size_reverse; // # in reverse comm
|
int size_reverse; // # in reverse comm
|
||||||
int size_border; // # in border comm
|
int size_border; // # in border comm
|
||||||
|
|
|
@ -75,6 +75,8 @@ AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp, int narg, char **arg) :
|
||||||
dipole_type = MAX(dipole_type,styles[k]->dipole_type);
|
dipole_type = MAX(dipole_type,styles[k]->dipole_type);
|
||||||
comm_x_only = MIN(comm_x_only,styles[k]->comm_x_only);
|
comm_x_only = MIN(comm_x_only,styles[k]->comm_x_only);
|
||||||
comm_f_only = MIN(comm_f_only,styles[k]->comm_f_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_comm += styles[k]->size_comm - 3;
|
||||||
size_reverse += styles[k]->size_reverse - 3;
|
size_reverse += styles[k]->size_reverse - 3;
|
||||||
size_border += styles[k]->size_border - 6;
|
size_border += styles[k]->size_border - 6;
|
||||||
|
|
|
@ -712,3 +712,11 @@ double PairLJCut::single(int i, int j, int itype, int jtype, double rsq,
|
||||||
offset[itype][jtype];
|
offset[itype][jtype];
|
||||||
return factor_lj*philj;
|
return factor_lj*philj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void *PairLJCut::extract(char *str)
|
||||||
|
{
|
||||||
|
if (strcmp(str,"sigma") == 0) return (void *) sigma;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ class PairLJCut : public Pair {
|
||||||
void compute_inner();
|
void compute_inner();
|
||||||
void compute_middle();
|
void compute_middle();
|
||||||
void compute_outer(int, int);
|
void compute_outer(int, int);
|
||||||
|
void *extract(char *);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double cut_global;
|
double cut_global;
|
||||||
|
|
Loading…
Reference in New Issue