Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do we introduce constraints? #142

Open
g-bauer opened this issue Apr 5, 2017 · 4 comments
Open

How do we introduce constraints? #142

g-bauer opened this issue Apr 5, 2017 · 4 comments
Labels

Comments

@g-bauer
Copy link
Contributor

g-bauer commented Apr 5, 2017

There are a lot of force fields that represent molecules as semi-flexible or even rigid. To have that functionality in a simulation, constraints have to be introduced.

The complexity that comes along with constraints is very different for MC and MD. While it is trivial to implement e.g. constant bonding lengths in MC, we need to have specific algorithms to do that in MD.

We should collect ideas how we can implement constraints so that they can be used conveniently for both propagators.

Some questions that pop into my mind:

  • Where/how to keep track of degrees of freedom?
  • Where would we implement information about constraints? Could they be part of Interactions?
  • Which functionalities do we want/need to provide? Constant bonding lengths, -angles, completely rigid molecules?
  • Where would constraint algorithms be implemented for MD?
@Luthaf
Copy link
Member

Luthaf commented Apr 5, 2017

Where/how to keep track of degrees of freedom?
Where would we implement information about constraints? Could they be part of Interactions?

We could store both of them in the Molecule struct. Something like:

struct Molecule {
    bonds: Vec<Bond>,
    angles: Vec<Angle>,
    rigid_bonds: Vec<Bond>,
    rigid_angles: Vec<Angle>,
}

And then it would be up to the algorithms to obey the constraints. A rigid molecule would have only rigid bonds. I still have to check the MD constraints algorithms to see if this could work.

Which functionalities do we want/need to provide? Constant bonding lengths, -angles, completely rigid molecules?

All of them?

Where would constraint algorithms be implemented for MD?

RATTLE and SHAKE algorithm can be implemented as part of a new Integrator

@Luthaf Luthaf added the A-System label Apr 5, 2017
@g-bauer
Copy link
Contributor Author

g-bauer commented Apr 5, 2017

We could store both of them in the Molecule struct.

It is not clear to me: Where would we get e.g the bonding length from? Would we check the bonding potential's equilibrium distance? So for MC, we need to add a harmonic potential to describe the bond and then - if it is fixed - use the bonding length and ignore the force constant?

@Luthaf
Copy link
Member

Luthaf commented Apr 6, 2017

This could be a solution. Or we could store them aside with the Bond, or in a RigidBond struct:

struct Molecule {
    bonds: Vec<Bond>,
    angles: Vec<Angle>,
    rigid_bonds: Vec<Bond>,
    rigid_angles: Vec<Angle>,
}

////////////////////////////////////////////////////////

struct RigidBond {
    usize: i,
    usize: i,
    length: f64
}

struct Molecule {
    bonds: Vec<Bond>,
    angles: Vec<Angle>,
    rigid_bonds: Vec<RigidBond>,
    rigid_angles: Vec<RigidAngle>,
}

And then we can get the bong length from:

  • the initial configuration. This might be bad as we might not get the same bond length for every bond;
  • a parameter in the forcefield; This might be harder to parse and a bit ackward: why an Harmonic potential specifically?
  • a parameter in the [molecules] section.

(I am mainly throwing ideas as they come, most of them could work here 😃).

@g-bauer
Copy link
Contributor Author

g-bauer commented Apr 6, 2017

the initial configuration. This might be bad as we might not get the same bond length for every bond;

Yepp. Also, if we want to insert a molecule, we would need a separate configuration.

a parameter in the forcefield; This might be harder to parse and a bit ackward: why an Harmonic potential specifically?

I'll have to read a bit more about the MD constraint algorithms, but I think they need the potential function to compute the Lagrange multipliers that have to be introduced. For MC the potential function does not matter; we only need the equilibrium distance. In MC codes you'll often find the option to apply a harmonic potential that either takes an force constant or a flag fixed as input.

In any case, we need both information since we can only get the underlying potentials of bonds, angles, etc from the mapping via Molecule. It's hard to decide where to put the functionality before we sketch the constraint algorithms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants