Initial work in the Molecule and Atom class

Signed-off-by: Vitor Hideyoshi <vitor.h.n.batista@gmail.com>
This commit is contained in:
2021-06-29 17:16:00 -03:00
committed by Vitor Hideyoshi
parent 7d74c3fb3e
commit 292995d0ea
4 changed files with 54 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ internal = {}
## Diceplayer:
player['maxcyc'] = 1
player['initcyc'] = 1 # May restart an optimization (append to geoms.xyz from start)
player['nprocs'] = 1f
player['nprocs'] = 1
player['switchcyc'] = 3 # At which step start doing only one QM calculation (geom & chg)
player['altsteps'] = 20000 # Steps for thermalization when starting from previous step
player['maxstep'] = 0.3 # Maxstep for geometry relaxation in Bohr

49
DPpack/SetGlobalsClass.py Normal file
View File

@@ -0,0 +1,49 @@
import os, sys
import math
import shutil
import textwrap
import numpy as np
from DPpack.PTable import *
from DPpack.Misc import *
class Molecule:
def __init__(self):
self.atoms = [] # Lista de instancias de Atom
self.positions = None # Array Numpy
self.energy = None # Array Numpy
self.gradient = None # Array Numpy
self.hessian = None # Array Numpy
def add_atom(self, a):
self.atoms.append(a) # Inserção de um novo atomo
def center_of_mass(self):
com = np.zeros(3)
total_mass = 0.0
for atom in self.atoms:
total_mass += atom.mass
com += atom.mass * np.array([atom.rx, atom.ry, atom.rz])
com = com / total_mass
return com
class Atom:
def __init__(self, lbl,na,rx,ry,rz,chg,eps,sig):
self.lbl = lbl # Integer
self.na = na # Integer
self.rx = rx # Double
self.ry = ry # Double
self.rz = rz # Double
self.chg = chg # Double
self.eps = eps # Double
self.sig = sig # Double
self.mass = atommass[self.na] # Double