Ejemplo n.º 1
0
    def setup_calculator(self):          
        parameters = dict(
            neighbor   = '2.0 nsq',
            )
 
        calc = ReaxFF(ff_file_path=self.ff_file_path, parameters=parameters)
        
        return calc
Ejemplo n.º 2
0
from multiasecalc.utils import get_datafile

import numpy as np

dimer_name = "2-pyridoxine_2-aminopyridine_complex"

atoms = s22.create_s22_system(dimer_name)  # full system
atom_counts = s22.get_number_of_dimer_atoms(dimer_name)
Mixer.set_atom_ids(atoms)  # sequence of numbers in same order as positions
# were given above, index starts from 0

atoms_m1 = atoms[:atom_counts[0]]  # first molecule
atoms_m2 = atoms[atom_counts[0]:]  # second molecule

calc_gpaw = GPAW(nbands=-2, txt="h2_1.txt")
calc_reaxff = ReaxFF(ff_file_path=get_datafile("ffield.reax.new"),
                     implementation="C")
reaxff_cell = (100.0, 100.0, 100.0)
gpaw_cell = (10.0, 10.0, 10.0)

filter_full_system = AtomListSelector(
    range(len(atoms)), dict(zip(range(len(atoms)), [1.0] * len(atoms))))

filter_qm_region = AtomListSelector(
    range(atom_counts[0]),
    dict(zip(range(atom_counts[0]), [1.0] * atom_counts[0])))

forces_full_system = ForceCalculation("forces_full_sys",
                                      selector=filter_full_system,
                                      calculator=calc_reaxff,
                                      cell=reaxff_cell)
Ejemplo n.º 3
0
from ase import Atoms
from multiasecalc.lammps.reaxff import ReaxFF
from multiasecalc.utils import get_datafile

d = 0.74
#d = 3.0
a = 6.0

atoms_all = Atoms("H3",
                  positions=[(0, 0, 0), (0, 0, d), (0, 0, 2 * d)],
                  cell=(100 * a, 100 * a, 100 * a))
atoms_all.center()

calc_1 = ReaxFF(specorder=("C", "H", "O", "N", "S"),
                implementation="C",
                ff_file_path=get_datafile("ffield.reax"))

atoms_all.set_calculator(calc_1)
print(atoms_all.get_forces())
print(atoms_all.get_potential_energy())
Ejemplo n.º 4
0
def calculate_charges(atoms):
    from multiasecalc.lammps.reaxff import ReaxFF
    atoms.center(vacuum=1)
    atoms.calc = ReaxFF(ff_file_path=get_datafile('ffield.reax'), parameters = dict(neighbor='2.0 nsq'))
    atoms.get_potential_energy()
Ejemplo n.º 5
0
from ase.data import s22
from ase import units
import numpy as np
import ase.io
from ase.io.trajectory import PickleTrajectory

atoms = s22.create_s22_system('Methane_dimer')
atoms.center(vacuum=10.0)
print atoms.positions

atoms.calc = COMPASS(ff_file_path=get_datafile('compass.frc'), debug=True)
optimizer = LAMMPSOptimizer(atoms)
optimizer.run()
print atoms.positions

atoms.calc = ReaxFF(ff_file_path=get_datafile('ffield.reax'), debug=True)
dyn = LAMMPS_NVT(atoms,
                 1 * units.fs,
                 100,
                 trajectory='test.traj',
                 traj_interval=2)
dyn.run(5)

atoms.calc = COMPASS(ff_file_path=get_datafile('compass.frc'), debug=True)
dyn.run(10)

trj = PickleTrajectory('test.traj', 'r')

for t in trj:
    print t.positions