Skip to content

Example 01_Methane Dreiding Forcefield  #37

Description

@GustavoG9

For some reason whenever I try to run the first example it throws the following error: PysimmError: A pair_style must be defined during initialization

from pysimm import system, lmps, forcefield

s = system.System()

m = s.molecules.add(system.Molecule())

f = forcefield.Dreiding()
#f = forcefield.Gaff2()

dreiding_C_ = s.particle_types.add(f.particle_types.get('C_3')[0].copy())
dreiding_H_ = s.particle_types.add(f.particle_types.get('H_')[0].copy())

#gaff_c3 = s.particle_types.add(f.particle_types.get('c3')[0].copy())
#gaff_hc = s.particle_types.add(f.particle_types.get('hc')[0].copy())

#c1 = s.particles.add(system.Particle(type=gaff_c3, x=0, y=0, z=0, charge=0, molecule=m))
c1 = s.particles.add(system.Particle(type=dreiding_C_, x=0, y=0, z=0, charge=0, molecule=m))

#h1 = s.add_particle_bonded_to(system.Particle(type=gaff_hc, charge=0, molecule=m), c1, f)
#h2 = s.add_particle_bonded_to(system.Particle(type=gaff_hc, charge=0, molecule=m), c1, f)
#h3 = s.add_particle_bonded_to(system.Particle(type=gaff_hc, charge=0, molecule=m), c1, f)
#h4 = s.add_particle_bonded_to(system.Particle(type=gaff_hc, charge=0, molecule=m), c1, f)

h1 = s.add_particle_bonded_to(system.Particle(type=dreiding_H_, charge=0, molecule=m), c1, f)
h2 = s.add_particle_bonded_to(system.Particle(type=dreiding_H_, charge=0, molecule=m), c1, f)
h3 = s.add_particle_bonded_to(system.Particle(type=dreiding_H_, charge=0, molecule=m), c1, f)
h4 = s.add_particle_bonded_to(system.Particle(type=dreiding_H_, charge=0, molecule=m), c1, f)

s.apply_charges(f, charges='gasteiger')

s.set_box(padding=10)

s.bond_style='lj'
s.pair_style='harmonic'
s.angle_style='harmonic'

lmps.quick_min(s, min_style='fire', name='fire_min')

#lmps.quick_min(s, min_style='sd', name='min_sd')
#lmps.quick_min(s, min_style='cg', name='min_cg')

s.write_pdb('methane.pdb')


Do you have any idea what could be wrong?
Thanks in advance!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions