Skip to content

Commit 57a1635

Browse files
Removing v3 particle-particle interaction code
1 parent 89b321a commit 57a1635

File tree

14 files changed

+0
-1234
lines changed

14 files changed

+0
-1234
lines changed

docs/user_guide/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ examples/tutorial_interpolation.ipynb
6262
```
6363

6464
<!-- examples/tutorial_particle_field_interaction.ipynb -->
65-
<!-- examples/tutorial_interaction.ipynb -->
6665
<!-- examples/tutorial_analyticaladvection.ipynb -->
6766
<!-- examples/tutorial_kernelloop.ipynb -->
6867

src/parcels/_core/particleset.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ class ParticleSet:
5353
Optional list of "trajectory" values (integers) for the particle IDs
5454
partition_function :
5555
Function to use for partitioning particles over processors. Default is to use kMeans
56-
periodic_domain_zonal :
57-
Zonal domain size, used to apply zonally periodic boundaries for particle-particle
58-
interaction. If None, no zonally periodic boundaries are applied
5956
6057
Other Variables can be initialised using further arguments (e.g. v=... for a Variable named 'v')
6158
"""
@@ -74,7 +71,6 @@ def __init__(
7471
self._data = None
7572
self._repeat_starttime = None
7673
self._kernel = None
77-
self._interaction_kernel = None
7874

7975
self.fieldset = fieldset
8076
lon = np.empty(shape=0) if lon is None else _convert_to_flat_array(lon)
@@ -228,8 +224,6 @@ def add(self, particles):
228224
for d in self._data:
229225
self._data[d] = np.concatenate((self._data[d], particles._data[d]))
230226

231-
# Adding particles invalidates the neighbor search structure.
232-
self._dirty_neighbor = True
233227
return self
234228

235229
def __iadd__(self, particles):
@@ -256,44 +250,6 @@ def remove_indices(self, indices):
256250
for d in self._data:
257251
self._data[d] = np.delete(self._data[d], indices, axis=0)
258252

259-
def _active_particles_mask(self, time, dt):
260-
active_indices = (time - self._data["time"]) / dt >= 0
261-
non_err_indices = np.isin(self._data["state"], [StatusCode.Success, StatusCode.Evaluate])
262-
active_indices = np.logical_and(active_indices, non_err_indices)
263-
self._active_particle_idx = np.where(active_indices)[0]
264-
return active_indices
265-
266-
def _compute_neighbor_tree(self, time, dt):
267-
active_mask = self._active_particles_mask(time, dt) # TODO still needed with KernelParticles?
268-
269-
self._values = np.vstack(
270-
(
271-
self._data["z"],
272-
self._data["lat"],
273-
self._data["lon"],
274-
)
275-
)
276-
if self._dirty_neighbor:
277-
self._neighbor_tree.rebuild(self._values, active_mask=active_mask)
278-
self._dirty_neighbor = False
279-
else:
280-
self._neighbor_tree.update_values(self._values, new_active_mask=active_mask)
281-
282-
def _neighbors_by_index(self, particle_idx):
283-
neighbor_idx, distances = self._neighbor_tree.find_neighbors_by_idx(particle_idx)
284-
neighbor_idx = self._active_particle_idx[neighbor_idx]
285-
mask = neighbor_idx != particle_idx
286-
neighbor_idx = neighbor_idx[mask]
287-
if "horiz_dist" in self._data._ptype.variables:
288-
self._data["vert_dist"][neighbor_idx] = distances[0, mask]
289-
self._data["horiz_dist"][neighbor_idx] = distances[1, mask]
290-
return True # TODO fix for v4 ParticleDataIterator(self.particledata, subset=neighbor_idx)
291-
292-
def _neighbors_by_coor(self, coor):
293-
neighbor_idx = self._neighbor_tree.find_neighbors_by_coor(coor)
294-
neighbor_ids = self._data["trajectory"][neighbor_idx]
295-
return neighbor_ids
296-
297253
def populate_indices(self):
298254
"""Pre-populate guesses of particle ei (element id) indices"""
299255
for i, grid in enumerate(self.fieldset.gridset):
@@ -359,13 +315,6 @@ def Kernel(self, pyfunc):
359315
pyfuncs=[pyfunc],
360316
)
361317

362-
def InteractionKernel(self, pyfunc_inter):
363-
from parcels.interaction.interactionkernel import InteractionKernel
364-
365-
if pyfunc_inter is None:
366-
return None
367-
return InteractionKernel(self.fieldset, self._ptype, pyfunc=pyfunc_inter)
368-
369318
def data_indices(self, variable_name, compare_values, invert=False):
370319
"""Get the indices of all particles where the value of `variable_name` equals (one of) `compare_values`.
371320

src/parcels/interaction/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/parcels/interaction/interactionkernel.py

Lines changed: 0 additions & 216 deletions
This file was deleted.

src/parcels/interaction/neighborsearch/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)