NeighborList
Source code in dmff/common/nblist.py
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 | |
__init__(box, rc)
wrapper of jax_md.space_periodic_general and jax_md.partition.NeighborList
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
box |
jnp.ndarray
|
A (spatial_dim, spatial_dim) affine transformation or [lx, ly, lz] vector |
required |
rc |
float
|
cutoff radius |
required |
Source code in dmff/common/nblist.py
9 10 11 12 13 14 15 16 17 18 19 20 | |
allocate(positions)
A function to allocate a new neighbor list. This function cannot be compiled, since it uses the values of positions to infer the shapes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
positions |
jnp.ndarray
|
particle positions |
required |
Returns:
| Type | Description |
|---|---|
jax_md.partition.NeighborList |
Source code in dmff/common/nblist.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
distance()
property
get pair distance in current neighborlist
Returns:
| Type | Description |
|---|---|
jnp.ndarray: (nPairs, ) |
Source code in dmff/common/nblist.py
93 94 95 96 97 98 99 100 101 | |
dr()
property
get pair distance vector in current neighborlist
Returns:
| Type | Description |
|---|---|
jnp.ndarray: (nPairs, 3) |
Source code in dmff/common/nblist.py
83 84 85 86 87 88 89 90 91 | |
pair_mask()
property
get regularized pair index and mask
Returns:
| Type | Description |
|---|---|
jnp.ndarray, jnp.ndarray
|
((nParis, 2), (nPairs, )) |
Source code in dmff/common/nblist.py
60 61 62 63 64 65 66 67 68 69 70 71 72 | |
pairs()
property
get raw pair index
Returns:
| Type | Description |
|---|---|
jnp.ndarray: (nPairs, 2) |
Source code in dmff/common/nblist.py
51 52 53 54 55 56 57 58 | |
positions()
property
get current positions in current neighborlist
Returns:
| Type | Description |
|---|---|
jnp.ndarray: (n, 3) |
Source code in dmff/common/nblist.py
74 75 76 77 78 79 80 81 | |
update(positions)
A function to update a neighbor list given a new set of positions and a previously allocated neighbor list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
positions |
jnp.ndarray
|
particle positions |
required |
Returns:
| Type | Description |
|---|---|
jax_md.partition.NeighborList |
Source code in dmff/common/nblist.py
37 38 39 40 41 42 43 44 45 46 47 48 49 | |