You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use a new neighborhood search in TrixiParticles.jl, one has to add a function create_neighborhood_search for this type, which calls the constructor of the neighborhood search and initializes it.
Options for the neighborhood search can't be passed. Currently, we only have the threaded_update kwarg, which can be passed to Semidiscretization and is then passed through create_neighborhood_search to the constructor of the NHS. This doesn't work with multiple neighborhood search implementations with different kwargs.
We can't just call the constructor and pass a neighborhood search object because we need multiple objects (one for each pair of physics systems).
My best idea so far is the following:
Create and pass to the Semidiscretization an empty neighborhood search, setting all options in the constructor.
Then, in PointNeighbors.jl, add a function copy_neighborhood_search, which takes a neighborhood search, a number of particles, and a search radius, and then creates a neighborhood search with the same type and options and the new size and search radius.
In the NHS constructors, the number of particles is set to zero by default for convenience and the search radius to nothing or so. The resulting neighborhood search can't be actually used without a search radius, so it's only to be used with copy_neighborhood_search.
Currently, we only pass the type of the neighborhood search, e.g.:
This comes with two major problems:
create_neighborhood_search
for this type, which calls the constructor of the neighborhood search and initializes it.threaded_update
kwarg, which can be passed toSemidiscretization
and is then passed throughcreate_neighborhood_search
to the constructor of the NHS. This doesn't work with multiple neighborhood search implementations with different kwargs.We can't just call the constructor and pass a neighborhood search object because we need multiple objects (one for each pair of physics systems).
My best idea so far is the following:
Semidiscretization
an empty neighborhood search, setting all options in the constructor.copy_neighborhood_search
, which takes a neighborhood search, a number of particles, and a search radius, and then creates a neighborhood search with the same type and options and the new size and search radius.nothing
or so. The resulting neighborhood search can't be actually used without a search radius, so it's only to be used withcopy_neighborhood_search
.The line above would then become
and setting options is easy and modular:
For each pair of physics systems, TrixiParticles.jl would then call:
Does anyone have any other ideas?
@LasNikas @svchb @sloede
The text was updated successfully, but these errors were encountered: