Skip to content

Commit 7bae9f1

Browse files
Update interaction notebook introduction text
1 parent 773bf28 commit 7bae9f1

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

docs/user_guide/examples_v3/tutorial_interaction.ipynb

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"id": "0",
77
"metadata": {},
88
"source": [
9-
"# Particle-Particle interaction\n"
9+
"# 🎓 Particle-Particle interaction\n"
1010
]
1111
},
1212
{
@@ -15,24 +15,7 @@
1515
"id": "1",
1616
"metadata": {},
1717
"source": [
18-
"In this notebook, we show an example of the new 'particle-particle-interaction' functionality in Parcels. Note that this functionality is still in development, and the implementation is fairly rudimentary for now. Importantly:\n",
19-
"\n",
20-
"- The type of interactions that are supported is still limited\n",
21-
"\n",
22-
"Interactions are implemented through `InteractionKernels`, which are similar to normal `Kernels`. The `InteractionKernels` are applied between particles that are located closer to each other than a specified `interaction_distance`. In general, the code structure needs three adaptations to apply particle-particle interaction:\n",
23-
"\n",
24-
"1. The `ParticleSet` requires an `interaction_distance` argument upon creation, to define the `interaction_distance`.\n",
25-
"2. `ParticleSet.execute()` requires the `pyfunc_inter` argument, which contains the `InteractionKernels` that will be executed, similarly to the `pyfunc` argument for normal `Kernels`.\n",
26-
"3. `InteractionKernels` have two additional arguments compared to normal `Kernels`:\n",
27-
"\n",
28-
"```python\n",
29-
"def InteractionKernel(particle, fieldset, time, neighbors, mutator)\n",
30-
"```\n",
31-
"\n",
32-
"The `neighbors` argument provides a list of the particles that are within a neighborhood (i.e. closer than the `interaction_distance` argument in `ParticleSet` creation).\n",
33-
"\n",
34-
"The `mutator` argument is an initially empty list with all the mutations that need to be performed on particles at the end of running all `InteractionKernels` on all particles.\n",
35-
"This `mutator` argument is required, because otherwise the order at which interactions are applied has implications for the simulation. As a consequence, the simulation will likely be dependent on the order of the particle list if no mutator list is used.\n"
18+
"In this tutorial, we show an example of the 'particle-particle-interaction' functionality in Parcels. Note that this functionality is still fairly rudimentary for now. Importantly, as particle-interaction is a many-body problem it scales as $N^2$ and can thus become very slow for large ParticleSets. There is currently **no advanced optimisation** (such as using techniques from [Smoothed Particle Hydrodynamics](https://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics)) build-in to Parcels. "
3619
]
3720
},
3821
{
@@ -43,7 +26,7 @@
4326
"source": [
4427
"## Pulling particles\n",
4528
"\n",
46-
"Below is an example of what can be done with particle-particle interaction. We create a square grid of $N\\times N$ particles, which are all subject to Brownian Motion (via the built-in `DiffusionUniformKh` Kernel). Furthermore, some of the particles also 'attract' other particles that are within the interaction distance: these attracted particles move with a constant velocity to the attracting particles.\n"
29+
"Below is an example of what can be done with particle-particle interaction. We create a square grid of $N\\times N$ particles, which are all subject to Brownian Motion (via the built-in `DiffusionUniformKh` Kernel). Furthermore, two of the particles also 'attract' other particles that are within the interaction distance: these attracted particles move with a constant velocity to the attracting particles.\n"
4730
]
4831
},
4932
{
@@ -72,7 +55,7 @@
7255
"outputs": [],
7356
"source": [
7457
"def Pull(particles, fieldset):\n",
75-
" \"\"\"InterActionKernel that \"pulls\" all neighbor particles\n",
58+
" \"\"\"Kernel that \"pulls\" all neighbor particles\n",
7659
" toward the attracting particle with a constant velocity\"\"\"\n",
7760
" interaction_distance = 0.5\n",
7861
" velocity = -0.04 # predefined attracting velocity\n",

0 commit comments

Comments
 (0)