예제 #1
0
 def bondsMatch(self, inType, outBond, inParams, outParams, msg_long):
     """Check, if the bond type set and gotten back as well as the bond
     parameters set and gotten back match. Only check keys present in
     ``inParams``.
     """
     self.assertEqual(outBond, inType, msg="Bonded interaction mismatch")
     assert_params_match(self, inParams, outParams, msg_long)
 def intersMatch(self, inType, outInter, inParams, outParams, msg_long):
     """Check, if the interaction type set and gotten back as well as the
     bond parameters set and gotten back match. Only check keys present in
     ``inParams``.
     """
     self.assertIsInstance(outInter, inType)
     tests_common.assert_params_match(self, inParams, outParams, msg_long)
예제 #3
0
    def test(self):
        system = espressomd.System(box_l=[10.0, 10.0, 10.0])
        test_params = {}
        test_params["prefactor"] = 2
        test_params["cao"] = 2
        test_params["r_cut"] = 0.9
        test_params["accuracy"] = 1e-1
        test_params["mesh"] = [10, 10, 10]
        test_params["epsilon"] = 20.0
        test_params["alpha"] = 1.1
        test_params["tune"] = False

        p3m = espressomd.electrostatics.P3MGPU(**test_params)
        system.actors.add(p3m)
        tests_common.assert_params_match(self, test_params, p3m.get_params())
예제 #4
0
 def test_cell_system(self):
     parameters = {
         "n_square": {
             "use_verlet_lists": False
         },
         "regular_decomposition": {
             "use_verlet_lists": True
         },
         "hybrid_decomposition": {
             "use_verlet_lists": False,
             "n_square_types": [1, 3, 5],
             "cutoff_regular": 1.27
         },
     }
     for cell_system, params_in in parameters.items():
         setter = getattr(self.system.cell_system, f"set_{cell_system}")
         setter(**params_in)
         params_in["decomposition_type"] = cell_system
         params_out = self.system.cell_system.get_params()
         tests_common.assert_params_match(self, params_in, params_out)
         params_out = self.system.cell_system.get_state()
         tests_common.assert_params_match(self, params_in, params_out)