etomica.nbr
Class CriterionPositionWall

java.lang.Object
  extended by etomica.nbr.CriterionPositionWall
All Implemented Interfaces:
AtomLeafAgentManager.AgentSource, NeighborCriterion, Serializable

public class CriterionPositionWall
extends Object
implements NeighborCriterion, AtomLeafAgentManager.AgentSource, Serializable

Simple neighbor criterion based on distance moved by a leaf atom since the last update. The potential is assumed to be from a wall that exists at the box boundaries or at some fixed position within the box.

See Also:
Serialized Form

Nested Class Summary
protected static class CriterionPositionWall.DoubleWrapper
           
 
Field Summary
protected  AtomLeafAgentManager agentManager
           
protected  double dr
           
protected  double rMaxSafe
           
protected  double safetyFactor
           
 
Constructor Summary
CriterionPositionWall(ISimulation sim)
           
 
Method Summary
 boolean accept(IAtomList atom)
           
 Class getAgentClass()
          Returns the Class of the agent.
 double getInteractionRange()
          Returns the interaction range of the wall potential.
 Dimension getInteractionRangeDimension()
           
 double getNeighborRange()
           
 Dimension getNeighborRangeDimension()
           
 double getSafetyFactor()
          returns the safety factor
 double getWallPosition()
          Returns the position of the wall.
 Dimension getWallPositionDimension()
           
 boolean isBoundaryWall()
          Returns true if the walls are at the box boundaries.
 Object makeAgent(IAtom atom)
          Returns an agent for the given Atom.
 boolean needUpdate(IAtom atom)
          Indicates whether the neighbor list for the given atom should be updated, according to this criterion.
 void releaseAgent(Object agent, IAtom atom)
          This informs the agent source that the agent is going away and that the agent source should disconnect the agent from other elements
 void reset(IAtom atom)
          Indicates to criterion that given atom's neighbor list has just been updated, and that properties (e.g., record of atom's position) used by needUpdate and unsafe() methods should be reset.
 void setBoundaryWall(boolean isBoundaryWall)
          Sets whether the walls are at the box boundaries or not.
 void setBox(IBox box)
          Specifies the box where the criterion is being applied.
 void setInteractionRange(double r)
          Informs the criterion of the interaction range of the wall potential.
 void setNeighborRange(double r)
          Sets the neighbor range of the criterion.
 void setSafetyFactor(double f)
          Sets the safety factor (between 0 and 1.0) that determines when the criterion thinks it needs an update.
 void setWallDim(int d)
          Sets the orientation of the wall to be perpendicular to the given dimension
 void setWallPosition(double p)
          Sets the position of the wall.
 boolean unsafe()
          Indicates whether the atom has changed (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

safetyFactor

protected double safetyFactor

dr

protected double dr

rMaxSafe

protected double rMaxSafe

agentManager

protected AtomLeafAgentManager agentManager
Constructor Detail

CriterionPositionWall

public CriterionPositionWall(ISimulation sim)
Method Detail

setSafetyFactor

public void setSafetyFactor(double f)
Sets the safety factor (between 0 and 1.0) that determines when the criterion thinks it needs an update. Safety factors near 1.0 allow atoms to travel farther before needing an update, but are more risky.


getSafetyFactor

public double getSafetyFactor()
returns the safety factor


setWallDim

public void setWallDim(int d)
Sets the orientation of the wall to be perpendicular to the given dimension


getInteractionRange

public double getInteractionRange()
Returns the interaction range of the wall potential.


setInteractionRange

public void setInteractionRange(double r)
Informs the criterion of the interaction range of the wall potential.


getInteractionRangeDimension

public Dimension getInteractionRangeDimension()

setNeighborRange

public void setNeighborRange(double r)
Sets the neighbor range of the criterion. Atoms within the given distance of the wall are "accepted".


getNeighborRange

public double getNeighborRange()

getNeighborRangeDimension

public Dimension getNeighborRangeDimension()

isBoundaryWall

public boolean isBoundaryWall()
Returns true if the walls are at the box boundaries.


setBoundaryWall

public void setBoundaryWall(boolean isBoundaryWall)
Sets whether the walls are at the box boundaries or not.


setWallPosition

public void setWallPosition(double p)
Sets the position of the wall. This parameter is ignored if isBoundaryWall is true.


getWallPosition

public double getWallPosition()
Returns the position of the wall. This parameter is ignored if isBoundaryWall is true.


getWallPositionDimension

public Dimension getWallPositionDimension()

needUpdate

public boolean needUpdate(IAtom atom)
Description copied from interface: NeighborCriterion
Indicates whether the neighbor list for the given atom should be updated, according to this criterion.

Specified by:
needUpdate in interface NeighborCriterion
Returns:
true if the atom's list should be updated.

setBox

public void setBox(IBox box)
Description copied from interface: NeighborCriterion
Specifies the box where the criterion is being applied. Sometimes needed if the criterion depends on features of the box, such as the boundary.

Specified by:
setBox in interface NeighborCriterion

unsafe

public boolean unsafe()
Description copied from interface: NeighborCriterion
Indicates whether the atom has changed (e.g. moved) by an amount that might have caused its neighbor list to be invalid. If this method returns true, a neighbor list failure may have introduced errors in the calculation.

Specified by:
unsafe in interface NeighborCriterion

accept

public boolean accept(IAtomList atom)
Specified by:
accept in interface NeighborCriterion

reset

public void reset(IAtom atom)
Description copied from interface: NeighborCriterion
Indicates to criterion that given atom's neighbor list has just been updated, and that properties (e.g., record of atom's position) used by needUpdate and unsafe() methods should be reset.

Specified by:
reset in interface NeighborCriterion

getAgentClass

public Class getAgentClass()
Description copied from interface: AtomLeafAgentManager.AgentSource
Returns the Class of the agent. This is used to create an array of the appropriate Class.

Specified by:
getAgentClass in interface AtomLeafAgentManager.AgentSource

makeAgent

public Object makeAgent(IAtom atom)
Description copied from interface: AtomLeafAgentManager.AgentSource
Returns an agent for the given Atom.

Specified by:
makeAgent in interface AtomLeafAgentManager.AgentSource

releaseAgent

public void releaseAgent(Object agent,
                         IAtom atom)
Description copied from interface: AtomLeafAgentManager.AgentSource
This informs the agent source that the agent is going away and that the agent source should disconnect the agent from other elements

Specified by:
releaseAgent in interface AtomLeafAgentManager.AgentSource