BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
BALL::MolmecSupport Namespace Reference

Enumerations

Enums
enum  PairListAlgorithmType { HASH_GRID, BRUTE_FORCE }
 

Functions

BALL_EXPORT BALL::Size calculateNonBondedAtomPairs (ForceField::PairVector &pair_vector, const AtomVector &atom_vector, const SimpleBox3 &box, double distance, bool periodic_boundary_enabled, PairListAlgorithmType type) throw (Exception::OutOfMemory)
 
BALL_EXPORT Size sortNonBondedAtomPairsAfterSelection (ForceField::PairVector &pair_vector)
 
BALL_EXPORT BALL::Size addNonOverlappingMolecules (System &system, const HashGrid3< const Atom * > &solute_grid, const System &solvent, const SimpleBox3 &box, double distance)
 
BALL_EXPORT void adaptWaterBox (System &system, const SimpleBox3 &box)
 
BALL_EXPORT void calculateMinimumImage (Vector3 &distance, const Vector3 &period)
 
template<typename TorsionType , typename AtomIteratorType >
Size computeTorsions (const AtomIteratorType &start, const AtomIteratorType &end, std::vector< TorsionType > &torsions, bool use_selection=false)
 

Detailed Description

MolmecSupport

Enumeration Type Documentation

The type of algorithm used to calculate the pair list.

Enumerator
HASH_GRID 

use a hash grid

BRUTE_FORCE 

brute force all against all

Definition at line 60 of file support.h.

Function Documentation

BALL_EXPORT void BALL::MolmecSupport::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
systemthe system containing the water box which is to be adapted
boxthe box definition for the periodic boundary
BALL_EXPORT BALL::Size BALL::MolmecSupport::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
systemthe system to be filled
solute_grida hash grid containing the solute molecules
solventthe system containing the solvent
boxthe periodic boundary of system
distanceused to determine overlaps between two atoms
Returns
the number of molecules added to system
BALL_EXPORT void BALL::MolmecSupport::calculateMinimumImage ( Vector3 &  distance,
const Vector3 &  period 
)

Compute the minimum image

BALL_EXPORT BALL::Size BALL::MolmecSupport::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_vectorthe vector containing pairs of interacting atoms
atom_vectorthe atoms to be considered for pairs
boxthe periodic boundary used (if periodic_boundary_enabled == true)
distancethe maximum distance (cut-off distance) for two atoms
periodic_boundary_enabledflag indicating the use of periodic boundary conditions
typethe type of algorithm used to calculate the pair vector
Returns
the number of pairs generated (pair_vector.size())
template<typename TorsionType , typename AtomIteratorType >
Size BALL::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
startan iterator pointing to the start of the atoms
enda past-the-end iterator for the atoms
torsionsthe vector of torsions
use_selectionif set to true, a torsion will be added only if all four atoms are selected

Definition at line 154 of file support.h.

BALL_EXPORT Size BALL::MolmecSupport::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_vectorthe unsorted pair_list (modified during the sorting)