Periodic boundary condition...

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Kasra Momeni
Posts: 23
Joined: Sat Nov 14, 2009 12:06 pm

Periodic boundary condition...

Post by Kasra Momeni » Fri May 27, 2011 12:01 pm

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.

User avatar
Peter Eastman
Posts: 2577
Joined: Thu Aug 09, 2007 1:25 pm

RE: Periodic boundary condition...

Post by Peter Eastman » Fri May 27, 2011 12:07 pm

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

User avatar
Kasra Momeni
Posts: 23
Joined: Sat Nov 14, 2009 12:06 pm

RE: Periodic boundary condition...

Post by Kasra Momeni » Tue May 31, 2011 10:53 am

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);

User avatar
Peter Eastman
Posts: 2577
Joined: Thu Aug 09, 2007 1:25 pm

RE: Periodic boundary condition...

Post by Peter Eastman » Tue May 31, 2011 11:51 am

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

POST REPLY