stko.OpenBabelEnergy
- class stko.OpenBabelEnergy(forcefield)[source]
Bases:
objectUses OpenBabel to calculate forcefield energies.
Warning
This will not work for Python >= 3.13! See https://github.com/JelfsMaterialsGroup/stko/issues/208
- Parameters:
forcefield (str) – Forcefield to use. Options include uff, gaff, ghemical, mmff94.
- Raises:
WrapperNotInstalledError – if openbabel not installed.
See also
OpenBabel: https://github.com/openbabel/openbabel
Examples
import stk import stko # Create a molecule whose energy we want to know. mol1 = stk.BuildingBlock('CCCNCCCN') # Create the energy calculator. energy_calc = stko.OpenBabelEnergy('uff') # Calculate the energy. results = energy_calc.get_results(mol1) energy = results.get_energy() unit_string = results.get_unit_string()
Methods
Calculate the energy of mol.
Calculate the energy of mol.
- get_energy(mol)[source]
Calculate the energy of mol.
- Parameters:
mol (Molecule) – The
stk.Moleculewhose energy is to be calculated.- Returns:
The energy.
- Return type: