API:IBox

From Wiketomica
Jump to: navigation, search
API Home Participants API Discussion Demos Downloads Documentation Contact Us Acknowledgements


IBox

Reason for existence

The IBox manages a set of IMolecules that interact with each other and also holds an IBoundary which defines boundary conditions.

Proposed Interface

interface IBox {

    /**
     * The index of the IBox (it's ordering within the IBoxes held by 
     * the ISimulation).  An IBox not held by an ISimulation will have
     * an index of 0.
     */
    attribute unsigned int index;

    void addMolecule(IMolecule molecule);

    void removeMolecule(IMolecule molecule);

    /**
     * Sets the number of IMolecules in the IBox for the given ISpecies.
     * IMolecules are either added or removed until the given number is
     * obtained.  Takes no action at all if the new number of molecules
     * equals the existing number.
     */
    void setNMolecules(in ISpecies species, in unsigned int numMolecules);

    /**
     * Returns the number of molecules in the IBox for the given ISpecies.
     */
    void getNMolecules(in ISpecies species);

    /**
     * Returns a list of the IMolecules of the given ISpecies in the IBox.
     * The index of each molecule corresponds to its position in this list.
     */
    IMoleculeList getMoleculeList(in ISpecies species);

    /**
     * A list of the IMolecules (of all the ISpecies) in the IBox.
     */
    readonly attribute IMoleculeList allMolecules;

    /**
     * A list of all atoms in the IBox.
     */
    readonly attribute IAtomList leafAtoms;

    /**
     * The IBox' IBoundary, which defines the boundary conditions
     * (periodicity, size, etc).
     */
    attribute IBoundary boundary;

    /**
     * The IBox' event manager, which fires events for changes in the 
     * IBox boundary, IAtoms being added or removed and IAtom index changes.
     */
    readonly attribute IBoxEventManager eventManager;

    /**
     * Notifies the IBox that the given species has been added to the
     * simulation.  This method should only be called by the simulation.
     */
    void addSpeciesNotify(in ISpecies species);

    /**
     * Notifies the IBox that a Species has been removed.  This method should
     * only be called by the simulation.  This triggers the removal of all
     * molecules of the given species from this box.
     */
    void removeSpeciesNotify(in ISpecies species);
}

Use

Notes

mol-sim-api discussion of IBox