cell=self.Potts.createCellG(pt) assigning the new cell a target volume : cell.targetVolume=self.initTargetVolume type, : cell.type=self.initCellType and compressibility : cell.lambdaVolume=initLambdaVolume based on the values passed to the steppable from the main script. BubbleNucleator The first three lines of the function create a reference to a point on nucleateBubble the cell lattice (pt=Point3D(0,0,0)), assign it a random between 0 and y-coordinate y_dim-1: pt.y=randint(0,self.dim.y-1) and an of 3: x-coordinate pt.x=3 The line calls the function and passes it the point (pt) at which to createNewCell create the new bubble: self.createNewCell(pt) Finally, the step(self,mcs) function calls the nucleateBubble function self.numNewBubbles times per MCS. Listing 13 the code for the steppable. AirInjector AirInjector(SteppablePy): def __init__(self,_simulator,_frequency=1): SteppablePy.__init__(self,_frequency) self.simulator=_simulator self.Potts=self.simulator.getPotts() self.cellField=self.Potts.getCellFieldG() def start(self): pass def setInjectionPoint(self,_x,_y,_z): self.injectionPoint=CompuCell.Point3D(int(_x),int(_y),int(_z)) def setVolumeIncrement(self,_increment): self.volumeIncrement=_increment def step(self,mcs): if mcs <5000: return cell=self.cellField.get(self.injectionPoint) if cell: cell.targetVolume+=self.volumeIncrement Listing 13. Python code for the steppable which simulates air injection into AirInjector the bubble currently occupying the cell-lattice pixel at location (x,y,z). Air injection
cell=self.Potts.createCellG(pt) assigning the new cell a target volume : cell.targetVolume=self.initTargetVolume type, : cell.type=self.initCellType and compressibility : cell.lambdaVolume=initLambdaVolume based on the values passed to the BubbleNucleator steppable from the main script. The first three lines of the nucleateBubble function create a reference to a point on the cell lattice (pt=Point3D(0,0,0)), assign it a random y-coordinate between 0 and y_dim-1: pt.y=randint(0,self.dim.y-1) and an x-coordinate of 3: pt.x=3 The line calls the createNewCell function and passes it the point (pt) at which to create the new bubble: self.createNewCell(pt) Finally, the step(self,mcs) function calls the nucleateBubble function self.numNewBubbles times per MCS. Listing 13 the code for the AirInjector steppable. AirInjector(SteppablePy): def __init__(self,_simulator,_frequency=1): SteppablePy.__init__(self,_frequency) self.simulator=_simulator self.Potts=self.simulator.getPotts() self.cellField=self.Potts.getCellFieldG() def start(self): pass def setInjectionPoint(self,_x,_y,_z): self.injectionPoint=CompuCell.Point3D(int(_x),int(_y),int(_z)) def setVolumeIncrement(self,_increment): self.volumeIncrement=_increment def step(self,mcs): if mcs <5000: return cell=self.cellField.get(self.injectionPoint) if cell: cell.targetVolume+=self.volumeIncrement Listing 13. Python code for the AirInjector steppable which simulates air injection into the bubble currently occupying the cell-lattice pixel at location (x,y,z). Air injection