def __init__(self, system, 
              nodeGrid='auto', 
              cellGrid='auto',
              nocheck=False):
     # do sanity checks for the system first
     if nocheck:
       self.next_id = 0
       self.pmiinit(system, nodeGrid, cellGrid)                
     else:
       if check.System(system, 'bc'):
         if nodeGrid == 'auto':
           nodeGrid = decomp.nodeGrid(system.comm.rank)
         else:
           nodeGrid = toInt3DFromVector(nodeGrid)
         if cellGrid == 'auto':
           cellGrid = Int3D(2,2,2)
         else:
           cellGrid = toInt3DFromVector(cellGrid)
         # minimum image convention check:
         for k in range(3):
           if nodeGrid[k]*cellGrid[k] == 1 :
             cellGrid[k] = 2
             print 'cellGrid[%i] has been adjusted to 2'                  
         self.next_id = 0
         self.pmiinit(system, nodeGrid, cellGrid)
       else:
         print 'Error: could not create DomainDecomposition object'
Beispiel #2
0
 def getFoldedPosition(self, pos, imageBox=None):
     if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup() or pmi.isController:
         if imageBox is None:
             return self.cxxclass.getFoldedPosition(self, toReal3DFromVector(pos))
         else:
             return self.cxxclass.getFoldedPosition(
                 self, toReal3DFromVector(pos), toInt3DFromVector(imageBox))
        def __init__(self, system, 
                     nodeGrid='auto', 
                     cellGrid='auto'):
            if nodeGrid == 'auto':
                nodeGrid = Int3D(system.comm.rank, 1, 1)
            else:
                nodeGrid = toInt3DFromVector(nodeGrid)

            if cellGrid == 'auto':
                # TODO: Implement
                raise 'Automatic cell size calculation not yet implemented'
            else:
                cellGrid = toInt3DFromVector(cellGrid)

            self.next_id = 0
            self.pmiinit(system, nodeGrid, cellGrid)
 def imageBox(self, val): self.__getTmp().imageBox = toInt3DFromVector(val)
 
 @property