Loading...
Searching...
No Matches
OBGastChrg Class Reference

`#include <openbabel/molchrg.h>`

## Public Member Functions

| OBGastChrg ()
| ~OBGastChrg ()
bool | AssignPartialCharges (OBMol &)
void | GSVResize (int)

## Detailed Description

Assigns Gasteiger partial charges.

The OBGastChrg class is responsible for the assignment of partial charges to a molecule according to the Gasteiger charge model (sigma). When the partial charge of an atom is requested and partial charges do not yet exist for the molecule the OBGastChrg class will automatically be called to assign charges for the molecule. If charges have been read in for a molecule the following code shows how to force the recalculation of partial charges:

OBMol mol;
mol.UnsetPartialChargesPerceived();
FOR_ATOMS_IN_MOL(atom, mol)
{
cout << "atom number = " << atom->GetIdx();
cout << " charge = " << atom->GetPartialCharge() << endl;
}
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121

Formal charges are used as seed values of the initial charge of atoms, and the partial charge is propagated to neighboring atoms. For example, quaternary amines would have a +1 charge, and the effect of the positive charge would be felt by neighboring atoms according to the Gasteiger model (sigma).

For more information, see: J. Gasteiger & M. Marsili, "A New Model for Calculating Atomic Charges in Molecules" Tetrahedron Lett., (1978) 3181-3184.

## Constructor & Destructor Documentation

## OBGastChrg()

OBGastChrg | ( |  | ) |

inline

## ~OBGastChrg()

~OBGastChrg | ( |  | ) |

## Member Function Documentation

## AssignPartialCharges()

bool AssignPartialCharges | ( | OBMol & | mol | ) |

Assign partial charges to this OBMol, setting each OBAtom partial charge.

Referenced by OBAtom::GetPartialCharge().

## GSVResize()

void GSVResize | ( | int | size | ) |

Resize the internal GasteigerState vector to match the size of the molecule.

Referenced by AssignPartialCharges().

The documentation for this class was generated from the following files:

- molchrg.h
- molchrg.cpp