예제 #1
0
파일: parser.py 프로젝트: jorgehog/pyMD
 def getPosAndVelIterators(self, props):
     
 
     positions, velIter, separation, thickness = self.getVelAndPosSpecsFromProps(props)
             
     
     if type(positions) != list:
         if type(positions) is str:
             
             self.occupied[positions] = thickness*separation                            
             
             posIter = RNGFunctions.plcDist(self.mesh, thickness, separation, self.meshSpecs, self.knownSubs, 0, positions)
             
         elif isinstance(positions, RNGFunctions.RNGs):
             
             posIter = positions
                 
         else:
 
             raise Exception("Undefined position argument", positions)                
             
             
     else:
         
         for pos in positions:
                 self.occupied[pos] = thickness*separation            
         
         posIter = RNGFunctions.plcDist(self.mesh, thickness, separation, self.meshSpecs, self.knownSubs,  0,  *positions)
 
 
     setattr(posIter, "_separation", separation)
     
     return posIter, velIter
예제 #2
0
파일: parser.py 프로젝트: jorgehog/pyMD
 def getVelAndPosSpecsFromProps(self, props):
     
     try:
         positions = props['positions']
     except:
         positions = RNGFunctions.randomOnMesh(self.mesh)
     
     try:
         velIter = props['velocities']
     except:
         velIter = RNGFunctions.allZero()
     
     try:
         separation = props['separation']
     except:
         separation = min(self.mesh.shape)/self.N
     
     try:
         thickness = props['thickness']
         
         if thickness == "full":
             thickness = max(self.mesh.shape)/separation
             
         
     except:
         thickness = 1
         
     return positions, velIter, separation, thickness