etomica.api
Interface IPotentialMaster

All Known Implementing Classes:
PotentialMaster, PotentialMasterCell, PotentialMasterHybrid, PotentialMasterList, PotentialMasterMonatomic, PotentialMasterNbr, PotentialMasterSite

public interface IPotentialMaster


Method Summary
 void addModel(Model newModel)
          Add the given Model's intramolecular potentials to this PotentialMaster
 void addPotential(IPotentialAtomic potential, IAtomType[] atomTypes)
          Indicates to the PotentialMaster that the given potential should apply to the specified atom types.
 void addPotential(IPotentialMolecular potential, ISpecies[] species)
          Indicates to the PotentialMaster that the given potential should apply to the specified species.
 void calculate(IBox box, IteratorDirective id, PotentialCalculation pc)
          Performs the given PotentialCalculation on the atoms of the given Box.
 PotentialGroup getPotential(ISpecies[] types)
          Returns the potential that applies to the specified types, or null of no existing potential applies.
 IPotentialMolecular[] getPotentials()
          Returns an array containing all molecular Potentials.
 boolean isEnabled()
           
 boolean isEnabled(IPotentialAtomic potential)
          Returns true if the potential is in this group and has not been disabled via a previous call to setEnabled; returns false otherwise.
 boolean isEnabled(IPotentialMolecular potential)
          Returns true if the potential is in this group and has not been disabled via a previous call to setEnabled; returns false otherwise.
 PotentialMasterLrc lrcMaster()
          Returns the object that oversees the long-range correction zero-body potentials.
 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 removePotential(IPotentialAtomic potential)
          Removes given potential from the group.
 void removePotential(IPotentialMolecular potential)
          Removes given potential from the group.
 void setEnabled(boolean enabled)
          Permits enabling/disabling of all potentials.
 void setEnabled(IPotentialAtomic potential, boolean enabled)
          Indicates that the specified potential should not contribute to potential calculations.
 void setEnabled(IPotentialMolecular potential, boolean enabled)
          Indicates that the specified potential should not contribute to potential calculations.
 

Method Detail

lrcMaster

PotentialMasterLrc lrcMaster()
Returns the object that oversees the long-range correction zero-body potentials.


makePotentialGroup

PotentialGroup makePotentialGroup(int nBody)
Returns an nBody PotentialGroup appropriate for this type of PotentialMaster.


calculate

void calculate(IBox box,
               IteratorDirective id,
               PotentialCalculation pc)
Performs the given PotentialCalculation on the atoms of the given Box. Sets the box for all molecule iterators and potentials, sets target and direction for iterators as specified by given IteratorDirective, and applies doCalculation of given PotentialCalculation with the iterators and potentials.


addModel

void addModel(Model newModel)
Add the given Model's intramolecular potentials to this PotentialMaster


addPotential

void addPotential(IPotentialMolecular potential,
                  ISpecies[] species)
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).


addPotential

void addPotential(IPotentialAtomic potential,
                  IAtomType[] atomTypes)
Indicates to the PotentialMaster that the given potential should apply to the specified atom types. The potential is assumed to be intermolecular. The given types should not include any type which is the descendent of another. Potential group hierarchy will be constructed as needed above the level of the given atom types.

The order of the elements in the atomTypes array is not relevant, and is subject to rearrangement by the method -- the array is sorted (using the compareTo method of AtomType) before doing anything else.


potentialAddedNotify

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. This method is called by PotentialGroup and should not be called in other circumstances.


getPotential

PotentialGroup getPotential(ISpecies[] types)
Returns the potential that applies to the specified types, or null of no existing potential applies.


removePotential

void removePotential(IPotentialMolecular potential)
Removes given potential from the group. No error is generated if potential is not in group.


removePotential

void removePotential(IPotentialAtomic potential)
Removes given potential from the group. No error is generated if potential is not in group.


isEnabled

boolean isEnabled()
Returns:
Returns enabled flag.

setEnabled

void setEnabled(boolean enabled)
Permits enabling/disabling of all potentials. Default is enabled (true).

Parameters:
enabled - flags if potentials are enabled.

setEnabled

void setEnabled(IPotentialMolecular potential,
                boolean enabled)
Indicates that the specified potential should not contribute to potential calculations. If potential is not in this group, no action is taken.


isEnabled

boolean isEnabled(IPotentialMolecular potential)
Returns true if the potential is in this group and has not been disabled via a previous call to setEnabled; returns false otherwise.


setEnabled

void setEnabled(IPotentialAtomic potential,
                boolean enabled)
Indicates that the specified potential should not contribute to potential calculations. If potential is not in this group, no action is taken.


isEnabled

boolean isEnabled(IPotentialAtomic potential)
Returns true if the potential is in this group and has not been disabled via a previous call to setEnabled; returns false otherwise.


getPotentials

IPotentialMolecular[] getPotentials()
Returns an array containing all molecular Potentials.