Main Page | Class List | File List | Class Members | File Members

fselect.h File Reference

Force atom and bond selection. More...

#include "mdapi/mdtypes.h"
#include "force/fparam.h"

Go to the source code of this file.

Classes

struct  ForceSelect_t
 Atom and bond selection object. More...

Typedefs

typedef ForceSelect_t ForceSelect
 Atom and bond selection object.

Enumerations

enum  ForceSelectFlags_t {
  FORCE_SELECT_ALL = -1, FORCE_SELECT_NONE = 0, FORCE_SELECT_BOND = 0x001, FORCE_SELECT_ANGLE = 0x002,
  FORCE_SELECT_DIHED = 0x004, FORCE_SELECT_IMPR = 0x008, FORCE_SELECT_ASET = 0x010, FORCE_SELECT_BSET = 0x020,
  FORCE_SELECT_BRES = 0x040, FORCE_SELECT_MASK = 0x07f
}

Functions

ForceSelectforce_select_create (ForceParam *fprm, int32 *bond_sel, int32 bond_sel_len, int32 *angle_sel, int32 angle_sel_len, int32 *dihed_sel, int32 dihed_sel_len, int32 *impr_sel, int32 impr_sel_len, int32 *aset_sel, int32 aset_sel_len, int32 *bset_sel, int32 bset_sel_len, int32 *bres_sel, int32 bres_sel_len)
 Constructor.
void force_select_destroy (ForceSelect *)
 Destructor.
int force_select_initialize (ForceSelect *, ForceParam *fprm, int32 *bond_sel, int32 bond_sel_len, int32 *angle_sel, int32 angle_sel_len, int32 *dihed_sel, int32 dihed_sel_len, int32 *impr_sel, int32 impr_sel_len, int32 *aset_sel, int32 aset_sel_len, int32 *bset_sel, int32 bset_sel_len, int32 *bres_sel, int32 bres_sel_len)
 Alternative constructor.
void force_select_cleanup (ForceSelect *)
 Alternative destructor.
void force_select_reset_force (MD_Dvec f[], const int32 sel[], int32 len)
 Reset selected components of a force array (type MD_Dvec).
void force_select_reset_potential (double e[], const int32 sel[], int32 len)
 Reset selected components of a potential array (type double).


Detailed Description

Force atom and bond selection.

Author:
David J. Hardy
Date:
2005-2006
The ForceSelect_t class selects which atom and bond terms to compute during force evaluation. Use of this class is optional. The default selection (i.e. this class is not used) is all atoms and bonds evaluated for force computation, as designated by the ForceParam_t flags.

Typedef Documentation

typedef struct ForceSelect_t ForceSelect
 

Atom and bond selection object.

The bonded interaction arrays are given per bond, not per atom. The aset_sel and bset_sel arrays are either both empty (meaning pairwise interactions are computed normally) or they must both be nonempty disjoint subsets of the total atoms.


Enumeration Type Documentation

enum ForceSelectFlags_t
 

Enumeration values:
FORCE_SELECT_ALL  Length value to use with NULL to generate array containing all.
FORCE_SELECT_NONE  Length value to use with NULL to select zero.
FORCE_SELECT_BOND  (internal use) Self-allocated ForceSelect::bond_sel.
FORCE_SELECT_ANGLE  (internal use) Self-allocated ForceSelect::angle_sel.
FORCE_SELECT_DIHED  (internal use) Self-allocated ForceSelect::dihed_sel.
FORCE_SELECT_IMPR  (internal use) Self-allocated ForceSelect::impr_sel.
FORCE_SELECT_ASET  (internal use) Self-allocated ForceSelect::aset_sel.
FORCE_SELECT_BSET  (internal use) Self-allocated ForceSelect::bset_sel.
FORCE_SELECT_BRES  (internal use) Self-allocated ForceSelect::bres_sel.
FORCE_SELECT_MASK  (internal use) Mask for allocation flags.


Function Documentation

void force_select_cleanup ForceSelect  ) 
 

Alternative destructor.

Use this to destroy a preallocated ForceSelect_t object. Frees any self-allocated arrays and resets the object memory.

ForceSelect* force_select_create ForceParam fprm,
int32 *  bond_sel,
int32  bond_sel_len,
int32 *  angle_sel,
int32  angle_sel_len,
int32 *  dihed_sel,
int32  dihed_sel_len,
int32 *  impr_sel,
int32  impr_sel_len,
int32 *  aset_sel,
int32  aset_sel_len,
int32 *  bset_sel,
int32  bset_sel_len,
int32 *  bres_sel,
int32  bres_sel_len
 

Constructor.

Parameters:
[in] fprm ForceParam_t object used for configuration.
[in] bond_sel Selects terms for spring bonds.
[in] bond_sel_len Length of bond_sel array.
[in] angle_sel Selects terms for angles.
[in] angle_sel_len Length of angle_sel array.
[in] dihed_sel Selects terms for dihedrals.
[in] dihed_sel_len Length of dihed_sel array.
[in] impr_sel Selects terms for impropers.
[in] impr_sel_len Length of impr_sel array.
[in] aset_sel Selects subset A of atoms for pairwise interactions.
[in] aset_sel_len Length of aset_sel array.
[in] bset_sel Selects subset B of atoms for pairwise interactions.
[in] bset_sel_len Length of bset_sel array.
[in] bres_sel Selects atoms for boundary restraints.
[in] bres_sel_len Length of bres_sel array.
Creates dynamically allocated ForceSelect_t object used to select atom and bond terms for computation. Each integer array provides a set of indices into a corresponding array of bonds for bonded interactions or of atoms for pairwise interactions and boundary restraints. These arrays must persist until the ForceSelect_t object is destroyed. Choose the entire set of indices by passing NULL with FORCE_SELECT_ALL for array and length, respectively, or choose no indices by passing NULL with FORCE_SELECT_NONE.

The atom selection for pairwise interactions allows the computation of forces and potentials between two nonempty, disjoint subsets of atoms. This computes the forces and potentials of a subset A of atoms acting on a subset B of atoms (and vice versa). This computation is enabled by passing the first set of atom selection indices as aset_sel with length aset_sel_len and the second as bset_sel with length bset_sel_len. Either subset of atoms selection indices can be given by NULL with length FORCE_SELECT_ALL to select all remaining atoms, but the other subset must be explicitly designated. The particular pairwise potentials employed and the method of computation is determined by setting FORCE_ELEC and/or FORCE_VDW flags for ForceParam_t::forcetypes along with their respective options given by ForceParam_t::elecopts and ForceParam_t::vdwopts. Normal computation of pairwise interactions is accomplished by setting both subsets of atom indices to NULL and FORCE_SELECT_NONE.

The determination of which force and energy terms are computed is specified by ForceParam_t::forcetypes. Separate storage of the different types of forces and potentials is specified by the ForceResult object.

Returns:
Pointer to ForceSelect_t object or NULL if memory allocation fails or if arguments are inconsistent.

void force_select_destroy ForceSelect  ) 
 

Destructor.

Clears memory and destroys the dynamically allocated ForceSelect_t object. Call when finished using the object.

int force_select_initialize ForceSelect ,
ForceParam fprm,
int32 *  bond_sel,
int32  bond_sel_len,
int32 *  angle_sel,
int32  angle_sel_len,
int32 *  dihed_sel,
int32  dihed_sel_len,
int32 *  impr_sel,
int32  impr_sel_len,
int32 *  aset_sel,
int32  aset_sel_len,
int32 *  bset_sel,
int32  bset_sel_len,
int32 *  bres_sel,
int32  bres_sel_len
 

Alternative constructor.

Use this to construct a preallocated ForceSelect_t object. Establishes user-provided arrays and allocates other arrays as needed. Same notes apply as for force_select_create().

Returns:
0 for success or FORCE_FAIL on failure.


Generated on Thu Feb 7 18:11:41 2008 for MDX by  doxygen 1.3.9.1