AtomLeafAgentManager.AgentSource<Cell>
, BoxCellManager
, BoundaryEventListener
public class NeighborCellManager extends java.lang.Object implements BoxCellManager, BoundaryEventListener, AtomLeafAgentManager.AgentSource<Cell>
Modifier and Type | Field | Description |
---|---|---|
protected AtomLeafAgentManager<Cell> |
agentManager |
|
protected Box |
box |
|
protected int |
cellRange |
|
protected boolean |
doApplyPBC |
|
protected CellLattice |
lattice |
|
protected int[] |
numCells |
|
protected IMoleculePositionDefinition |
positionDefinition |
|
protected double |
range |
|
protected boolean |
suppressBoxLengthWarning |
|
protected Vector |
v |
Constructor | Description |
---|---|
NeighborCellManager(Box box,
double potentialRange) |
Constructs manager for neighbor cells in the given box.
|
NeighborCellManager(Box box,
double potentialRange,
IMoleculePositionDefinition positionDefinition) |
Construct manager for neighbor cells in the given box.
|
Modifier and Type | Method | Description |
---|---|---|
void |
assignCell(IAtom atom) |
Assigns the cell for the given atom.
|
void |
assignCellAll() |
Assigns cells to all interacting atoms in the box.
|
void |
boundaryInflate(BoundaryEvent e) |
Informs the listener that the boundary shape and/or size has changed.
|
protected boolean |
checkDimensions() |
Checks the box's dimensions to make sure the number of cells is
appropriate.
|
Cell |
getCell(IAtom atom) |
|
int |
getCellRange() |
Returns the cellRange.
|
boolean |
getDoApplyPBC() |
|
CellLattice |
getLattice() |
Returns the lattice that defines the cell arrangement.
|
double |
getPotentialRange() |
Returns the potential range.
|
Cell |
makeAgent(IAtom atom,
Box agentBox) |
Returns the cell containing the given atom.
|
IListener<MCMoveEvent> |
makeMCMoveListener() |
|
void |
releaseAgent(Cell cell,
IAtom atom,
Box agentBox) |
Removes the given atom from the cell.
|
void |
setCellRange(int newCellRange) |
Sets the cell range to the given value.
|
void |
setDoApplyPBC(boolean newDoApplyPBC) |
|
void |
setPotentialRange(double newRange) |
Sets the potential range to the given value.
|
void |
setSuppressBoxLengthWarning(boolean doSuppress) |
|
void |
updateCell(IAtom atom) |
protected final CellLattice lattice
protected final IMoleculePositionDefinition positionDefinition
protected final Box box
protected int cellRange
protected double range
protected final AtomLeafAgentManager<Cell> agentManager
protected boolean doApplyPBC
protected final Vector v
protected final int[] numCells
protected boolean suppressBoxLengthWarning
public NeighborCellManager(Box box, double potentialRange)
public NeighborCellManager(Box box, double potentialRange, IMoleculePositionDefinition positionDefinition)
public void setSuppressBoxLengthWarning(boolean doSuppress)
doSuppress
- warnings about box length being too small. This is
useful if the potential range is short enough, but the
neighbor listing padding does not fit in the box.public void setDoApplyPBC(boolean newDoApplyPBC)
public boolean getDoApplyPBC()
public CellLattice getLattice()
BoxCellManager
getLattice
in interface BoxCellManager
public void setPotentialRange(double newRange)
cellRange*cellSize > potentialRange
.public double getPotentialRange()
public int getCellRange()
public void setCellRange(int newCellRange)
public void boundaryInflate(BoundaryEvent e)
BoundaryEventListener
boundaryInflate
in interface BoundaryEventListener
e
- event, which can be used to determine the boundary that changed.protected boolean checkDimensions()
public void assignCellAll()
assignCellAll
in interface BoxCellManager
public void assignCell(IAtom atom)
public void updateCell(IAtom atom)
public IListener<MCMoveEvent> makeMCMoveListener()
public Cell makeAgent(IAtom atom, Box agentBox)
makeAgent
in interface AtomLeafAgentManager.AgentSource<Cell>
agentBox
- TODOpublic void releaseAgent(Cell cell, IAtom atom, Box agentBox)
releaseAgent
in interface AtomLeafAgentManager.AgentSource<Cell>