New User Questions

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Gideon Simpson
Posts: 16
Joined: Tue Sep 26, 2017 11:15 pm

New User Questions

Post by Gideon Simpson » Tue May 14, 2019 11:08 am

I'm just getting started with OpenMM and I had a few questions I was hoping to get some guidance on:

1. Is it absolutely necessary to specify an integrator to do anything? I have in mind that there may be times I just want to make static calculations or find local minimizers. It's certainly not a big deal to specify one, but I was curious.

2. What is the role of the topology data structure? When is it needed/not needed?

3. Is there a way to confine the problem to 2D, akin to the

Code: Select all

fix enforce2d 
tool in LAMMPS?

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

Re: New User Questions

Post by Peter Eastman » Tue May 14, 2019 11:33 am

Is it absolutely necessary to specify an integrator to do anything?
Anything that requires a Context, yes. If you're just doing static energy evaluations, it doesn't matter what integrator you use.
What is the role of the topology data structure?
You need it for any of the following: using Modeller to edit your model; using a ForceField to construct a System; writing out PDB files.
Is there a way to confine the problem to 2D
The simplest way would probably be to write a CustomIntegrator that explicitly sets the z coordinate of each particle to 0 after every position update.

User avatar
Gideon Simpson
Posts: 16
Joined: Tue Sep 26, 2017 11:15 pm

Re: New User Questions

Post by Gideon Simpson » Wed May 15, 2019 11:57 am

For a CustomIntegrator, is there a way to only manipulate particular degrees of freedom per particle? I see commands like addComputePerDof, but these appear to operate on the entire position, x, and entire velocity, v space. Is there a way to access x[0], x[1], etc.?

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

Re: New User Questions

Post by Peter Eastman » Wed May 15, 2019 2:29 pm

One easy way is like this:

Code: Select all

integrator.addComputePerDof("x", "vector(_x(x), _y(x), 0)")
That will set the z component of the position to 0.

Another way is to create a per-DOF variable, and set it to (1, 1, 0) for each particle. Then you can multiply any calculation by that variable, and the z component will be set to 0.

User avatar
Gideon Simpson
Posts: 16
Joined: Tue Sep 26, 2017 11:15 pm

Re: New User Questions

Post by Gideon Simpson » Thu May 16, 2019 1:09 pm

Both suggestions work as expected. I'm guessing there's no straightforward way to modify the quenching tool (minimize energy) to restrict to 2D?

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

Re: New User Questions

Post by Peter Eastman » Thu May 16, 2019 1:13 pm

If your initial coordinates are confined to the xy plane, and all forces are in that plane, then the minimizer shouldn't ever move the particles out of it. But if you do have forces acting out of the plane, there's no way to prevent the minimizer from responding to them. The best you could do is add a fairly strong restraining force to keep them in the plane.

POST REPLY