Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
Loading...
Searching...
No Matches
spatial.h
1#pragma once
2#include "ff/precision.h"
3#include "tool/genunit.h"
4
5namespace tinker {
8
9class Spatial;
10
12
14
16{
17public:
20 struct alignas(16) SortedAtom
21 {
22 real x, y, z;
24#if TINKER_REAL_SIZE == 8
25 int padding;
26#endif
27 };
28
30 struct alignas(16) Center
31 {
32 real x, y, z, w;
33 };
34
36 struct ScaleInfo
37 {
38 int (*js)[2];
39 unsigned int* bit0;
41 int ns;
42
43 void init();
44 void set(int nns, int (*jjs)[2]);
45 };
46
47 static constexpr int BLOCK = 32;
49 static constexpr int LSTCAP = 48;
50
55
57 int* bnum;
61
62 int* iakpl;
64 int* lst;
68 int* iak;
71
72 const real* x;
73 const real* y;
74 const real* z;
75 int* update;
77
80 int fresh;
82
83 int nakpl;
84 int niak;
85 int n;
86
88
89 static void dataAlloc(SpatialUnit& u, int n, double cutoff, double buffer, //
90 const real* x, const real* y, const real* z, int nstype, //
91 int ns1, int (*js1)[2], int ns2, int (*js2)[2], //
92 int ns3, int (*js3)[2], int ns4, int (*js4)[2]);
93
94 static void dataInit(SpatialUnit);
95
97
98 template <class IMG>
99 static void RunStep5(SpatialUnit u);
100
101private:
102 int* iakpl_rev;
103 int* akpf;
104 real* xold;
105 real* yold;
106 real* zold;
107 int nak;
108 int nakp;
109 int nakpk;
110 int px;
111 int py;
112 int pz;
113 int cap_nakpl;
114 int nstype;
115
116 friend void nblistRefresh();
119};
120
121//====================================================================//
122// //
123// Global Variables //
124// //
125//====================================================================//
126
132
133constexpr int cspatial_fresh_mask_echglj = 0x00000001;
134
136}
#define TINKER_EXTERN
Definition: macro.h:108
real y
Definition: spatial.h:22
int * iakpl
Definition: spatial.h:62
ScaleInfo si1
#ScaleInfo object 1.
Definition: spatial.h:51
int n
Number of atoms.
Definition: spatial.h:85
int niak
Length of iak, not greater than LSTCAP*nak.
Definition: spatial.h:84
int unsorted
Original atom number.
Definition: spatial.h:23
int ns
Number of pairs of atoms with exclusion rules.
Definition: spatial.h:41
real buffer
Cutoff buffer distance.
Definition: spatial.h:79
friend void spatialUpdate(SpatialUnit)
Center * half
Half box size and radius. Length nak.
Definition: spatial.h:60
void set(int nns, int(*jjs)[2])
static void dataAlloc(SpatialUnit &u, int n, double cutoff, double buffer, const real *x, const real *y, const real *z, int nstype, int ns1, int(*js1)[2], int ns2, int(*js2)[2], int ns3, int(*js3)[2], int ns4, int(*js4)[2])
Center * akc
Definition: spatial.h:58
static void dataUpdateSorted(SpatialUnit)
real z
Definition: spatial.h:22
SortedAtom * sorted
Sorted atoms. Length n.
Definition: spatial.h:56
static void RunStep5(SpatialUnit u)
int * lst
Definition: spatial.h:64
real x
Definition: spatial.h:32
static void dataInit(SpatialUnit)
const real * x
Reference of the coordinates.
Definition: spatial.h:72
static constexpr int LSTCAP
Parameter for pre-allocating work arrays.
Definition: spatial.h:49
int fresh
Definition: spatial.h:80
real w
Definition: spatial.h:32
static constexpr int BLOCK
Definition: spatial.h:47
unsigned int * bit0
Definition: spatial.h:39
ScaleInfo si3
#ScaleInfo object 3.
Definition: spatial.h:53
int * bnum
bnum[sorted[i].unsorted] = i. Length n.
Definition: spatial.h:57
ScaleInfo si4
#ScaleInfo object 4.
Definition: spatial.h:54
friend void spatialDataInit_cu(SpatialUnit)
int * iak
Definition: spatial.h:68
real x
Definition: spatial.h:22
real cutoff
Cutoff distance.
Definition: spatial.h:78
real z
Definition: spatial.h:32
const real * z
Reference of the coordinates.
Definition: spatial.h:74
int * update
Definition: spatial.h:75
ScaleInfo si2
#ScaleInfo object 2.
Definition: spatial.h:52
const real * y
Reference of the coordinates.
Definition: spatial.h:73
real y
Definition: spatial.h:32
friend void nblistRefresh()
Updates the neighbor lists.
int nakpl
Length of iakpl. Multiple.
Definition: spatial.h:83
int(* js)[2]
Atom pairs of atoms with exclusion rules (of length ns).
Definition: spatial.h:38
Definition: spatial.h:16
SpatialUnit mspatial_v2_unit
SpatialUnit dspspatial_v2_unit
GenericUnit< Spatial, GenericUnitVersion::DISABLE_ON_DEVICE > SpatialUnit
Definition: spatial.h:11
SpatialUnit uspatial_v2_unit
SpatialUnit cspatial_v2_unit
void spatialUpdate(SpatialUnit)
SpatialUnit vspatial_v2_unit
constexpr int cspatial_fresh_mask_echglj
Definition: spatial.h:133
Definition: spatial.h:31
Definition: spatial.h:37
Definition: spatial.h:21
float real
Definition: precision.h:80
Resource handle. Analogous to Fortran i/o unit represented by a signed integer.
Definition: genunit.h:51
Definition: testrt.h:9