[yt-dev] Issue #1186: Include particles in the neighboring blocks for nearest neighbor particle deposition? (yt_analysis/yt)

Yi-Hao Chen issues-reply at bitbucket.org
Mon Mar 14 09:24:36 PDT 2016


New issue 1186: Include particles in the neighboring blocks for nearest neighbor particle deposition?
https://bitbucket.org/yt_analysis/yt/issues/1186/include-particles-in-the-neighboring

Yi-Hao Chen:

As I understand, the current nearest neighbor particle deposition function takes only the particle with in a block and assign the values of each cell by the nearest particle. However, it does not take the particles in the adjacent blocks into account. Thus it results in sharp boundaries between the blocks in the deposited field. It also gives empty blocks if there is no particle inside them, even though there are some particles just next to the wall.

I am interested in implementing a more flexible nearest neighbor deposition that takes at least the particles in the surrounding blocks into consideration. I have thought about some possible methods. But due to my unfamiliarity with the data structure, I am not sure if they are really possible. It would be great to have your suggestions. Thanks!

1. Pass more particles into the deposition function in ```Dataset.add_deposited_particle_field```. Instead of using ```pos = data[ptype, "particle_position"]```, I can include all nearby particles by using something like ```pos = data.ds.all_data()[ptype, "particle_position"][mask]``` where ```mask``` filters out the needed particles by specifying the boundaries.
However, since ```data``` is not necessary a grid, it might have some problems.

2. Use validator to force ```data``` to be a grid. 
Then I can include particles in the surrounding blocks. I am not sure if yt loaded the indices of surrounding blocks, but it seems that the information is readily available in my FLASH plot files.

3. Force ```data``` to include guard cells.
I don't really know how guard cells work in yt. But in principle I can stored the deposited field and distance information in the guard cells, and compare them with the grid data to decide which value I want to keep. It might be too complicated though...





More information about the yt-dev mailing list