def addForce(self, itype, filename, type): """ Each processor takes the broadcasted interpolation type, filename and particle type """ if pmi.workerIsActive(): self.cxxclass.addForce(self, itype, filename, type)
def scaleVolume(self, *args): 'scale the Volume of the system, which means in detail: scale all particle coordinates, scale box length, scale cellgrid (if it exists)' if pmi.workerIsActive(): if len(args) == 1: arg0 = args[0] if isinstance(arg0, Real3D): #print arg0," is a Real3D object" self.cxxclass.scaleVolume( arg0 ) elif hasattr(arg0, '__iter__'): if len(arg0) == 3: #print args, " has iterator and length 3" self.cxxclass.scaleVolume(self, toReal3DFromVector(arg0) ) elif len(arg0) == 1: #print args, " has iterator and length 1" self.cxxclass.scaleVolume(self, toReal3DFromVector(arg0[0], arg0[0], arg0[0]) ) else: print args, " is invalid" else: #print args, " is scalar" self.cxxclass.scaleVolume(self, toReal3DFromVector( [arg0, arg0, arg0] ) ) elif len(args) == 3: #print args, " is 3 numbers" self.cxxclass.scaleVolume(self, toReal3DFromVector(*args) ) else: print args, " is invalid"
def addMolecules(self, moleculelist): """ Each processor takes the broadcasted list. """ if pmi.workerIsActive(): for pid in moleculelist: self.cxxclass.add(self, pid)
def getAllPairs(self): 'return the pairs of the local verlet list' if pmi.workerIsActive(): pairs=[] npairs=self.localSize() for i in range(npairs): pair=self.cxxclass.getPair(self, i+1) pairs.append(pair) return pairs
def addSingles(self, singlelist): """ Each processor takes the broadcasted singlelist and adds those particles that are owned by this processor. """ if pmi.workerIsActive(): for pid in singlelist: self.cxxclass.add(self, pid)
def getAllTriples(self): 'return the triples of the local verlet list' if pmi.workerIsActive(): triples=[] ntriples=self.localSize() for i in range(ntriples): triple=self.cxxclass.getTriple(self, i+1) triples.append(triple) return triples
def addTriples(self, triplelist): """ Each processor takes the broadcasted triplelist and adds those triples whose first particle is owned by this processor. """ if pmi.workerIsActive(): for triple in triplelist: pid1, pid2, pid3 = triple self.cxxclass.add(self, pid1, pid2, pid3)
def addQuadruples(self, quadruplelist): """ Each processor takes the broadcasted quadruplelist and adds those quadruples whose first particle is owned by this processor. """ if pmi.workerIsActive(): for quadruple in quadruplelist: pid1, pid2, pid3, pid4 = quadruple self.cxxclass.add(self, pid1, pid2, pid3, pid4)
def exclude(self, exclusionlist): """ Each processor takes the broadcasted exclusion list and adds it to its list. """ if pmi.workerIsActive(): for pair in exclusionlist: pid1, pid2 = pair self.cxxclass.exclude(self, pid1, pid2) # rebuild list with exclusions self.cxxclass.rebuild(self)
def addTuples(self, tuplelist): """ Each processor takes the broadcasted tuplelist and adds those tuples whose virtual particle is owned by this processor. """ if pmi.workerIsActive(): for tuple in tuplelist: for pid in tuple: self.cxxclass.add(self, pid) self.cxxclass.addTs(self);
def getInteraction(self, number): 'get python object of the one single interaction number i' if pmi.workerIsActive(): ni = self.getNumberOfInteractions() if ni > 0: if number >=0 and number < ni: return self.cxxclass.getInteraction(self, number) else: raise Error("Interaction number %i does not exist" % number) else: raise Error("interaction list of system is empty")
def addAdrParticles(self, pids, rebuild=True): """ Each processor takes the broadcasted atomistic particles and adds it to its list. """ if pmi.workerIsActive(): for pid in pids: self.cxxclass.addAdrParticle(self, pid) if rebuild: # rebuild list with adress particles self.cxxclass.rebuild(self)
def addBonds(self, bondlist): """ Each processor takes the broadcasted bondlist and adds those pairs whose first particle is owned by this processor. """ if pmi.workerIsActive(): for bond in bondlist: pid1, pid2 = bond self.cxxclass.add(self, pid1, pid2)
def __init__(self, system, cutoff, exclusionlist=[]): 'Local construction of a verlet list' if pmi.workerIsActive(): if (exclusionlist == []): # rebuild list in constructor cxxinit(self, _espresso.VerletList, system, cutoff, True) else: # do not rebuild list in constructor cxxinit(self, _espresso.VerletList, system, cutoff, False) # add exclusions for pair in exclusionlist: pid1, pid2 = pair self.cxxclass.exclude(self, pid1, pid2) # now rebuild list with exclusions self.cxxclass.rebuild(self)
def __init__(self, system, cutoff, exclusionlist=[]): 'Local construction of a verlet triple list' if pmi.workerIsActive(): ''' cxxinit(self, _espresso.VerletListTriple, system, cutoff, True) if (exclusionlist != []): print 'Warning! Exclusion list is not yet implemented to the triple verlet \ list. Nothing happend to exclusion list' ''' if (exclusionlist == []): # rebuild list in constructor cxxinit(self, _espresso.VerletListTriple, system, cutoff, True) else: # do not rebuild list in constructor cxxinit(self, _espresso.VerletListTriple, system, cutoff, False) # add exclusions for pid in exclusionlist: self.cxxclass.exclude(self, pid) # now rebuild list with exclusions self.cxxclass.rebuild(self)
def __init__(self, system, cutoff, adrcut, dEx, dHy, adrCenter=[], pids=[], exclusionlist=[]): 'Local construction of a verlet list for AdResS' if pmi.workerIsActive(): cxxinit(self, _espresso.VerletListAdress, system, cutoff, adrcut, False, dEx, dHy) #self.cxxclass.setAtType(self, atType) # check for exclusions if (exclusionlist != []): # add exclusions for pair in exclusionlist: pid1, pid2 = pair self.cxxclass.exclude(self, pid1, pid2) # add adress particles if (pids != []): for pid in pids: self.cxxclass.addAdrParticle(self, pid) # set adress center if (adrCenter != []): self.cxxclass.setAdrCenter(self, adrCenter[0], adrCenter[1], adrCenter[2]) # rebuild list now self.cxxclass.rebuild(self)
def getSingles(self): 'return the singles of the GlobalSingleList' if pmi.workerIsActive(): singles=self.cxxclass.getSingles(self) return singles
def add(self, pid1, pid2, pid3): "add triple to fixed triple list" if pmi.workerIsActive(): return self.cxxclass.add(self, pid1, pid2, pid3)
def __init__(self, storage): "Local construction of a fixed triple list" if pmi.workerIsActive(): cxxinit(self, _espresso.FixedTripleList, storage)
def __init__(self, _system, _verletlist, _fixedtuplelist, KTI = False): 'Local construction of a verlet list for AdResS' if pmi.workerIsActive(): cxxinit(self, integrator_Adress, _system, _verletlist, _fixedtuplelist, KTI)
def __init__(self, storage, integrator, mO=16.0, mH=1.0, distHH=1.58, distOH=1.0): 'Local construction of a settle class' if pmi.workerIsActive(): cxxinit(self, _espresso.Settle, storage, integrator, mO, mH, distHH, distOH)
def getBonds(self): 'return the bonds of the GlobalPairList' if pmi.workerIsActive(): bonds=self.cxxclass.getBonds(self) return bonds
def add(self, pid1, pid2): 'add pair to fixed pair list' if pmi.workerIsActive(): return self.cxxclass.add(self, pid1, pid2)
def __init__(self, storage, fixedtupleList): 'Local construction of a fixed pair list' if pmi.workerIsActive(): cxxinit(self, _espresso.FixedPairListAdress, storage, fixedtupleList)
def getDist(self, pid1, pid2): if pmi.workerIsActive(): return self.cxxclass.getDist(self, pid1, pid2)
def size(self): 'count number of bonds in GlobalPairList, involves global reduction' if pmi.workerIsActive(): return self.cxxclass.size(self)
def size(self): "count number of Triples in GlobalTripleList, involves global reduction" if pmi.workerIsActive(): return self.cxxclass.size(self)
def size(self): 'count number of particles in GlobalSingleList, involves global reduction' if pmi.workerIsActive(): return self.cxxclass.size(self)
def getTriples(self): "return the triples of the GlobalTripleList" if pmi.workerIsActive(): triples = self.cxxclass.getTriples(self) return triples
def __init__(self, storage): 'Local construction of a fixed pair list' if pmi.workerIsActive(): cxxinit(self, _espresso.FixedPairDistList, storage)