Exemple #1
0
def MOTD():
    utils.ff_print_source(False)
    utils.ff_use_colours(fancy_format_colours)
    utils.ff_print_time(False)
    os.system('color 07')
    features = [
        'Loading molecules from xyz files or alternatively download from pubchem.',
        'Visualising molecules as a ball-and-stick model or as a wireframe model.',
        'Algorithms for guessing atom types, bonds, and bond orders.',
        'Support for STO-nG basis set for atomic/molecular orbital visualtions and calculations.',
        'Crude extended-Hückel method for calculation of molecular orbitals.'
    ]
    planned_features = [
        'Improvements to extended-Hückel and molecular integrals.',
        'Marching cubes algorithm to visualise orbitals as iso-volumes instead of current random-dot style.'
    ]

    utils.message(f'Welcome, this project so far supports the following:',
                  colour='blue')
    [utils.message(f'-- {f}', colour='blue') for f in features]
    utils.message(f'Planned features:', colour='blue')
    [utils.message(f'-- {f}', colour='blue') for f in planned_features]
    print()
Exemple #2
0
import modules.moldynamics as md
import os, math, copy
import numpy as np

from subprocess import check_output

# def printer(m):
# 	for a1, a2 in m.get_unique_bonds():
# 		print(a1, a2, a1.distance_to(a2))

# 	for a1, a2, a3, angle in m.get_unique_bond_angles():
# 		print(a1,a2,a3,angle)

utils.ff_print_source(False)
utils.ff_use_colours(False)
utils.ff_print_time(False)

ff = uff.ForceField()
ethane = mol.Molecule('butane.pcp')
a = ethane.atoms

# md.perform_md(ethane)
# ethane2 = mol.Molecule('benzene2')

p = plot.Plot()

# e1 = ff.get_energy(ethane,verbosity=1)*4.18
# e2 = ff.get_energy(ethane2,verbosity=1)*4.18
# print((e2-e1)/0.001)
# print((44.67307-44.64240)/0.001)
Exemple #3
0
        'Marching cubes algorithm to visualise orbitals as iso-volumes instead of current random-dot style.'
    ]

    utils.message(f'Welcome, this project so far supports the following:',
                  colour='blue')
    [utils.message(f'-- {f}', colour='blue') for f in features]
    utils.message(f'Planned features:', colour='blue')
    [utils.message(f'-- {f}', colour='blue') for f in planned_features]
    print()


MOTD()

utils.ff_print_source(fancy_format_source)
utils.ff_use_colours(fancy_format_colours)
utils.ff_print_time(fancy_format_time)
utils.ff_verbosity(verbosity)

if colour_map == None:
    colour_map = cmap.BlueRed(posneg_mode=True)

#viewer setup
pg.init()
screen = scr.Screen3D(resolution, bkgr_colour=background_colour)
mol = mol6.Molecule(molecule, basis_set_type=basis_set, repeat=repeats)

if add_hydrogens:
    mol.add_hydrogens()

atoms = mol.atoms
pg.display.set_caption(mol.name)
Exemple #4
0
import modules.basisset6 as bs 
import modules.molecule6 as mol
import modules.screen4 as scr
import modules.utils as utils
import numpy as np 
import pygame as pg
import os
from math import sin, pi, cos

utils.ff_print_source(False)
utils.ff_use_colours(False)
utils.ff_print_time(True)

molecule = mol.Molecule(os.getcwd() + f'\\Molecules\\water.xyz')


# atoms = [mol.Atom('H', (0,0,0)), mol.Atom('H', (1,0,0))]
# atoms = [mol.Atom('H', (0, 1.43233673, -0.96104039)), mol.Atom('H', (0, -1.43233673, -0.96104039)), mol.Atom('O', (0, 0, 0.24026010))]
# atoms = [mol.Atom('C', (0, 0, 0)), mol.Atom('H', (0, 0, 1.1)), mol.Atom('H', (1.03709, 0, -0.366667)), mol.Atom('H', (-0.518545, 0.898146, -0.366667)), mol.Atom('H', (-0.518545, -0.898146, -0.366667))]



# molecule = mol.Molecule(atoms=atoms, basis_set_type='STO-6G')

bs.extended_huckel(molecule)
mos = molecule.molecular_orbitals

camera_range = max(max(mos[-1].ranges[0], mos[-1].ranges[1]), max(mos[-1].ranges[2], mos[-1].ranges[3])) + 1

#game setup
WIDTH, HEIGHT = SIZE = (1200, 720)