Page 1 of 1
Periodic boundary condition...
Posted: Fri May 27, 2011 12:01 pm
by kasra
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.
RE: Periodic boundary condition...
Posted: Fri May 27, 2011 12:07 pm
by peastman
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
RE: Periodic boundary condition...
Posted: Tue May 31, 2011 10:53 am
by kasra
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);
RE: Periodic boundary condition...
Posted: Tue May 31, 2011 11:51 am
by peastman
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