| Bsoft 2.0.5 Bernard's software package

Functions
mol_bonds.h File Reference

Header for molecular dynamics. More...

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

Go to the source code of this file.

## Functions
Bbond * | md_generate_bond_list (Bmolgroup *molgroup, Bmd *md)
| Generates a distance-based bond list. More...
Bbond * | md_generate_molecular_bond_list (Bmolgroup *molgroup, Bmd *md)
| Generates an intramolecular distance-based bond list. More...
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. 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_angles (Bmolgroup *molgroup)
| Shows the angles and angular sizes. More...
int | md_show_bond_stats (Bmolgroup *molgroup)
| Shows the number of bonds and the valency per atom. More...
Bangle * | md_generate_angle_list (Bmolgroup *molgroup, Bmd *md)
| Generates an angle list. More...
int | md_angle_list_set_parameters (Bangle *anglelist, Bangletype *angletype)
| Assigns angles from angle types. More...
double | md_find_bond_length (Batom *atom1, Batom *atom2, Bbondtype *bondtype)
| Finds the reference covalent bond length. More...
Bbondtype * | md_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...
Bangletype * | md_find_angle_type (Batom *atom1, Batom *atom2, Batom *atom3, Bangletype *angletype)
| Finds the reference angle type between three atoms. More...
double | md_find_angle (Batom *atom1, Batom *atom2, Batom *atom3, Bangletype *angletype)
| Finds the reference 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

Definition in file mol_bonds.h.

## Function Documentation

## ◆ md_angle()

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

Calculates the angle between three atoms.

Parameters

  *atom1 | first atom.
  *atom2 | second atom.
  *atom3 | third atom.

Returns
  double angle.

      The angle associated with the second atom and between the bonds linking
      the first and third atoms is calculated.

Definition at line 637 of file mol_bonds.cpp.

## ◆ md_angle_list_set_parameters()

int md_angle_list_set_parameters | ( | Bangle * | anglelist,
|  | Bangletype * | angletype
| ) |  |

Assigns angles from angle types.

Parameters

  *anglelist | list of angles.
  *angletype | list of angle types.

Returns
  int 0.

      The angles are taken from an angle type list.

Definition at line 485 of file mol_bonds.cpp.

## ◆ md_bond_list_set_parameters()

double md_bond_list_set_parameters | ( | Bbond * | bondlist,
|  | Bbondtype * | bondtype
| ) |  |

Assigns covalent bond lengths to bonds.

Parameters

  *bondlist | list of bonds.
  *bondtype | list of bond types.

Returns
  double fraction of bond types found.

      The bond lengths are taken from a bond type list.

Definition at line 299 of file mol_bonds.cpp.

## ◆ md_calculate_deviations()

double md_calculate_deviations | ( | Bmolgroup * | molgroup,
|  | int | wrap
| ) |  |

Calculates deviations from the reference bond lengths and angles.

Parameters

  *molgroup | molecule group.
  wrap | flag to wrap around periodic boundaries.

Returns
  double angle.

Definition at line 742 of file mol_bonds.cpp.

## ◆ md_calculate_radial_deviation()

int md_calculate_radial_deviation | ( | Bmolgroup * | molgroup | ) |

Calculates the radial deviations from the center of the box.

Parameters

  *molgroup | molecule group.

Returns
  double angle.

Definition at line 809 of file mol_bonds.cpp.

## ◆ md_find_angle()

double md_find_angle | ( | Batom * | atom1,
|  | Batom * | atom2,
|  | Batom * | atom3,
|  | Bangletype * | angletype
| ) |  |

Finds the reference angle between three atoms.

Parameters

  *atom1 | first atom.
  *atom2 | second atom.
  *atom3 | third atom.
  *angletype | angle type list.

Returns
  double angle.

      The angle type is found in the angle type list, and the angle is
      set from the angle type structure.

Definition at line 719 of file mol_bonds.cpp.

## ◆ md_find_angle_type()

Bangletype* md_find_angle_type | ( | Batom * | atom1,
|  | Batom * | atom2,
|  | Batom * | atom3,
|  | Bangletype * | angletype
| ) |  |

Finds the reference angle type between three atoms.

    The angle type is found in the angle type list, and the angle type is
    returned.

Parameters

  *atom1 | first atom.
  *atom2 | second atom.
  *atom3 | third atom.
  *angletype | angle type list.

Returns
  Bangletype* angle type.

Definition at line 663 of file mol_bonds.cpp.

## ◆ md_find_bond_length()

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

Finds the reference covalent bond length.

Parameters

  *atom1 | first atom.
  *atom2 | second atom.
  *bondtype | bond 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.

Definition at line 510 of file mol_bonds.cpp.

## ◆ md_find_bond_type()

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

Finds the bond type.

Parameters

  *atom1 | first atom.
  *atom2 | second atom.
  *bondtype | bond type list.

Returns
  Bbondtype* bond type structure.

      The bond type is found in the bond type list.

Definition at line 542 of file mol_bonds.cpp.

## ◆ md_generate_angle_list()

Bangle* md_generate_angle_list | ( | Bmolgroup * | molgroup,
|  | Bmd * | md
| ) |  |

Generates an angle list.

Parameters

  *molgroup | molecule group structure.
  *md | global molecular dynamics structure (can be NULL).

Returns
  Bangle* new angle list.

      This function uses the bond list for the molecule group to find bonds
      to the same atom and set an angle structure with the corresponding angle.
      The angle is defined in the molecular dynamics structure.

Definition at line 415 of file mol_bonds.cpp.

## ◆ md_generate_bond_list()

Bbond* md_generate_bond_list | ( | Bmolgroup * | molgroup,
|  | Bmd * | md
| ) |  |

Generates a distance-based bond list.

Parameters

  *molgroup | molecule group structure.
  *md | global 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.

Definition at line 30 of file mol_bonds.cpp.

## ◆ 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

  *molgroup | molecule group structure.
  *md | global molecular dynamics structure.
  valence | atom 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.

Definition at line 208 of file mol_bonds.cpp.

## ◆ md_generate_molecular_bond_list()

Bbond* md_generate_molecular_bond_list | ( | Bmolgroup * | molgroup,
|  | Bmd * | md
| ) |  |

Generates an intramolecular distance-based bond list.

Parameters

  *molgroup | molecule group structure.
  *md | global 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.

Definition at line 105 of file mol_bonds.cpp.

## ◆ md_show_angles()

int md_show_angles | ( | Bmolgroup * | molgroup | ) |

Shows the angles and angular sizes.

Parameters

  *molgroup | molecule group.

Returns
  int number of angles.

      Uses the angle list defined for the molecule group.

Definition at line 350 of file mol_bonds.cpp.

## ◆ md_show_bond_stats()

int md_show_bond_stats | ( | Bmolgroup * | molgroup | ) |

Shows the number of bonds and the valency per atom.

Parameters

  *molgroup | molecule group.

Returns
  int number of bonds.

      Uses the bond list defined for the molecule group.

Definition at line 371 of file mol_bonds.cpp.

## ◆ md_show_bond_types()

int md_show_bond_types | ( | Bmolgroup * | molgroup,
|  | Bbondtype * | bondtype
| ) |  |

Shows the bond type composition.

Parameters

  *molgroup | molecule group.
  *bondtype | bond 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.

Definition at line 580 of file mol_bonds.cpp.

## ◆ md_show_bonds()

int md_show_bonds | ( | Bmolgroup * | molgroup | ) |

Shows the bonds and bond lengths.

Parameters

  *molgroup | molecule group.

Returns
  int number of bonds.

      Uses the bond list defined for the molecule group.

Definition at line 329 of file mol_bonds.cpp.