Skip to content

Commit a46a55e

Browse files
committed
improve documentation of NeighborPair
1 parent ed01396 commit a46a55e

4 files changed

Lines changed: 503 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CellListMap.jl Changelog
1212

1313
Version 0.10.3-DEV
1414
--------------
15+
- ![INFO][badge-info] Clarifty the meaning of `NeighborPair` fields, specifically concerning the minimum-image consideration.
1516
- ![INFO][badge-info] Document the possibility of modifying individual positions with `setindex!` and `SVector`s.
1617

1718
Version 0.10.2

docs/src/ParticleSystem/introduction.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ extract from the object using [destructuring syntax](https://docs.julialang.org/
4545

4646
The `output` variable **must** be returned by the function, being it mutable or immutable.
4747

48+
The figure below illustrates the meaning the coordinates in a `NeighborPair` object.
49+
50+
![../assets/NeighborPair.svg](../assets/NeighborPair.svg)
51+
52+
Here $$\vec{x}$$ and $$\vec{y}_0$$ are the coordinates as provided by the user, which in this case fall inside the
53+
reference unitcell. But the image $$\vec{y}$$ of $$\vec{y}_0$$ is closer to $$\vec{x}$$. The `NeighborPair` object
54+
will contain the coordinates `pair.x ==`$$\vec{x}$$ and `pair.y ==`$$\vec{y}$$, such that `pair.y - pair.x` will be
55+
tipicaly the vector used, for example, to compute the force between the particles. Also, `pair.d == norm(pair.y - pair.y)`
56+
and corresponds to the norm of $$\vec{y} - \vec{x}$$, as represented in the figure.
57+
4858
### Basic examples
4959

5060
For example, computing the energy, as the sum of the inverse of the distance between particles, can be done with a function like:

0 commit comments

Comments
 (0)