1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/* -*- c++ -*- ----------------------------------------------------------
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
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(NEIGH_HISTORY,FixNeighHistory)
#else
#ifndef LMP_FIX_NEIGH_HISTORY_H
#define LMP_FIX_NEIGH_HISTORY_H
#include "fix.h"
namespace LAMMPS_NS {
class FixNeighHistory : public Fix {
public:
int nlocal_neigh; // nlocal at last time neigh list was built
int nall_neigh; // ditto for nlocal+nghost
int **firstflag; // ptr to each atom's neighbor flsg
double **firstvalue; // ptr to each atom's values
class Pair *pair; // ptr to pair style that uses neighbor history
FixNeighHistory(class LAMMPS *, int, char **);
~FixNeighHistory();
int setmask();
void init();
void setup_post_neighbor();
void pre_exchange();
void min_pre_exchange();
virtual void post_neighbor();
void min_post_neighbor();
void post_run();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int, int);
void set_arrays(int);
int pack_reverse_comm_size(int, int);
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
int pack_restart(int, double *);
void unpack_restart(int, int);
int size_restart(int);
int maxsize_restart();
protected:
int newton_pair; // same as force setting
int dnum,dnumbytes; // dnum = # of values per neighbor
int onesided; // 1 for line/tri history, else 0
int maxatom; // max size of firstflag and firstvalue
int commflag; // mode of reverse comm to get ghost info
double *zeroes;
// per-atom data structures
// partners = flagged neighbors of an atom
int *npartner; // # of partners of each atom
tagint **partner; // global atom IDs for the partners
double **valuepartner; // values for the partners
int maxpartner; // max # of partners for any of my atoms
// per-atom data structs pointed to by partner & valuepartner
int pgsize,oneatom; // copy of settings in Neighbor
MyPage<tagint> *ipage_atom; // pages of partner atom IDs
MyPage<double> *dpage_atom; // pages of partner values
// per-neighbor data structs pointed to by firstflag & firstvalue
MyPage<int> *ipage_neigh; // pages of local atom indices
MyPage<double> *dpage_neigh; // pages of partner values
virtual void pre_exchange_onesided();
virtual void pre_exchange_newton();
virtual void pre_exchange_no_newton();
void allocate_pages();
inline int sbmask(int j) const {
return j >> SBBITS & 3;
}
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
UNDOCUMENTED
E: Neighbor history requires atoms have IDs
UNDOCUMENTED
E: Neighbor history overflow, boost neigh_modify one
UNDOCUMENTED
E: Unsupported comm mode in neighbor history
UNDOCUMENTED
U: Pair style granular with history requires atoms have IDs
Atoms in the simulation do not have IDs, so history effects
cannot be tracked by the granular pair potential.
U: Shear history overflow, boost neigh_modify one
There are too many neighbors of a single atom. Use the neigh_modify
command to increase the max number of neighbors allowed for one atom.
You may also want to boost the page size.
*/