def _run_atomtyping(self, top, use_residue_map=True, **kwargs): """Atomtype the topology. Parameters ---------- top : gmso.Topology Molecular Topology to be atomtyped. use_residue_map : bool, optional, default=True A speed-up option that utilizes previously atom typed molecules as a template for future atom typing of identical molecules, instead of reevaluating them each individually. To be implemented """ if isinstance(top, mb.Compound): top = from_mbuild(top) # TO DO in another PR if use_residue_map: # Detect duplicates subtopology/residues # (do matching by name, assert same number # of atoms) # Not implemented yet typemap = find_atomtypes(top, forcefield=self) else: typemap = find_atomtypes(top, forcefield=self) return typemap
def _typed_topology(n_sites=100): top = from_mbuild(n_ar_system(n_sites=n_sites)) ff = ForceField(get_fn('ar.xml')) for site in top.sites: site.atom_type = ff.atom_types['Ar'] top.update_topology() return top
def water_system(self): water = mb.load(get_path('tip3p.mol2')) water.name = 'water' water[0].name = 'opls_111' water[1].name = water[2].name = 'opls_112' packed_system = mb.fill_box(compound=water, n_compounds=2, box=mb.Box([2, 2, 2])) return from_mbuild(packed_system)
def ar_system(): ar = mb.Compound(name='Ar') packed_system = mb.fill_box(compound=ar, n_compounds=100, box=mb.Box([3, 3, 3])) ff = ForceField(get_fn('ar.xml')) top = from_mbuild(packed_system) for site in top.sites: site.atom_type = ff.atom_types['Ar'] top.update_topology() return top
def _typed_topology(n_sites=1): xe = mb.Compound(name="Xe") packed_system = mb.fill_box( compound=xe, n_compounds=n_sites, box=mb.Box([3, 3, 3]), ) top = from_mbuild(packed_system) ff = ForceField(get_path("noble_mie.xml")) for site in top.sites: site.atom_type = ff.atom_types["Xe"] top.update_topology() return top
def ar_system(self, n_ar_system): return from_mbuild(n_ar_system())
def ethane(self): from mbuild.lib.molecules import Ethane top = from_mbuild(Ethane()) return top
def gmso_topology_graph(self): import mbuild as mb from gmso.external import from_mbuild ethane = mb.load("CC", smiles=True) return TopologyGraph.from_gmso_topology(from_mbuild(ethane))