Bsoft 2.1.4
Bernard's software package
mol_bonds.h File Reference

Header for molecular dynamics. More...

#include "rwmd.h"
#include "rwmolecule.h"
#include "mol_util.h"
#include "utilities.h"

Functions

Bbondmd_generate_bond_list (Bmolgroup *molgroup, Bmd *md)
 Generates a distance-based bond list. More...
 
Bbondmd_generate_molecular_bond_list (Bmolgroup *molgroup, Bmd *md)
 Generates an intramolecular distance-based bond list. More...
 
Bbondmd_generate_bond_list_with_valence (Bmolgroup *molgroup, Bmd *md, int valence)
 Generates a bond list based on a single valence and the shortest current bond lengths. More...
 
double md_bond_list_set_parameters (Bbond *bondlist, Bbondtype *bondtype)
 Assigns covalent bond lengths to bonds. More...
 
int md_show_bonds (Bmolgroup *molgroup)
 Shows the bonds and bond lengths. More...
 
int md_show_bond_stats (Bmolgroup *molgroup)
 Shows the number of bonds and the valency per atom. More...
 
double md_find_bond_length (Batom *atom1, Batom *atom2, Bbondtype *bondtype)
 Finds the reference covalent bond length. More...
 
Bbondtypemd_find_bond_type (Batom *atom1, Batom *atom2, Bbondtype *bondtype)
 Finds the bond type. More...
 
int md_show_bond_types (Bmolgroup *molgroup, Bbondtype *bondtype)
 Shows the bond type composition. More...
 
double md_angle (Batom *atom1, Batom *atom2, Batom *atom3)
 Calculates the angle between three atoms. More...
 
double md_calculate_deviations (Bmolgroup *molgroup, int wrap)
 Calculates deviations from the reference bond lengths and angles. More...
 
int md_calculate_radial_deviation (Bmolgroup *molgroup)
 Calculates the radial deviations from the center of the box. More...
 

Detailed Description

Header for molecular dynamics.

Author
Bernard Heymann
Date
Created: 20010828
Modified: 20180228

Function Documentation

◆ md_angle()

double md_angle ( Batom atom1,
Batom atom2,
Batom atom3 
)

Calculates the angle between three atoms.

Parameters
*atom1first atom.
*atom2second atom.
*atom3third atom.
Returns
double angle.
The angle associated with the second atom and between the bonds linking
the first and third atoms is calculated.

◆ md_bond_list_set_parameters()

double md_bond_list_set_parameters ( Bbond bondlist,
Bbondtype bondtype 
)

Assigns covalent bond lengths to bonds.

Parameters
*bondlistlist of bonds.
*bondtypelist of bond types.
Returns
double fraction of bond types found.
The bond lengths are taken from a bond type list.

◆ md_calculate_deviations()

double md_calculate_deviations ( Bmolgroup molgroup,
int  wrap 
)

Calculates deviations from the reference bond lengths and angles.

Parameters
*molgroupmolecule group.
wrapflag to wrap around periodic boundaries.
Returns
double angle.

◆ md_calculate_radial_deviation()

int md_calculate_radial_deviation ( Bmolgroup molgroup)

Calculates the radial deviations from the center of the box.

Parameters
*molgroupmolecule group.
Returns
double angle.

◆ md_find_bond_length()

double md_find_bond_length ( Batom atom1,
Batom atom2,
Bbondtype bondtype 
)

Finds the reference covalent bond length.

Parameters
*atom1first atom.
*atom2second atom.
*bondtypebond type list.
Returns
double bond length.
The bond type is found in the bond type list, and the bond length is
set from the bond type structure.

◆ md_find_bond_type()

Bbondtype * md_find_bond_type ( Batom atom1,
Batom atom2,
Bbondtype bondtype 
)

Finds the bond type.

Parameters
*atom1first atom.
*atom2second atom.
*bondtypebond type list.
Returns
Bbondtype* bond type structure.
The bond type is found in the bond type list.

◆ md_generate_bond_list()

Bbond * md_generate_bond_list ( Bmolgroup molgroup,
Bmd md 
)

Generates a distance-based bond list.

Parameters
*molgroupmolecule group structure.
*mdglobal molecular dynamics structure.
Returns
Bbond* new bond list.
This function assumes very little and defines bonds purely on distance.
This means that the bond distances must already have been defined well.
The bond length is defined in the molecular dynamics structure.
If the molecule group already has a bond list, no new bonds are generated. 

◆ md_generate_bond_list_with_valence()

Bbond * md_generate_bond_list_with_valence ( Bmolgroup molgroup,
Bmd md,
int  valence 
)

Generates a bond list based on a single valence and the shortest current bond lengths.

Parameters
*molgroupmolecule group structure.
*mdglobal molecular dynamics structure.
valenceatom valence.
Returns
Bbond* new bond list.
This function attempts to assign bonds based on atomic valence by
finding the top number of shortests bonds. The current bond length is
encoded in the bond strength variable, k, in the bond structure.

◆ md_generate_molecular_bond_list()

Bbond * md_generate_molecular_bond_list ( Bmolgroup molgroup,
Bmd md 
)

Generates an intramolecular distance-based bond list.

Parameters
*molgroupmolecule group structure.
*mdglobal molecular dynamics structure.
Returns
Bbond* new bond list.
This function defines bonds on distance and within molecules.
This means that the bond distances must already have been defined well.
The bond length is defined in the molecular dynamics structure.
If the molecule group already has a bond list, no new bonds are generated. 

◆ md_show_bond_stats()

int md_show_bond_stats ( Bmolgroup molgroup)

Shows the number of bonds and the valency per atom.

Parameters
*molgroupmolecule group.
Returns
int number of bonds.
Uses the bond list defined for the molecule group.

◆ md_show_bond_types()

int md_show_bond_types ( Bmolgroup molgroup,
Bbondtype bondtype 
)

Shows the bond type composition.

Parameters
*molgroupmolecule group.
*bondtypebond type list.
Returns
int 0.
For each bond, the bond type is found in the bond type list.
The number variable for each bond type is used for counting.

◆ md_show_bonds()

int md_show_bonds ( Bmolgroup molgroup)

Shows the bonds and bond lengths.

Parameters
*molgroupmolecule group.
Returns
int number of bonds.
Uses the bond list defined for the molecule group.