etomica.nbr
Class PotentialMasterNbr

java.lang.Object
  extended by etomica.potential.PotentialMaster
      extended by etomica.nbr.PotentialMasterNbr
All Implemented Interfaces:
IPotentialMaster, AtomTypeAgentManager.AgentSource, SpeciesAgentManager.AgentSource, Serializable
Direct Known Subclasses:
PotentialMasterHybrid, PotentialMasterList, PotentialMasterSite

public abstract class PotentialMasterNbr
extends PotentialMaster
implements AtomTypeAgentManager.AgentSource, SpeciesAgentManager.AgentSource

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class etomica.potential.PotentialMaster
PotentialMaster.AtomIterator0, PotentialMaster.PotentialLinker
 
Field Summary
protected  IPotential[] allPotentials
           
protected  BoxAgentManager boxAgentManager
           
protected  BoxAgentManager.BoxAgentSource boxAgentSource
           
protected  SpeciesAgentManager intraAgentManager
           
protected  SpeciesAgentManager.AgentIterator intraPotentialIterator
           
protected  AtomTypeAgentManager rangedAgentManager
           
protected  AtomTypeAgentManager.AgentIterator rangedPotentialIterator
           
protected  ISimulation simulation
           
 
Fields inherited from class etomica.potential.PotentialMaster
enabled, first, iteratorFactory, last, lrcMaster
 
Constructor Summary
protected PotentialMasterNbr(ISimulation sim, BoxAgentManager.BoxAgentSource boxAgentSource, BoxAgentManager boxAgentManager)
           
 
Method Summary
 void addPotential(IPotentialMolecular potential, ISpecies[] species)
          Indicates to the PotentialMaster that the given potential should apply to the specified species.
protected  void addRangedPotential(IPotentialAtomic potential, IAtomType atomType)
           
protected abstract  void addRangedPotentialForTypes(IPotentialAtomic subPotential, IAtomType[] atomTypes)
           
 BoxAgentManager getCellAgentManager()
           
 PotentialArray getIntraPotentials(ISpecies atomType)
           
 PotentialArray getRangedPotentials(IAtomType atomType)
           
 ISimulation getSimulation()
          Returns the simulation associated with this PotentialMaster
 Class getSpeciesAgentClass()
          Returns the Class of the agent.
 Object makeAgent(IAtomType type)
          Returns an agent for the given AtomType.
 Object makeAgent(ISpecies type)
          Returns an agent for the given AtomType.
 PotentialGroup makePotentialGroup(int nBody)
          Returns an nBody PotentialGroup appropriate for this type of PotentialMaster.
 void potentialAddedNotify(IPotentialAtomic subPotential, PotentialGroup pGroup)
          Notifies the PotentialMaster that the sub-potential has been added to the given PotentialGroup, which is associated (but not necessarily held by) this PotentialMaster.
 void releaseAgent(Object agent, IAtomType type)
          This informs the agent source that the agent is going away and that the agent source should disconnect the agent from other elements.
 void releaseAgent(Object agent, ISpecies type)
          This informs the agent source that the agent is going away and that the agent source should disconnect the agent from other elements.
 void removePotential(IPotentialAtomic potential)
          Removes given potential from the group.
 
Methods inherited from class etomica.potential.PotentialMaster
addModel, addPotential, addPotential, calculate, getPotential, getPotentials, getSpecies, isEnabled, isEnabled, isEnabled, lrcMaster, removePotential, setEnabled, setEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rangedPotentialIterator

protected AtomTypeAgentManager.AgentIterator rangedPotentialIterator

intraPotentialIterator

protected SpeciesAgentManager.AgentIterator intraPotentialIterator

rangedAgentManager

protected final AtomTypeAgentManager rangedAgentManager

intraAgentManager

protected final SpeciesAgentManager intraAgentManager

allPotentials

protected IPotential[] allPotentials

boxAgentSource

protected BoxAgentManager.BoxAgentSource boxAgentSource

simulation

protected final ISimulation simulation

boxAgentManager

protected BoxAgentManager boxAgentManager
Constructor Detail

PotentialMasterNbr

protected PotentialMasterNbr(ISimulation sim,
                             BoxAgentManager.BoxAgentSource boxAgentSource,
                             BoxAgentManager boxAgentManager)
Method Detail

makePotentialGroup

public PotentialGroup makePotentialGroup(int nBody)
Description copied from interface: IPotentialMaster
Returns an nBody PotentialGroup appropriate for this type of PotentialMaster.

Specified by:
makePotentialGroup in interface IPotentialMaster
Overrides:
makePotentialGroup in class PotentialMaster

addPotential

public void addPotential(IPotentialMolecular potential,
                         ISpecies[] species)
Description copied from interface: IPotentialMaster
Indicates to the PotentialMaster that the given potential should apply to the specified species. Exception is thrown if the potential.nBody() value is different from the length of the species array. Thus, for example, if giving a 2-body potential, then the array should contain exactly two species; the species may refer to the same instance (appropriate for an intra-species potential, defining the iteractions between molecules of the same species).

Specified by:
addPotential in interface IPotentialMaster
Overrides:
addPotential in class PotentialMaster

potentialAddedNotify

public void potentialAddedNotify(IPotentialAtomic subPotential,
                                 PotentialGroup pGroup)
Description copied from interface: IPotentialMaster
Notifies the PotentialMaster that the sub-potential has been added to the given PotentialGroup, which is associated (but not necessarily held by) this PotentialMaster. This method is called by PotentialGroup and should not be called in other circumstances.

Specified by:
potentialAddedNotify in interface IPotentialMaster
Overrides:
potentialAddedNotify in class PotentialMaster

addRangedPotentialForTypes

protected abstract void addRangedPotentialForTypes(IPotentialAtomic subPotential,
                                                   IAtomType[] atomTypes)

addRangedPotential

protected void addRangedPotential(IPotentialAtomic potential,
                                  IAtomType atomType)

removePotential

public void removePotential(IPotentialAtomic potential)
Description copied from interface: IPotentialMaster
Removes given potential from the group. No error is generated if potential is not in group.

Specified by:
removePotential in interface IPotentialMaster
Overrides:
removePotential in class PotentialMaster

getRangedPotentials

public PotentialArray getRangedPotentials(IAtomType atomType)

getIntraPotentials

public PotentialArray getIntraPotentials(ISpecies atomType)

getCellAgentManager

public final BoxAgentManager getCellAgentManager()

getSpeciesAgentClass

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

Specified by:
getSpeciesAgentClass in interface AtomTypeAgentManager.AgentSource
Specified by:
getSpeciesAgentClass in interface SpeciesAgentManager.AgentSource

makeAgent

public Object makeAgent(IAtomType type)
Description copied from interface: AtomTypeAgentManager.AgentSource
Returns an agent for the given AtomType.

Specified by:
makeAgent in interface AtomTypeAgentManager.AgentSource

releaseAgent

public void releaseAgent(Object agent,
                         IAtomType type)
Description copied from interface: AtomTypeAgentManager.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 AtomTypeAgentManager.AgentSource

makeAgent

public Object makeAgent(ISpecies type)
Description copied from interface: SpeciesAgentManager.AgentSource
Returns an agent for the given AtomType.

Specified by:
makeAgent in interface SpeciesAgentManager.AgentSource

releaseAgent

public void releaseAgent(Object agent,
                         ISpecies type)
Description copied from interface: SpeciesAgentManager.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 SpeciesAgentManager.AgentSource

getSimulation

public ISimulation getSimulation()
Returns the simulation associated with this PotentialMaster