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

Added usage examples markdown file #114

Merged
merged 4 commits into from
Apr 14, 2017
Merged

Added usage examples markdown file #114

merged 4 commits into from
Apr 14, 2017

Conversation

summeraz
Copy link
Contributor

No description provided.

files.
```python
import mbuild as mb
from mbuild.examples.ethane.ethane import Ethane
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just do from mbuild.examples import Ethane. We pulled up a few of the main examples into that namespace.

import mbuild as mb
from mbuild.examples.ethane.ethane import Ethane

ethane_box = mb.fill_box(Ethane(), 100, box=[2, 2, 2])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add the n_molecules kwarg

#### Creating a box of coarse-grained ethane
Again we will use mBuild to construct a box filled with ethane molecules. However,
now we will model ethane using a united-atom description and apply the TraPPE force
field during atom-typing. Note how particle names are prefaced with an underscore so
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefaced->prefixed

ethane_UA.add(CH3_UA(), 'ch3_1')
ethane_UA.add(CH3_UA(), 'ch3_2')
mb.force_overlap(ethane_UA['ch3_1'], ethane_UA['ch3_1']['up'],
ethane_UA['ch3_2']['up'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding a CG example to mbuild so we don't need to spend time here explaining how to build this since it's not really pertinent to foyer itself. Or maybe the class could be simplified to something like:

ethane_UA = mb.Compound()
ch3_1 = mb.Particle(name='_CH3', pos=[0, 0, 0])
ch3_2 = mb.Particle(name='_CH3', pos=[0.2, 0, 0])
ethane_UA.add([ch3_1, ch3_2])
ethane_UA.add_bond((ch3_1, ch3_2))

surface and another for a fluid in the same system. Foyer supports this
functionality by allowing the user to separately atom-type parts of a system. In
this example, we take a system featuring bulk united atom ethane above a silica
surface and apply the OPLS force field to the surface and the TraPPE force field to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think generally this should be discouraged as TraPPE and OPLS aren't really intended to play nicely together. I think the bigger motivation is for when you have a small extension of a larger monolithic forcefield. You could do this exact example with the big OPLS and then just the silica extension from the Sandia papers.

def __init__(self):
super(CH3_UA, self).__init__()
self.add(mb.Particle(name='_CH3'))
self.add(mb.Port(anchor=self[0], separation=0.075), 'up')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the above comment, for the AA system you can probably make all this much simpler and maybe just import examples from mBuild instead of spending a lot of time building stuff here.

@summeraz
Copy link
Contributor Author

I've made the suggested edits. One issue now is that the '+' syntax for combining ParmEd Structures is yielding an error that a maximum recursion depth has been exceeded. I've attached the script I've been working with, and will continue to attempt to debug this myself.
multi-ff.zip

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

Successfully merging this pull request may close these issues.

None yet

2 participants