.add()
can also take a list of compounds
import mbuild as mb
class I2(mb.Compound):
def init(self):
super(I2, self).init()
iodine1= mb.Particle(pos=[0.0, 0.0, 0.0], name='I')
iodine2= mb.Particle(pos=[0.8, 0.0, 0.0], name='I')
self.add([iodine2,iodine1])
self.add_bond((iodine2,iodine1))
i2 = I2()
i2.energy_minimize(steps=100, algorithm='steep', forcefield='GAFF')
i2.visualize()
box = mb.Box(lengths=[1.4184, 1.4184, 1.4184])
box_of_i2= mb.fill_box(compound=i2, n_compounds=24, box=box)
box_of_i2.energy_minimize(steps=100000, algorithm='steep', forcefield='GAFF')
box_of_i2.visualize()
How to install mbuild on cluster?
I tried : python -m pip install --user mbuild
but when I import mbuild it gives me an error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/panfs/roc/groups/12/siepmann/singh891/projects/signac/mnd/mbuild/mbuild/init.py", line 2, in <module>
from mbuild.coarse_graining import coarse_grain
File "/panfs/roc/groups/12/siepmann/singh891/projects/signac/mnd/mbuild/mbuild/coarse_graining.py", line 3, in <module>
from mbuild.compound import Compound
File "/panfs/roc/groups/12/siepmann/singh891/projects/signac/mnd/mbuild/mbuild/compound.py", line 14, in <module>
import mdtraj as md
File "/home/siepmann/singh891/.local/lib/python3.7/site-packages/mdtraj/init.py", line 30, in <module>
from .formats.registry import FormatRegistry
File "/home/siepmann/singh891/.local/lib/python3.7/site-packages/mdtraj/formats/init.py", line 4, in <module>
from .dcd import DCDTrajectoryFile
File "init.pxd", line 918, in init mdtraj.formats.dcd
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
Sorry just getting to this @ramanishsingh . To install mbuild on a cluster, we recommend using Anaconda
to install and create an environment. We host mBuild and Foyer to be pip installable, however, some of our dependencies like mdtraj do not list all of their dependencies like numpy
with their pip recipe.
It is usually a much easier process to install through anaconda.
conda create -n mosdef36 python=3.6
conda activate mosdef36
conda install -c mosdef -c conda-forge -c omnia mbuild foyer
If you do not have anaconda on the cluster, you can download a minimial conda install called miniconda
select atom
function in packmol, and don't see an analogous method in mbuild. I want to essentially have a layer of molecules with their 'ports' all arranged on an invisible surface. i know that monolayer exists, but it looks like i'd need to explicitly define a lattice layer for a surface?
fix_orientation
flag that prohibits rotation while packing