コード例 #1
0
ファイル: bulk_properties.py プロジェクト: wever/mdcore
 def test_elastic_constants(self):
     for pot, par, mats in tests:
          test_cubic_elastic_constants(mats, pot, par, sx, dev_thres,
                                      test=self)
コード例 #2
0
ファイル: bulk_properties.py プロジェクト: wever/mdcore
        dict( name="dia-Si-C", struct=B3( [ "Si", "C" ], latticeconstant=4.3596,
                                          size=[sx,sx,sx]),
              Ec=6.165, a0=4.321, C11=437, C12=118, C440=311, B=224 ),
        ] ),
    ]

###

class TestElasticConstants(unittest.TestCase):

    def test_elastic_constants(self):
        for pot, par, mats in tests:
             test_cubic_elastic_constants(mats, pot, par, sx, dev_thres,
                                         test=self)

###

if __name__ == '__main__':
    for pot, par, mats in tests:
        if len(sys.argv) > 1:
            found = False
            if par is not None:
                for keyword in sys.argv[1:]:
                    if '__ref__' in par:
                        if par['__ref__'].lower().find(keyword.lower()) != -1:
                            found = True
            if not found:
                continue

        test_cubic_elastic_constants(mats, pot, par, sx, dev_thres)