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

This commit is contained in:
sjplimp
2016-01-29 18:27:37 +00:00
parent 3d7d897fe8
commit 029faeb7f0
2 changed files with 53 additions and 4 deletions

View File

@ -104,6 +104,11 @@ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp)
maxbin = 0; maxbin = 0;
bins = NULL; bins = NULL;
// SSA AIR binning
len_ssa_airnum = 0;
ssa_airnum = NULL;
// pair exclusion list info // pair exclusion list info
includegroup = 0; includegroup = 0;
@ -157,6 +162,7 @@ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp)
improperlist = NULL; improperlist = NULL;
copymode = 0; copymode = 0;
last_binning_timestep = -1;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -176,6 +182,8 @@ Neighbor::~Neighbor()
memory->destroy(binhead); memory->destroy(binhead);
memory->destroy(bins); memory->destroy(bins);
memory->destroy(ssa_airnum);
memory->destroy(ex1_type); memory->destroy(ex1_type);
memory->destroy(ex2_type); memory->destroy(ex2_type);
memory->destroy(ex_type); memory->destroy(ex_type);
@ -1019,6 +1027,7 @@ int Neighbor::request(void *requestor, int instance)
skip -> granular function if gran with granhistory, skip -> granular function if gran with granhistory,
respa function if respaouter, respa function if respaouter,
skip_from function for everything else skip_from function for everything else
ssa -> special case for USER-DPD pair styles
half_from_full, half, full, gran, respaouter -> half_from_full, half, full, gran, respaouter ->
choose by newton and rq->newton and tri settings choose by newton and rq->newton and tri settings
style NSQ options = newton off, newton on style NSQ options = newton off, newton on
@ -1042,6 +1051,10 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
else if (rq->respaouter) pb = &Neighbor::skip_from_respa; else if (rq->respaouter) pb = &Neighbor::skip_from_respa;
else pb = &Neighbor::skip_from; else pb = &Neighbor::skip_from;
} else if (rq->ssa) {
if (rq->half_from_full) pb = &Neighbor::half_from_full_newton_ssa;
else pb = &Neighbor::half_bin_newton_ssa;
} else if (rq->half_from_full) { } else if (rq->half_from_full) {
if (rq->newton == 0) { if (rq->newton == 0) {
if (newton_pair == 0) pb = &Neighbor::half_from_full_no_newton; if (newton_pair == 0) pb = &Neighbor::half_from_full_no_newton;
@ -1286,6 +1299,7 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
determine which stencil_create function each neigh list needs determine which stencil_create function each neigh list needs
based on settings of neigh request, only called if style != NSQ based on settings of neigh request, only called if style != NSQ
skip or copy or half_from_full -> no stencil skip or copy or half_from_full -> no stencil
ssa = special case for USER-DPD pair styles
half, gran, respaouter, full -> choose by newton and tri and dimension half, gran, respaouter, full -> choose by newton and tri and dimension
if none of these, ptr = NULL since this list needs no stencils if none of these, ptr = NULL since this list needs no stencils
use "else if" b/c skip,copy can be set in addition to half,full,etc use "else if" b/c skip,copy can be set in addition to half,full,etc
@ -1297,7 +1311,11 @@ void Neighbor::choose_stencil(int index, NeighRequest *rq)
if (rq->skip || rq->copy || rq->half_from_full) sc = NULL; if (rq->skip || rq->copy || rq->half_from_full) sc = NULL;
else if (rq->half || rq->gran || rq->respaouter) { else if (rq->ssa) {
if (dimension == 2) sc = &Neighbor::stencil_half_bin_2d_ssa;
else if (dimension == 3) sc = &Neighbor::stencil_half_bin_3d_ssa;
} else if (rq->half || rq->gran || rq->respaouter) {
if (style == BIN) { if (style == BIN) {
if (rq->newton == 0) { if (rq->newton == 0) {
if (newton_pair == 0) { if (newton_pair == 0) {
@ -1997,6 +2015,11 @@ void Neighbor::bin_atoms()
{ {
int i,ibin; int i,ibin;
// NOTE: added for USER-DPD, why do we need this?
if (last_binning_timestep == update->ntimestep) return;
last_binning_timestep = update->ntimestep;
for (i = 0; i < mbins; i++) binhead[i] = -1; for (i = 0; i < mbins; i++) binhead[i] = -1;
// bin in reverse order so linked list will be in forward order // bin in reverse order so linked list will be in forward order
@ -2152,6 +2175,8 @@ bigint Neighbor::memory_usage()
bytes += memory->usage(binhead,maxhead); bytes += memory->usage(binhead,maxhead);
} }
bytes += memory->usage(ssa_airnum,len_ssa_airnum);
for (int i = 0; i < nrequest; i++) for (int i = 0; i < nrequest; i++)
if (lists[i]) bytes += lists[i]->memory_usage(); if (lists[i]) bytes += lists[i]->memory_usage();

View File

@ -69,6 +69,14 @@ class Neighbor : protected Pointers {
int nimproperlist; // list of impropers to compute int nimproperlist; // list of impropers to compute
int **improperlist; int **improperlist;
int cluster_check; // 1 if check bond/angle/etc satisfies minimg
// USER-DPD package - better to make this private?
int *ssa_airnum; // AIR number of each atom for SSA in USER-DPD
// methods
Neighbor(class LAMMPS *); Neighbor(class LAMMPS *);
virtual ~Neighbor(); virtual ~Neighbor();
virtual void init(); virtual void init();
@ -79,14 +87,13 @@ class Neighbor : protected Pointers {
void setup_bins(); // setup bins based on box and cutoff void setup_bins(); // setup bins based on box and cutoff
virtual void build(int topoflag=1); // create all neighbor lists (pair,bond) virtual void build(int topoflag=1); // create all neighbor lists (pair,bond)
virtual void build_topology(); // create all topology neighbor lists virtual void build_topology(); // create all topology neighbor lists
void build_one(class NeighList *list, int preflag=0); // create a single neighbor list void build_one(class NeighList *list,
int preflag=0); // create a single one-time neigh list
void set(int, char **); // set neighbor style and skin distance void set(int, char **); // set neighbor style and skin distance
void modify_params(int, char**); // modify parameters that control builds void modify_params(int, char**); // modify parameters that control builds
bigint memory_usage(); bigint memory_usage();
int exclude_setting(); int exclude_setting();
int cluster_check; // 1 if check bond/angle/etc satisfies minimg
protected: protected:
int me,nprocs; int me,nprocs;
@ -114,6 +121,7 @@ class Neighbor : protected Pointers {
int binatomflag; // bin atoms or not when build neigh list int binatomflag; // bin atoms or not when build neigh list
// turned off by build_one() // turned off by build_one()
bigint last_binning_timestep; // last step neighbor binning was done
int nbinx,nbiny,nbinz; // # of global bins int nbinx,nbiny,nbinz; // # of global bins
int *bins; // ptr to next atom in each bin int *bins; // ptr to next atom in each bin
@ -170,6 +178,12 @@ class Neighbor : protected Pointers {
int *glist; // lists to grow atom arrays every reneigh int *glist; // lists to grow atom arrays every reneigh
int *slist; // lists to grow stencil arrays every reneigh int *slist; // lists to grow stencil arrays every reneigh
// USER-DPD package
int len_ssa_airnum; // length of ssa_airnum array
// methods
void bin_atoms(); // bin all atoms void bin_atoms(); // bin all atoms
double bin_distance(int, int, int); // distance between binx double bin_distance(int, int, int); // distance between binx
int coord2bin(double *); // mapping atom coord to a bin int coord2bin(double *); // mapping atom coord to a bin
@ -304,6 +318,16 @@ class Neighbor : protected Pointers {
void improper_template(); // improper list with templated bonds void improper_template(); // improper list with templated bonds
void improper_partial(); // exclude certain impropers void improper_partial(); // exclude certain impropers
// SSA neighboring for USER-DPD
//int coord2ssa_airnum(double *); // map atom coord to an AIR number
//void assign_ssa_airnums(); // set ssa_airnum values
void half_bin_newton_ssa(NeighList *) {}
void half_from_full_newton_ssa(class NeighList *) {}
void stencil_half_bin_2d_ssa(class NeighList *, int, int, int) {}
void stencil_half_bin_3d_ssa(class NeighList *, int, int, int) {}
// find_special: determine if atom j is in special list of atom i // find_special: determine if atom j is in special list of atom i
// if it is not, return 0 // if it is not, return 0
// if it is and special flag is 0 (both coeffs are 0.0), return -1 // if it is and special flag is 0 (both coeffs are 0.0), return -1