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

#import <AdunForceFieldCollection.h>

List of all members.

Public Member Functions

(id) - init
(id) - initWithForceFields:
(void) - addForceField:
(void) - removeForceField:
(NSArray *) - forceFields
(void) - setForceFields:
(void) - evaluateForces
(void) - evaluateEnergies
(NSArray *) - forceFieldsForSystem:activityFlag:
(NSArray *) - forceFieldsForSystem:
(NSArray *) - forceFieldsForSystems:
(NSArray *) - systems
(void) - activateForceField:
(void) - deactivateForceField:
(BOOL) - isActive:
(BOOL) - isMember:

Static Public Member Functions

(id) + completeCollectionForSystems:

Detailed Description

AdForceFieldCollection objects represent the combined force field due to a number of AdForceField instances. Each AdForceField instance embodies a function $U = f(\vec r)$ where $\vec r$ is the configuration of the elements of an AdSystem or AdInteractionSystem object. Hence AdForceFieldCollection represents the force field

\[ U(\vec r_{1}, ..., \vec r_{n}) = f(\vec r_{1})+, ..., + f(\vec r_{n}) \]

Note that there can be more than one force field operating on the same system.

Force Field Status

The force field represented by an AdForceFieldCollection object can be customised by activating/deactivating the various constituent AdForceField objects.

Todo:
Extra Functionality - Implement some useful NSSet/NSMutableSet like methods.

Member Function Documentation

- (void) activateForceField: (AdForceField*)  aForceField

Activates a deactivated force field. If aForceField is already active this method does nothing. If it is not part of the collection an NSInvalidArgumentException is raised.

- (void) addForceField: (AdForceField*)  aForceField

Adds aForceField to the collection. It is active by default.

+ (id) completeCollectionForSystems: (AdSystemCollection*)  systems

Returns a AdForceFieldCollection instance containing force-fields for all systems in systems. The force-fields are generated using AdMolecularMechanicsForceField::forceFieldsForSystem:() AdNonbondedTerm instances are also created for each force-field. The nonbonded term subclass used is obtained from the default "DefaultNonbondedTerm". The default value for this is AdPureNonbondedTerm. Therefore you can change the nonbonded term used by calling

[[NSUserDefaults standardUserDefaults] 
        setObject: NSStringFromClass(nbClass) 
        forKey: @"DefaultNonbondedTerm"]

before this method

- (void) deactivateForceField: (AdForceField*)  aForceField

Deactivates a active force field. If aForceField is already deactivated this method does nothing. If it is not part of the collection an NSInvalidArgumentException is raised.

- (void) evaluateEnergies

Calls evaluateEnergies (AdForceField) on each active memeber.

- (void) evaluateForces

Evaluates the combined forces due to active members by calling evaluateForces (AdForceField) on each.

- (NSArray*) forceFields

Returns an array containing all the AdForceField objects in the collection.

- (NSArray *) forceFieldsForSystem: (id)  aSystem

As forceFieldsForSystem:activityFlag: passing AdAllForceFields for value

- (NSArray *) forceFieldsForSystem: (id)  aSystem
activityFlag: (AdForceFieldActivity value 
Returns:
An NSArray containing the AdForceField objects that operate on aSystem. If none of the contained objects operate on aSystem the array will be empty.
Parameters:
aSystemAn AdSystem instance
activityFlagIndicates which force fields to include. The valid values are defined by the AdForceFieldActivity enum.
- (NSArray *) forceFieldsForSystems: (NSArray*)  systemArray

Returns an array containing the results of calling forceFieldsForSystem: on each system in systemArray.

- (id) init

As initWithForceFields: passing an empty array.

- (id) initWithForceFields: (NSArray*)  anArray

Designated intialiser. Creates and returns an AdForceFieldCollection instance containing the AdForceField objects in anArray.

Parameters:
anArrayAn array of AdForceField objects. If any of the objects in anArray is not a member of the AdForceField class (or a subclass) an NSInvalidArgumentException is raised. All force fields are active by default.
- (BOOL) isActive: (AdForceField*)  aForceField

Returns YES if aForceField is active. NO otherwise. Raises an NSInvalidArgumentException if aForceField is not part of the collection.

- (BOOL) isMember: (AdForceField*)  aForceField

Returns YES if aForceField is a member of the collection. NO otherwise.

- (void) removeForceField: (AdForceField*)  aForceField

Removes aForceField from the collection

- (void) setForceFields: (NSArray*)  anArray

Sets the force fields in the collection to those in anArray. This has the effect of removing any previous force fields from the collection. All the new force fields are active by default.

- (NSArray*) systems

Returns the systems operated on by the contained AdForceField objects.