2014-07-30 22:59:20 +08:00
|
|
|
/* -*- c++ -*- ----------------------------------------------------------
|
2007-10-04 00:26:20 +08:00
|
|
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
|
|
|
http://lammps.sandia.gov, Sandia National Laboratories
|
|
|
|
Steve Plimpton, sjplimp@sandia.gov
|
|
|
|
|
|
|
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
|
|
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
2012-06-07 06:47:51 +08:00
|
|
|
certain rights in this software. This software is distributed under
|
2007-10-04 00:26:20 +08:00
|
|
|
the GNU General Public License.
|
|
|
|
|
|
|
|
See the README file in the top-level LAMMPS directory.
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
2010-01-12 09:37:48 +08:00
|
|
|
#ifndef LMP_NEIGH_LIST_H
|
|
|
|
#define LMP_NEIGH_LIST_H
|
2007-10-04 00:26:20 +08:00
|
|
|
|
|
|
|
#include "pointers.h"
|
2013-07-03 23:50:00 +08:00
|
|
|
#include "my_page.h"
|
2007-10-04 00:26:20 +08:00
|
|
|
|
|
|
|
namespace LAMMPS_NS {
|
|
|
|
|
|
|
|
class NeighList : protected Pointers {
|
|
|
|
public:
|
2016-09-08 03:42:58 +08:00
|
|
|
int index; // index of which neigh list this is
|
|
|
|
// also indexes the request it came from
|
|
|
|
// and the npair list of NPair classes
|
2007-10-04 00:26:20 +08:00
|
|
|
|
2016-09-08 03:42:58 +08:00
|
|
|
int bin_method; // 0 if no binning, else 1-N index into binnames
|
|
|
|
int stencil_method; // 0 if no stencil, else 1-N index into stencilnames
|
|
|
|
int pair_method; // 0 if no pair, else 1-N index into pairnames
|
|
|
|
|
|
|
|
// settings from NeighRequest
|
|
|
|
|
|
|
|
int occasional; // 0 if build every reneighbor, 1 if not
|
|
|
|
int ghost; // 1 if list stores neighbors of ghosts
|
|
|
|
int ssa; // 1 if list stores Shardlow data
|
2017-10-11 06:53:51 +08:00
|
|
|
int history; // 1 if there is neigh history (FixNeighHist)
|
2017-10-18 07:33:01 +08:00
|
|
|
int respaouter; // 1 if list is a rRespa outer list
|
|
|
|
int respamiddle; // 1 if there is also a rRespa middle list
|
|
|
|
int respainner; // 1 if there is also a rRespa inner list
|
2017-10-11 06:53:51 +08:00
|
|
|
int copy; // 1 if this list is copied from another list
|
2017-03-29 01:38:26 +08:00
|
|
|
int copymode; // 1 if this is a Kokkos on-device copy
|
2007-10-04 00:26:20 +08:00
|
|
|
|
|
|
|
// data structs to store neighbor pairs I,J and associated values
|
|
|
|
|
|
|
|
int inum; // # of I atoms neighbors are stored for
|
2011-03-18 23:09:03 +08:00
|
|
|
int gnum; // # of ghost atoms neighbors are stored for
|
2007-10-04 00:26:20 +08:00
|
|
|
int *ilist; // local indices of I atoms
|
|
|
|
int *numneigh; // # of J neighbors for each I atom
|
|
|
|
int **firstneigh; // ptr to 1st J int value of each I atom
|
2017-02-22 06:49:21 +08:00
|
|
|
int maxatom; // size of allocated per-atom arrays
|
2007-10-04 00:26:20 +08:00
|
|
|
|
|
|
|
int pgsize; // size of each page
|
2013-07-03 23:50:00 +08:00
|
|
|
int oneatom; // max size for one atom
|
2013-07-09 04:10:50 +08:00
|
|
|
MyPage<int> *ipage; // pages of neighbor indices
|
2013-07-03 23:50:00 +08:00
|
|
|
|
2017-10-18 07:33:01 +08:00
|
|
|
// data structs to store rRESPA neighbor pairs I,J and associated values
|
|
|
|
|
|
|
|
int inum_inner; // # of I atoms neighbors are stored for
|
|
|
|
int gnum_inner; // # of ghost atoms neighbors are stored for
|
|
|
|
int *ilist_inner; // local indices of I atoms
|
|
|
|
int *numneigh_inner; // # of J neighbors for each I atom
|
|
|
|
int **firstneigh_inner; // ptr to 1st J int value of each I atom
|
|
|
|
|
|
|
|
int inum_middle; // # of I atoms neighbors are stored for
|
|
|
|
int gnum_middle; // # of ghost atoms neighbors are stored for
|
|
|
|
int *ilist_middle; // local indices of I atoms
|
|
|
|
int *numneigh_middle; // # of J neighbors for each I atom
|
|
|
|
int **firstneigh_middle; // ptr to 1st J int value of each I atom
|
|
|
|
|
|
|
|
MyPage<int> *ipage_inner; // pages of neighbor indices for inner
|
|
|
|
MyPage<int> *ipage_middle; // pages of neighbor indices for middle
|
|
|
|
|
2007-10-04 00:26:20 +08:00
|
|
|
// atom types to skip when building list
|
2016-09-08 03:42:58 +08:00
|
|
|
// copied info from corresponding request into realloced vec/array
|
2007-10-04 00:26:20 +08:00
|
|
|
|
2009-10-31 06:49:22 +08:00
|
|
|
int *iskip; // iskip[i] = 1 if atoms of type I are not in list
|
2011-03-18 23:09:03 +08:00
|
|
|
int **ijskip; // ijskip[i][j] = 1 if pairs of type I,J are not in list
|
2007-10-04 00:26:20 +08:00
|
|
|
|
|
|
|
// settings and pointers for related neighbor lists and fixes
|
|
|
|
|
2017-02-22 06:49:21 +08:00
|
|
|
NeighList *listcopy; // me = copy list, point to list I copy from
|
|
|
|
NeighList *listskip; // me = skip list, point to list I skip from
|
|
|
|
NeighList *listfull; // me = half list, point to full I derive from
|
|
|
|
|
|
|
|
class Fix *fix_bond; // fix that stores bond info
|
2007-10-04 00:26:20 +08:00
|
|
|
|
2016-12-08 04:00:27 +08:00
|
|
|
// Kokkos package
|
|
|
|
|
|
|
|
int kokkos; // 1 if list stores Kokkos data
|
|
|
|
ExecutionSpace execution_space;
|
|
|
|
|
2016-07-16 07:14:13 +08:00
|
|
|
// USER-DPD package and Shardlow Splitting Algorithm (SSA) support
|
|
|
|
|
2017-01-27 05:20:12 +08:00
|
|
|
int AIRct_ssa[8]; // count of how many atoms in each AIR
|
2017-02-08 01:53:45 +08:00
|
|
|
class NPair *np; // ptr to NPair instance I depend on
|
2016-07-16 07:14:13 +08:00
|
|
|
|
2016-09-08 03:42:58 +08:00
|
|
|
// methods
|
2007-10-04 00:26:20 +08:00
|
|
|
|
2013-07-09 04:10:50 +08:00
|
|
|
NeighList(class LAMMPS *);
|
2014-03-13 00:37:16 +08:00
|
|
|
virtual ~NeighList();
|
2016-09-08 03:42:58 +08:00
|
|
|
void post_constructor(class NeighRequest *);
|
|
|
|
void setup_pages(int, int); // setup page data structures
|
|
|
|
void grow(int,int); // grow all data structs
|
2007-10-12 07:09:11 +08:00
|
|
|
void print_attributes(); // debug routine
|
2016-09-08 03:42:58 +08:00
|
|
|
int get_maxlocal() {return maxatom;}
|
2011-03-17 04:03:49 +08:00
|
|
|
bigint memory_usage();
|
2007-10-04 00:26:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|