コード例 #1
0
ファイル: __init__.py プロジェクト: Clemson-MSE/espressopp
 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))
コード例 #2
0
ファイル: __init__.py プロジェクト: alamoth/espressopp
 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))
コード例 #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))
コード例 #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))
コード例 #5
0
ファイル: SlabBC.py プロジェクト: xzhh/espressopp
 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))
コード例 #6
0
ファイル: SlabBC.py プロジェクト: xzhh/espressopp
 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))