Repository navigation
Overlapping cells after initialization with packCells #136
carlotacg1206-alt
started this conversation in
General discussion
Replies: 1 comment 5 replies
|
Hi, I cannot comment on what your added code might or might not have done, but here is a simple solution with the original packCells: Best, |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I am using HemoCell to simulate red blood cells (RBCs) flowing through a Y-shaped vessel. I have been modifying packCells to control the region in which the cells are initially placed, but I am experiencing an issue with overlapping cells in the initial configuration, and I do not understand why.
I have added two geometrical restrictions to the Packing class in packing.h:
1. Subdomain restriction
I implemented a setSubdomain() function that allows me to define a rectangular subdomain using six coordinates (x1, x2, y1, y2, z1, z2). The initial cell positions are randomly generated within this region instead of throughout the entire computational domain.
2. Cylindrical restriction
I also implemented a setCircularBoundary() function to restrict cell positions to a cylinder whose longitudinal axis is aligned with the X-axis. The circular cross-section lies in the YZ plane, and its radius and centre coordinates can be specified.
When both restrictions are enabled, cells are initially placed within the intersection of the rectangular subdomain and the cylindrical region. I also added a margin based on the largest semi-axis of the cell types to keep their centres away from the cylindrical boundary.
During the packing iterations, I additionally constrain the cell centres to remain within these geometrical limits.
The original packing algorithm for calculating cell-cell interactions and resolving overlaps has otherwise been left unchanged.
Geometry and packCells configuration
The original geometry dimensions are 120 × 52 × 120. After voxelization, the resulting dimensions are 122 × 44 × 106, using refDir = 0 and refDirN = 119.
I run packCells with the following command:
./packCells 61 22 53 --subdomain 5 25 0 22 0 53 --cylinder 10 11 26 --rbc 20
This corresponds to a cylindrical region with a radius of 10 µm and its centre at (y, z) = (11, 26) µm, together with the rectangular subdomain specified in the command. I am trying to initialize 20 RBCs within this region.
The problem
The packing process terminates and prints PACKING DONE, which, as far as I understand, means that a force-free configuration has been reached. However, when I visualize the resulting .xmf file in ParaView at the initial timestep (t = 0), I can still observe overlapping RBCs. I have attached an image showing the overlapping RBCs in ParaView for visual reference.
I would therefore like to ask:
Is it possible for packCells to report PACKING DONE while some cells are still overlapping?
Could restricting the initial positions to a subdomain and a cylindrical region interfere with the original packing algorithm or its overlap-resolution mechanism?
If so, I would also like to know whether there is a way to generate particles within a smaller region than the entire computational domain (NX x NY x NZ). In my case, the inlet has a circular cross-section and therefore does not occupy the entire YZ plane.
Is there anything else I should take into account when imposing these geometrical constraints to ensure that the final configuration is overlap-free?
Has anyone encountered a similar issue or implemented custom geometrical restrictions in packCells?
Any suggestions would be greatly appreciated.
Thank you in advance!
Attached image:

All reactions