Replies: 5 comments 2 replies
-
|
I realize that a key part of the question is what |
Beta Was this translation helpful? Give feedback.
-
|
Quick follow-up: I tested replacing In // was: Box pbox = amrex::grow(Box(iv, iv), ref_fac*nGrow) + pshift;
Box pbox = amrex::grow(Box(iv, iv), nGrow) + pshift;In // was: box.grow(computeRefFac(0, lev)*m_num_neighbor_cells);
box.grow(m_num_neighbor_cells);This treats |
Beta Was this translation helpful? Give feedback.
-
|
Following up again on the broader issue behind my original question (sorry for spamming! I'm getting more familiar with the code so my thinking is maturing). In my application of interest here (DEM collisions with AMR), I'd like to be able to use coarser Eulerian meshes without being overly penalized on the collision/neighbor side. Right now, when
I have working implementations of both on my side and would be happy to contribute PRs. Would there be interest in this, and is there a preferred API direction? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @desjardi, Thanks for your question and your interest in AMReX! I think the original intention behind The improvements you mention sound good and I would be happy to review and accept PRs along the lines of your suggestions. Maybe for the API, you could add another constructor that takes the physical search distance instead of num_neighbor_cells, which would instead be computed? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks Andrew! That confirms my understanding of the intent. Rather than a new constructor, I went with method overloads that take the physical search distance at call time:
The overload approach seemed more flexible than a constructor since the search radius can change between calls (e.g., different radii for different physics, or adapting to particle size distributions). The original I have a working CPU implementation — happy to clean it up and submit a PR. Does the overload approach sound reasonable, or would you prefer the constructor route? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using
NeighborParticleContainerwithfillNeighbors()for DEM collisions in a multi-level setup (max_level=4,ref_ratio=2). I'm seeing severe performance issues and crashes incacheNeighborInfo, and I believe it traces to the search box construction ingetNeighborTags.In the multi-level path (
use_mask = false), inSrc/Particle/AMReX_NeighborParticlesI.Haround line 607:IntVect ref_fac = computeRefFac(0, lev);This scales the search box relative to level 0, so calling
fillNeighbors()withnGrow=2on a 5-level hierarchy produces a ±32-cell search box at the finest level (sincecomputeRefFac(0, 4) = 16).I think
computeRefFac(src_tag.level, lev)might be the intended behavior? The physical reasoning:m_num_neighbor_cellsdefines a search radius in terms of cells on the particle's home level. When searching for neighbors on a different level, the number of cells should scale by the ratio between those two levels, not between level 0 and the destination. A particle living on level 4 and searching level 4 should neednGrowcells, not16 * nGrow.This would also be consistent with the single-level
use_mask = truepath, which usesnGrowdirectly with no scaling.The same pattern appears in
GetCommTagsBoxaround line 283 of the same file.Is this the intended behavior, or is the
0a bug? Am I misunderstanding howm_num_neighbor_cellsis meant to be interpreted across levels?Beta Was this translation helpful? Give feedback.
All reactions