def get_e_outofplanes(mol): mol.e_outofplanes = 0.0 for p in range(mol.n_outofplanes): oop = mol.outofplanes[p] c1 = mol.atoms[oop.at1].coords c2 = mol.atoms[oop.at2].coords c3 = mol.atoms[oop.at3].coords c4 = mol.atoms[oop.at4].coords oop.o_ijkl = geomcalc.get_o_ijkl(c1, c2, c3, c4) oop.e = get_e_outofplane(oop.o_ijkl, oop.v_n, oop.gam, oop.n) mol.e_outofplanes += oop.e
def get_g_outofplanes(mol): mol.g_outofplanes = np.zeros((mol.n_atoms, 3)) for p in range(mol.n_outofplanes): oop = mol.outofplanes[p] c1 = mol.atoms[oop.at1].coords c2 = mol.atoms[oop.at2].coords c3 = mol.atoms[oop.at3].coords c4 = mol.atoms[oop.at4].coords oop.o_ijkl = geomcalc.get_o_ijkl(c1, c2, c3, c4) tor.g = get_g_outofplane(oop.o_ijkl, oop.v_n, oop.gam, oop.n) dir1, dir2, dir3, dir4 = get_gdir_torsion(c1, c2, c3, c4) mol.g_torsions[oop.at1] += oop.g * dir1 mol.g_torsions[oop.at2] += oop.g * dir2 mol.g_torsions[oop.at3] += oop.g * dir3 mol.g_torsions[oop.at4] += oop.g * dir4
def get_outofplanes(mol): for l in range(mol.n_atoms): n_lbonds = len(mol.bond_tree[l]) for a in range(n_lbonds): i = mol.bond_tree[l][a] for b in range(n_lbonds): j = mol.bond_tree[l][b] if (i == j): continue for c in range(b+1, n_lbonds): k = mol.bond_tree[l][c] if (i == k): continue o_ijkl = geomcalc.get_o_ijkl(mol.atoms[i].coords, mol.atoms[j].coords, mol.atoms[k].coords, mol.atoms[l].coords) v_n, gamma, nfold = param.get_outofplane_param(mol.atoms[i].coords, mol.atoms[j].coords, mol.atoms[k].coords, mol.atoms[l].coords) if (v_n > 0.0): mol.outofplanes.append(molecule.outofplane(i, j, k, l, o_ijkl, v_n, gamma, nfold)) mol.n_outofplanes = len(mol.outofplanes)