Exemplo n.º 1
0
        def __init__(self,
                     system,
                     nodeGrid='auto',
                     cellGrid='auto',
                     nocheck=False):
            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':
                        raise Exception(
                            'Automatic cell size calculation not yet implemented'
                        )
                    else:
                        cellGrid = toInt3DFromVector(cellGrid)

                    for k in xrange(3):
                        if nodeGrid[k] * cellGrid[k] == 1:
                            print(("Warning! cellGrid[{}] has been "
                                   "adjusted to 2 (was={})".format(
                                       k, cellGrid[k])))
                            cellGrid[k] = 2
                    self.next_id = 0
                    self.pmiinit(system, nodeGrid, cellGrid)
                else:
                    raise Exception(
                        'Error: could not create DomainDecomposition object')
Exemplo n.º 2
0
 def __init__(self, system,
              nodeGrid='auto',
              cellGrid='auto',
              halfCellInt = 'auto',
              nocheck=False):
     # do sanity checks for the system first
     if nocheck:
         self.next_id = 0
         self.pmiinit(system, nodeGrid, cellGrid, halfCellInt)
     else:
         if check.System(system, 'bc'):
             if nodeGrid == 'auto':
                 nodeGrid = decomp.nodeGridSimple(system.comm.rank)
             else:
                 nodeGrid = toInt3DFromVector(nodeGrid)
             if cellGrid == 'auto':
                 cellGrid = Int3D(2,2,2)
             else:
                 cellGrid = toInt3DFromVector(cellGrid)
             if halfCellInt == 'auto':
                 halfCellInt = 1
             # minimum image convention check:
             for k in range(3):
                 if nodeGrid[k]*cellGrid[k] == 1 :
                     print(("Warning! cellGrid[{}] has been "
                            "adjusted to 2 (was={})".format(k, cellGrid[k])))
                     cellGrid[k] = 2
             self.next_id = 0
             self.pmiinit(system, nodeGrid, cellGrid, halfCellInt)
         else:
             print('Error: could not create DomainDecomposition object')
        def __init__(self,
                     system,
                     nodeGrid='auto',
                     cellGrid='auto',
                     neiListx='auto',
                     neiListy='auto',
                     neiListz='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)
            if neiListx == 'auto':
                neiListx = 0
            else:
                neiListx = neiListx
            if neiListy == 'auto':
                neiListy = 0
            else:
                neiListy = neiListy
            if neiListz == 'auto':
                neiListz = 0
            else:
                neiListz = neiListz
            self.next_id = 0
            self.pmiinit(system, nodeGrid, cellGrid, neiListx, neiListy,
                         neiListz)
Exemplo n.º 4
0
 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 :
             print(("Warning! cellGrid[{}] has been "
                    "adjusted to 2 (was={})".format(k, cellGrid[k])))
             cellGrid[k] = 2
         self.next_id = 0
         self.pmiinit(system, nodeGrid, cellGrid)
       else:
         print 'Error: could not create DomainDecomposition object'
        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)
Exemplo n.º 6
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))
Exemplo n.º 7
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', nocheck=False):
            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':
                        raise Exception('Automatic cell size calculation not yet implemented')
                    else:
                        cellGrid = toInt3DFromVector(cellGrid)

                    for k in xrange(3):
                        if nodeGrid[k]*cellGrid[k] == 1:
                            print(("Warning! cellGrid[{}] has been "
                                   "adjusted to 2 (was={})".format(k, cellGrid[k])))
                            cellGrid[k] = 2
                    self.next_id = 0
                    self.pmiinit(system, nodeGrid, cellGrid)
                else:
                    raise Exception('Error: could not create DomainDecomposition object')
Exemplo n.º 9
0
 def __init__(self,
              system,
              nodeGrid='auto',
              neiListx='auto',
              neiListy='auto',
              neiListz='auto',
              nocheck=False):
     # do sanity checks for the system first
     if nocheck:
         self.next_id = 0
         self.pmiinit(system, nodeGrid, neiListx, neiListy,
                      neiListz)  # H check
     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 = cellGrid
             if neiListx == 'auto':
                 neiListx = neiListx
             else:
                 neiListx = neiListx
             if neiListy == 'auto':
                 neiListy = neiListy
             else:
                 neiListy = neiListy
             if neiListz == 'auto':
                 neiListz = neiListz
             else:
                 neiListz = neiListz
             # minimum image convention check:
             self.next_id = 0
             self.pmiinit(system, nodeGrid, neiListx, neiListy,
                          neiListz)
         else:
             print 'Error: could not create DomainDecomposition object'
Exemplo n.º 10
0
 def imageBox(self, val):
     self.__getTmp().imageBox = toInt3DFromVector(val)
Exemplo n.º 11
0
    def imageBox(self, val): self.__getTmp().imageBox = toInt3DFromVector(val)

    @property