Beispiel #1
0
    def test_dHdpos(self):
        phase_shift = 0.0
        multiplicity = 1.0
        amplitude = 1.0
        y_offset = 0.0
        radians = False

        positions = [0, 90, 180, 270, 360]
        expected_result = np.array([0, 2, 0, -2, 0])

        WavePotential = pot.wavePotential(phase_shift=phase_shift,
                                          multiplicity=multiplicity,
                                          amplitude=amplitude,
                                          y_offset=y_offset,
                                          radians=radians)
        WavePotential2 = pot.wavePotential(phase_shift=phase_shift,
                                           multiplicity=multiplicity,
                                           amplitude=amplitude,
                                           y_offset=y_offset,
                                           radians=radians)
        potential = pot.torsionPotential(
            wave_potentials=[WavePotential, WavePotential2])
        energies = potential.dhdpos(positions)

        self.assertEqual(
            type(expected_result),
            type(energies),
            msg=
            "returnType of potential was not correct! it should be an np.array"
        )
        np.testing.assert_almost_equal(desired=list(expected_result),
                                       actual=list(energies),
                                       err_msg="The results of " +
                                       potential.name + " are not correct!",
                                       decimal=8)
Beispiel #2
0
 def test_constructor_ListPotentials(self):
     WavePotential = pot.wavePotential()
     WavePotential2 = pot.wavePotential()
     potential = pot.torsionPotential(
         wave_potentials=[WavePotential, WavePotential2])
Beispiel #3
0
 def test_constructor_SinglePotential(self):
     WavePotential = pot.wavePotential()
     potential = pot.torsionPotential(wave_potentials=WavePotential)