Example #1
0
    def test_equality_condition(self):
        """testing if the equality condition works here to; it is
        inherited from the parent class 'Particle'
        """

        particle1 = base_classes.Quartz(x=0, y=0, diameter=10)
        particle2 = base_classes.Quartz(x=0, y=0, diameter=10)
        self.assertNotEqual(particle1, particle2)
Example #2
0
    def test_ascending_particle_number(self):
        """testing if the particle number thing works in this class too
        in the ascending manner; it should be correctly inherited from
        the parent class 'Particle'
        """

        particle1 = base_classes.Quartz(x=0, y=0, diameter=10)
        particle2 = base_classes.Quartz(x=0, y=0, diameter=10)
        self.assertEqual(particle1.num + 1, particle2.num)
Example #3
0
    def test_mass(self):
        """testing if the Quartz instance returns a correct mass; this
        is inherited from the parent class 'Particle'
        """

        particle = base_classes.Quartz(x=1, y=1, diameter=10)
        exp = base_classes.Quartz.density * (np.math.pi * 10**2) / 4
        self.assertAlmostEqual(particle.mass, exp)
Example #4
0
    def test_hashable(self):
        """testing if the particle being hashable works here too; it is
        inherited from the parent class 'Particle'
        """

        particle = base_classes.Quartz(x=0, y=0, diameter=10)
        s = {particle}
        self.assertTrue(s)
    'size_lower_bound': 2000,
    'quantity': 20
}
quartz_sand1 = {
    'type': 'quartz',
    'size_upper_bound': 10000,
    'size_lower_bound': 8000,
    'quantity': 25
}
container = base_classes.Container(length=100000,
                                   width=100000,
                                   particles_info=[kaolinite_clay2],
                                   time_step=0.01,
                                   simulation_type='tt',
                                   fluid_characteristics=None)
particle1 = base_classes.Quartz(x=5000, y=5000, length=10000, hierarchy=0)
particle2 = base_classes.Kaolinite(x=53000,
                                   y=53000,
                                   length=5000,
                                   thickness=2,
                                   inclination=-1 * np.math.pi / 4,
                                   hierarchy=1)
particle3 = base_classes.Kaolinite(x=50000,
                                   y=50000,
                                   length=5000,
                                   thickness=2,
                                   inclination=np.math.pi / 4,
                                   hierarchy=1)
particle4 = base_classes.Kaolinite(x=5000,
                                   y=5000,
                                   length=9000,