Beispiel #1
0
 def addAdrATParticle(self, pid, *args):
     if (self.particleExists(pid)):
         print "WARNING: Particle ", pid, " already exists. Therefore it was not added."
         return None
     else:
         pmi.call(self.pmiobject, 'addAdrATParticle', pid, *args)
         return Particle(pid, self)
Beispiel #2
0
 def modifyParticle(self, pid, property, value):
     if (self.particleExists(pid)):
         pmi.call(self.pmiobject, 'modifyParticle', pid, property,
                  value)
     else:
         print("WARNING: Particle ", pid,
               " does not exist and was not modified")
Beispiel #3
0
 def addAdrATParticle(self, pid, *args):
   if( self.particleExists(pid) ):
     print "WARNING: Particle ", pid, " already exists. Therefore it was not added."
     return None
   else:
     pmi.call(self.pmiobject, 'addAdrATParticle', pid, *args)
     return Particle(pid, self)
Beispiel #4
0
 def close(self):
     pmi.call(self.pmiobject, "close")
     # Sort file if flag is set to true.
     if self.pmiobject.do_sort:
         h5 = h5py.File(self.pmiobject.filename, 'r+')
         print('Sorting file, please wait...')
         sort_file(h5)
         print('File sorted')
         h5.close()
Beispiel #5
0
 def addParticle(self, pid, pos, checkexist=True):
     if checkexist:
         if (self.particleExists(pid)):
             print "WARNING: Particle ", pid, " already exists. Therefore it was not added."
             return None
         else:
             pmi.call(self.pmiobject, 'addParticle', pid, pos)
             return Particle(pid, self)
     else:
         pmi.call(self.pmiobject, 'addParticle', pid, pos)
Beispiel #6
0
 def addParticle(self, pid, pos, checkexist=True):
   if checkexist:
     if( self.particleExists(pid) ):
       print "WARNING: Particle ", pid, " already exists. Therefore it was not added."
       return None
     else:
       pmi.call(self.pmiobject, 'addParticle', pid, pos)
       return Particle(pid, self)
   else:
     pmi.call(self.pmiobject, 'addParticle', pid, pos)
Beispiel #7
0
 def clearSavedPositions(self):
     pmi.call(self.pmiobject, 'clearSavedPositions')
Beispiel #8
0
 def restorePositions(self):
     pmi.call(self.pmiobject, 'restorePositions')
Beispiel #9
0
 def savePositions(self, idList):
     pmi.call(self.pmiobject, 'clearSavedPositions')
     pmi.call(self.pmiobject, 'savePositions', idList)
Beispiel #10
0
 def fxxx(self):
     pmi.call(self.pmiobject, 'fxxx')
Beispiel #11
0
 def clearSavedPositions(self):
   pmi.call(self.pmiobject, 'clearSavedPositions')
Beispiel #12
0
 def restorePositions(self):
   pmi.call(self.pmiobject, 'restorePositions')
Beispiel #13
0
 def savePositions(self, idList):
   pmi.call(self.pmiobject, 'clearSavedPositions')
   pmi.call(self.pmiobject, 'savePositions', idList)
Beispiel #14
0
 def modifyParticle(self, pid, property, value):
   if (self.particleExists(pid)):
     pmi.call(self.pmiobject, 'modifyParticle', pid, property, value)
   else:
     print "WARNING: Particle ", pid, " does not exist and was not modified"