Hello,
I was wondering how I can setup a system with periodic boundary conditions along all directions.
I would appreciate if you explain it with example.
With best regards,
Kasra.
Periodic boundary condition...
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
RE: Periodic boundary condition...
Just call setDefaultPeriodicBoxVectors() on your System to set the periodic box dimensions, then call setNonbondedMethod() on your NonbondedForce to select what method to use.
Peter
Peter
- Kasra Momeni
- Posts: 23
- Joined: Sat Nov 14, 2009 12:06 pm
RE: Periodic boundary condition...
Hello Peter,
Here are the lines of code that I have used for my simulations. I would appreciate if you let me know whether they are correct or not?
Thank you,
Kasra.
omm->system = new OpenMM::System();
Vec3 X = OpenMM::Vec3(32.49,0.0,0.0);
Vec3 Y = OpenMM::Vec3(0.0,32.49,0.0);
Vec3 Z = OpenMM::Vec3(0.0,0.0,51.41);
omm->system->setDefaultPeriodicBoxVectors(X, Y, Z);
Here are the lines of code that I have used for my simulations. I would appreciate if you let me know whether they are correct or not?
Thank you,
Kasra.
omm->system = new OpenMM::System();
Vec3 X = OpenMM::Vec3(32.49,0.0,0.0);
Vec3 Y = OpenMM::Vec3(0.0,32.49,0.0);
Vec3 Z = OpenMM::Vec3(0.0,0.0,51.41);
omm->system->setDefaultPeriodicBoxVectors(X, Y, Z);
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
RE: Periodic boundary condition...
That looks fine. It's a little more wordy than it needs to be, though.
Vec3 X = OpenMM::Vec3(32.49,0.0,0.0);
is exactly equivalent to
Vec3 X(32.49,0.0,0.0);
Peter
Vec3 X = OpenMM::Vec3(32.49,0.0,0.0);
is exactly equivalent to
Vec3 X(32.49,0.0,0.0);
Peter