Adun  0.83
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
AdContainerDataSource Class Reference

#import <AdunContainerDataSource.h>

Inheritance diagram for AdContainerDataSource:
Inheritance graph
[legend]
Collaboration diagram for AdContainerDataSource:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithDataSource:cavity:density:seed:containedSystems:
(id) - initWithDataSource:cavity:density:seed:
(id) - initWithDictionary:
(id) - valueForMetadataKey:
(void) - setElementConfiguration:
(id) - cavity
(double) - density
(int) - atomsPerMolecule
(NSString *) - name
(int) - setExclusionArea:
(int) - insertSystem:
(int) - removeSystem:
(MTStructure *) - pdbStructure
(MTStructure *) - pdbStructureWithCoordinates:
- Public Member Functions inherited from
(NSString *) - systemName
(unsigned int) - numberOfElements
(AdDataMatrix *) - elementProperties
(NSIndexSet *) - indexesOfElementsWithValues:forProperty:
(AdDataMatrix *) - elementConfiguration
(AdDataMatrix *) - groupProperties
(AdDataMatrix *) - groupsForInteraction:containingElements:
(NSArray *) - availableInteractions
(AdDataMatrix *) - groupsForInteraction:
(id) - constraintForInteraction:
(AdDataMatrix *) - parametersForInteraction:
(NSArray *) - interactionsForCategory:
(NSString *) - categoryForInteraction:
(NSArray *) - indexSetArrayForCategory:

Detailed Description

AdContainerDataSource creates and manages a collection of structures of a given type in a given volume (container). The structure's topology is defined by an object which conforms to the AdSystemDataSource protocol. The size and shape of the volume is defined by a cavity object which must conform to AdGridDelegate. The number of structures to be placed in the volume is calculated from the density parameter. The units of the density parameter are defined by the mass and distance units used by the data source.

Once the number of structures is known AdContainerDataSource replecates the information in the data source that many times and uses grid points created by an AdGrid object as initial positions for the structures. The structures are randomly oriented when first placed.

AdContainerDataSource also provides methods that allow you to define exclusion areas within the volume updating the molecule contents as appropriate - see the AdContainerDataSourceInsertionExtensions category.

Todo:

Missing Functionality - Does not calculate the grid spacing correctly

Missing Functionality - Handling of cavity expansion and contraction

Missing Functionality - Information on inserted systems not encoded.

Internal - Remove use of "solvent" prefix from ivars.

Affected by Task - Units


Member Function Documentation

- (int) atomsPerMolecule

Returns the number of elements in the AdContainerDataSource objects data source.

Todo:
Deprecate.
- (id) cavity

Returns the container cavity.

- (double) density

Returns the density of elements in the cavity.

- (id) initWithDataSource: (id)  source
cavity: (id)  cavity
density: (double)  density
seed: (int)  anInt 

As initWithDataSource:cavity:density:seed:containedSystems: passing nil for anArray.

- (id) initWithDataSource: (id)  source
cavity: (id)  cavity
density: (double)  density
seed: (int)  anInt
containedSystems: (NSArray*)  anArray 

Designated initialiser.

Parameters:
sourceA object which provides the structure that will be replicated throughout the cavity. Must conform to both the AdSystemDataSource and NSCopying protocols. Cannot be nil.
cavityAn object that implements the AdGridDelegate protocol. If it doesnt an NSInvalidArgumentException is raised.
densityThe density of the resulting cavity. The units of density are defined by the units used in the data source for distance and mass.
anIntSeed for random number generation.
AnNSArray containing AdSystem objects that will be inserted into the container.
- (id) initWithDictionary: (NSDictionary*)  dict

Returns a new AdContainerDataSource instance initialised with the values from dict. The keys of aDict are defined by the names of each of the arguments in the designated initialiser i.e. dataSource, cavity, density, seed & containedSystems. If a key is not present nil is passed for the corresponding argument in the designated initialiser.

- (int) insertSystem: (AdSystem *)  system

Inserts system into the volume defined by the AdContainerDataSource instance. Molecules lying within the Van der Waals radius of any of the systems elements are removed. The properties of the system elements must include either type A or B Lennard Jones parameters.

Returns:
The number of molecule removed
- (NSString *) name

Returns the name of the data source

- (MTStructure*) pdbStructure

Returns an MTStructure object representing the receiver

- (MTStructure*) pdbStructureWithCoordinates: (AdDataMatrix *)  aMatrix

Returns an MTStructure object representing the receiver but using the coordinates defined by aMatrix instead of those defined by elementConfiguration (AdSystemDataSource-p).

- (int) removeSystem: (AdSystem *)  system

Removes the previously inserted system system. AdContainerDataSource identifies the system by its name. The volume occupied by the system is calculated and AdContainerDataSource attempts to insert the same number of molecules as were removed into the volume (though this may not always be possible).

Returns:
The number of molecules reinserted.
- (void) setElementConfiguration: (AdDataMatrix*)  configuration

Changes the configuration of the elements to the coordinates in aMatrix. aMatrix must have one entry for each atom. Usually used by AdSystem to synch the data source configuration with its current configuration. When performing insertion/removal you must make sure that the configuration in the data source is correct.

- (int) setExclusionArea: (id)  cavity

Removes container structures that lie inside the volume defined by cavity. They cannot be reinserted. If any part of a structure resides in the cavity then the whole structure is removed.

Returns:
The number of molecules removed.
- (id) valueForMetadataKey: (NSString*)  key

Current AdContainerDataSource objects have two keys, name and forceField. Both are the same as for the receivers dataSource.