CompuCell3d manual and Tutorial Version 2


Calculating center of mass when using periodic boundary conditions



Download 6.67 Mb.
Page61/66
Date26.04.2018
Size6.67 Mb.
#46944
1   ...   58   59   60   61   62   63   64   65   66

4. Calculating center of mass when using periodic boundary conditions.

When you are running calculation with periodic boundary condition you may end up with situation like in the figure below:


Clearly what happens is that simply connected cell is wrapped around the lattice edge so part of it is in the region of high values of x coordinate and the other is in the region where x coordinates have low values. Consequently a naïve calculation of center of mass position according to :



would result in being somewhere in the middle of the lattice and abviously outside the cell.A better procedure could be as follows: Before calculating center of mass when new pixel is added or lost we "shift" a cell and new pixel (gained or lost )to the middle of the lattice do calculations "in the middle of the lattice" and shift back. Now if after shifting back it turns out that center of mass of a cell lies outside lattice position it in the center of mass by applygin a shift equal to the length of the lattice and whose direction should be such that the center of mass of the cell ends up inside the lattice (there is only one such shift and it might be be equal to zero vector).

This is how we do it using mathematical formulas:



Download 6.67 Mb.

Share with your friends:
1   ...   58   59   60   61   62   63   64   65   66




The database is protected by copyright ©ininet.org 2024
send message

    Main page