Commit c3da9bfc authored by LAPikachu's avatar LAPikachu
Browse files

Replacing asap3 potentials with ASE native option

parent 70fb26a7
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
import json
from scipy.optimize import curve_fit, root_scalar
from ase.calculators.emt import EMT
from asap3 import BrennerPotential
#from asap3 import BrennerPotential
from ase.build import nanotube
from ase.io import Trajectory, read, write, gromacs, extxyz
from ase.optimize import FIRE
@@ -20,7 +20,8 @@ plot_dir = 'data_CNT_sim/nve_plots/'
directory = 'data_CNT_sim/'
data_directory = 'data_CNT_sim/nve_deform/'
cnt = nanotube(5, 5, symbol='C', length=3, bond=1.42)
cnt.calc = BrennerPotential()
#cnt.calc = BrennerPotential()
cnt.calc = EMT()
#adjust cell and pbc (for visualization)
cnt.cell[:] = cnt.cell[:] + np.array([[10, 0, 0],[0, 10, 0],[0, 0, 0]])
cnt.set_pbc([0,0,1])
@@ -108,7 +109,7 @@ if __name__ == '__main__':
    relax_structure(cnt) 
    traj_relax_read = Trajectory(f'{directory}relaxed_cell.traj', 'r')
    cnt_rel = traj_relax_read[-1]
    cnt_rel.calc = BrennerPotential()
    cnt_rel.calc = EMT()
    
    dyn = VelocityVerlet(cnt_rel, timestep=timestep*units.fs)
    data = {'time':[],'temperature':[], 'epot':[],'ekin':[], 'etot': []}
+3 −3
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ import matplotlib.pyplot as plt
import json
from scipy.optimize import curve_fit, root_scalar
from ase.calculators.emt import EMT
from asap3 import BrennerPotential
#from asap3 import BrennerPotential
from ase.build import nanotube
from ase.io import Trajectory, read, write, gromacs
from ase.optimize import FIRE
@@ -20,7 +20,7 @@ plot_dir = 'data_CNT_sim/nvt_plots/'
directory = 'data_CNT_sim/'
data_directory = 'data_CNT_sim/nvt_deform/'
cnt = nanotube(5, 5, symbol='C', length=3, bond=1.42)
cnt.calc = BrennerPotential()
cnt.calc = EMT()
#adjust cell and pbc (for visualization)
cnt.cell[:] = cnt.cell[:] + np.array([[10, 0, 0],[0, 10, 0],[0, 0, 0]])
cnt.set_pbc([0,0,1])
@@ -99,7 +99,7 @@ if __name__ == '__main__':
    # to save time we get the relaxed stucture from the nve sim
    traj_relax_read = Trajectory(f'{directory}relaxed_cell.traj', 'r')
    cnt = traj_relax_read[-1]
    cnt.calc = BrennerPotential() #when reading from trajectory the potential gets lost... why? no idea 
    cnt.calc = EMT() #when reading from trajectory the potential gets lost... why? no idea 

    dyn = Langevin(cnt, timestep=timestep*units.fs,temperature_K=300, friction=0.01/units.fs)
    data = {'time':[],'temperature':[], 'epot':[],'ekin':[], 'etot': []}
+2 −2
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@ import numpy as np
import matplotlib.pyplot as plt
import json
from scipy.optimize import curve_fit, root_scalar
#from ase.calculators.emt import EMT
from asap3 import EMT, EMTRasmussenParameters, EMT2013
from ase.calculators.emt import EMT
#from asap3 import EMT, EMTRasmussenParameters, EMT2013
from ase.lattice.cubic import FaceCenteredCubic, BodyCenteredCubic, SimpleCubic
from ase.io import Trajectory, read
from ase.optimize import FIRE
+1 −1
Original line number Diff line number Diff line
asap3==3.13.7
#asap3==3.13.7
ase==3.25.0
contourpy==1.3.2
cycler==0.12.1