Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

MolmecSupport Namespace Reference
[General Force Field Classes.]

MolmecSupport. More...


Enums

enum  PairListAlgorithmType { HASH_GRID, BRUTE_FORCE }
 The type of algorithm used to calculate the pair list. More...

Functions

BALL_EXPORT Size calculateNonBondedAtomPairs (ForceField::PairVector &pair_vector, const AtomVector &atom_vector, const SimpleBox3 &box, double distance, bool periodic_boundary_enabled, PairListAlgorithmType type) throw (Exception::OutOfMemory)
 Create a pair vector for non-bonded interactions.
BALL_EXPORT Size sortNonBondedAtomPairsAfterSelection (ForceField::PairVector &pair_vector)
 Sort the pair list.
BALL_EXPORT Size addNonOverlappingMolecules (System &system, const HashGrid3< const Atom * > &solute_grid, const System &solvent, const SimpleBox3 &box, double distance)
 Merge the non-overlapping molecules of a system into another system.
BALL_EXPORT void adaptWaterBox (System &system, const SimpleBox3 &box)
 Adapt periodic water (or general solvent) boxes to our periodic boundary definition.
BALL_EXPORT void calculateMinimumImage (Vector3 &distance, const Vector3 &period)
 Compute the minimum image.
template<typename TorsionType, typename AtomIteratorType>
Size computeTorsions (const AtomIteratorType &start, const AtomIteratorType &end, std::vector< TorsionType > &torsions, bool use_selection=false)
 Compute all torsions in a given set of molecules.


Detailed Description

MolmecSupport.


Enumeration Type Documentation

enum PairListAlgorithmType
 

The type of algorithm used to calculate the pair list.

Enumeration values:
HASH_GRID  use a hash grid
BRUTE_FORCE  brute force all against all


Function Documentation

BALL_EXPORT void adaptWaterBox System &  system,
const SimpleBox3 box
 

Adapt periodic water (or general solvent) boxes to our periodic boundary definition.

Periodic water boxes created by different programs might contain molecules which have their center of gravity outside of the box because of a different defintion of the periodic boundary. This function adapts such boxes to our definition by simply translating such molecules to the opposite boundary wall such that their center of gravity lies in the box afterwards.

This might be obsoleted by PeriodicBoundarry::updateMolecules()
Parameters:
system the system containing the water box which is to be adapted
box the box definition for the periodic boundary

BALL_EXPORT Size addNonOverlappingMolecules System &  system,
const HashGrid3< const Atom * > &  solute_grid,
const System &  solvent,
const SimpleBox3 box,
double  distance
 

Merge the non-overlapping molecules of a system into another system.

Fills system with copies of the solvent molecules stored in solvent. Solvent molecules are added to system if the molecules lie in the box and if they do not overlap with the molecules in solute_grid. A molecule has an overlap with another molecule if any atom of the first molecule is within distance of any atom of the other molecule.

Parameters:
system the system to be filled
solute_grid a hash grid containing the solute molecules
solvent the system containing the solvent
box the periodic boundary of system
distance used to determine overlaps between two atoms
Returns:
the number of molecules added to system

BALL_EXPORT Size calculateNonBondedAtomPairs ForceField::PairVector &  pair_vector,
const AtomVector &  atom_vector,
const SimpleBox3 box,
double  distance,
bool  periodic_boundary_enabled,
PairListAlgorithmType  type
throw (Exception::OutOfMemory)
 

Create a pair vector for non-bonded interactions.

Calculates a vector of atom pairs whose distance is smaller than distance. The type determines if a brute force algorithm (type == BRUTE_FORCE) or a more sophisticated grid method (type == HASH_GRID) is used.

Parameters:
pair_vector the vector containing pairs of interacting atoms
atom_vector the atoms to be considered for pairs
box the periodic boundary used (if periodic_boundary_enabled == true)
distance the maximum distance (cut-off distance) for two atoms
periodic_boundary_enabled flag indicating the use of periodic boundary conditions
type the type of algorithm used to calculate the pair vector
Returns:
the number of pairs generated (pair_vector.size())

template<typename TorsionType, typename AtomIteratorType>
Size MolmecSupport::computeTorsions const AtomIteratorType &  start,
const AtomIteratorType &  end,
std::vector< TorsionType > &  torsions,
bool  use_selection = false
 

Compute all torsions in a given set of molecules.

Returns:
the number of torsions added to torsions
Parameters:
start an iterator pointing to the start of the atoms
end a past-the-end iterator for the atoms
torsions the vector of torsions
use_selection if set to true, a torsion will be added only if all four atoms are selected

BALL_EXPORT Size sortNonBondedAtomPairsAfterSelection ForceField::PairVector &  pair_vector  ) 
 

Sort the pair list.

The atom pairs in the list ar sorted in such a way, that those atom pairs where at least one of the atoms is selected are at the beginning of the list. The number of such pairs is returned. Running time is linear in the length of the list.

Returns:
number of atom pairs in the list, where at least one atom is selected
Parameters:
pair_vector the unsorted pair_list (modified during the sorting)