sampledoc

Bond Class API

Class data structures for 2, 3, 4 point groupings of Particle objects

class bonds.Bond(pgid1=0, pgid2=0, length=0.0, type='blank')[source]

Data structure for describing any 2-point associatiaon of Particle-s

get_g_indx()[source]

Return bond type index for gromacs

get_lmpindx()[source]

Return bond type index for lammps

set_g_indx(g_indx)[source]

Set bond type index for gromacs

set_lmpindx(lmpindx)[source]

Set bond type index for lammps

class bonds.BondContainer(idList=[], verbose=False)[source]

Main data structure for holding Bond objects. Map of global bond ID (integer) to Bond object instances

clear()[source]

Clears bonds out of BondContainer

getTypeInfoDict()[source]

Return a map of type to typeIndex Method assigns a type index and checkes for consistency

Returns:
dictionary
hasBond(bondList)[source]

Check the ptcl IDs in bondList for any bond in container that is similar eg bond 1-2 is same as bond 2-1

Args: (list) ptcl IDs defining bond to search for

Returns: (bool) is bond in container

keys()[source]

Return list of all ptcl IDs (keys) currently in container

put(bond)[source]

Append ‘Bond’ object to this container. Updates globalID for container by incrementing the maxgid member

Args:
ptcl (Particle) correctly initialized Particle object
NOTE:
  1. One can imagine extra conditions on bonds inserted
  2. This could check for uniqueness of all globalID’s and throw error for copies
replacePtclIDs(idFromTo)[source]

Replace ptclIDs given a dictionary of ID changes # eg {1:3, 3:5, 2:20...}

Args:
idFromTo (dict) map of ID changes