示例#1
0
atoms_str = ""
atoms = None
bonds = None
if opt_dict['atoms'] or opt_dict['bonds']:
    atoms_str = "_atoms"
    atoms, tmp1, tmp2 = basUtils.loadAtoms('input_plot.xyz')
    del tmp1, tmp2
    #    print "atoms ", atoms
    if os.path.isfile('atomtypes.ini'):
        print(">> LOADING LOCAL atomtypes.ini")
        FFparams = PPU.loadSpecies('atomtypes.ini')
    else:
        FFparams = PPU.loadSpecies(cpp_utils.PACKAGE_PATH +
                                   '/defaults/atomtypes.ini')
    iZs, Rs, Qstmp = PPH.parseAtoms(atoms,
                                    autogeom=False,
                                    PBC=False,
                                    FFparams=FFparams)
    atom_colors = basUtils.getAtomColors(iZs, FFparams=FFparams)
    Rs = Rs.transpose().copy()
    atoms = [iZs, Rs[0], Rs[1], Rs[2], atom_colors]
    #print "atom_colors: ", atom_colors
if opt_dict['bonds']:
    bonds = basUtils.findBonds(atoms, iZs, 1.0, FFparams=FFparams)
    #print "bonds ", bonds
atomSize = 0.15

cbar_str = ""
if opt_dict['cbar']:
    cbar_str = "_cbar"

for iq, Q in enumerate(Qs):
示例#2
0
print "--- Compute Lennard-Jones Force-filed ---"

atoms, lvec = PPH.importGeometries(options.input)

FFparams = None
if os.path.isfile('atomtypes.ini'):
    print ">> LOADING LOCAL atomtypes.ini"
    FFparams = PPU.loadSpecies('atomtypes.ini')
else:
    FFparams = PPU.loadSpecies(cpp_utils.PACKAGE_PATH +
                               '/defaults/atomtypes.ini')

PBC = False if not options.noPBC else PPU.params['PBC']

iZs, Rs, Qs = PPH.parseAtoms(atoms,
                             autogeom=False,
                             PBC=options.noPBC,
                             FFparams=FFparams)
# This function returns the following information:
# iZs - 1D array, containing the numbers of the elements, which corresponds to
# their position in the atomtypes.ini file (Number of line - 1)
# Rs  - 2D array, containing the coordinates of the atoms:
#       [ [x1,y1,z1],
#         [x2,y2,z2],
#          ...
#         [xn,yn,zn]]
# Qs  - 1D array, containing the atomic charges

FFLJ, VLJ = PPH.computeLJ(Rs,
                          iZs,
                          FFLJ=None,
                          FFparams=FFparams,
else:
	sys.exit("ERROR!!! Unknown format of geometry system. Supported "
                 "formats are: .xyz, .cube, .xsf \n\n")




FFparams=None
if os.path.isfile( 'atomtypes.ini' ):
	print ">> LOADING LOCAL atomtypes.ini"  
	FFparams=PPU.loadSpecies( 'atomtypes.ini' ) 
else:
	FFparams = PPU.loadSpecies( cpp_utils.PACKAGE_PATH+'/defaults/atomtypes.ini' )


iZs,Rs,Qs=PPH.parseAtoms(atoms, autogeom = False, PBC = options.noPBC,
                         FFparams=FFparams )
# This function returns the following information:
# iZs - 1D array, containing the numbers of the elements, which corresponds to
# their position in the atomtypes.ini file (Number of line - 1)
# Rs  - 2D array, containing the coordinates of the atoms:
#       [ [x1,y1,z1],
#         [x2,y2,z2],
#          ... 
#         [xn,yn,zn]]
# Qs  - 1D array, containing the atomic charges

FFLJ, VLJ=PPH.computeLJ( Rs, iZs, FFLJ=None, FFparams=FFparams, Vpot=options.energy )
# This function computes the LJ forces experienced by the ProbeParticle
# FFparams either read from the local "atomtypes.ini" file, or will be read from
# the default one inside the computeLJ function