Ejemplo n.º 1
0
 def failIfAlmostEqualReal3D(self, first, second, places=7, msg=None):
     """Fail if the two objects are equal as determined by their
     difference rounded to the given number of decimal places
     (default 7) and comparing to zero.
     
     Note that decimal places (from zero) are usually not the same
     as significant digits (measured from the most signficant digit).
     """
     first = toReal3D(first)
     second = toReal3D(second)
     if round(abs(second.x-first.x), places) == 0 and \
             round(abs(second.y-first.y), places) == 0 and \
             round(abs(second.z-first.z), places) == 0:
         raise self.failureException, \
             (msg or '%r == %r within %r places' % (first, second, places))
Ejemplo n.º 2
0
 def failIfAlmostEqualReal3D(self, first, second, places=7, msg=None):
     """Fail if the two objects are equal as determined by their
     difference rounded to the given number of decimal places
     (default 7) and comparing to zero.
     
     Note that decimal places (from zero) are usually not the same
     as significant digits (measured from the most signficant digit).
     """
     first = toReal3D(first)
     second = toReal3D(second)
     if round(abs(second.x-first.x), places) == 0 and \
             round(abs(second.y-first.y), places) == 0 and \
             round(abs(second.z-first.z), places) == 0:
         raise self.failureException, \
             (msg or '%r == %r within %r places' % (first, second, places))
Ejemplo n.º 3
0
 def setBoxL(self, boxL):
     if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup():
         self.cxxclass.boxL.fset(self, toReal3D(boxL))
Ejemplo n.º 4
0
 def __init__(self, rng, boxL=1.0):
     if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup() or pmi.isController:
         cxxinit(self, bc_OrthorhombicBC, rng, toReal3D(boxL))
Ejemplo n.º 5
0
 def setBoxL(self, boxL):
     if not (pmi._PMIComm and pmi._PMIComm.isActive()
             ) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup():
         self.cxxclass.boxL.fset(self, toReal3D(boxL))
Ejemplo n.º 6
0
 def __init__(self, rng, boxL=1.0):
     if not (pmi._PMIComm and pmi._PMIComm.isActive()
             ) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup(
             ) or pmi.isController:
         cxxinit(self, bc_SlabBC, rng, toReal3D(boxL))