def test_frac_4(self):
     # Fracture plane defined by x + y + z = 4
     f_1 = Fracture(np.array([[0, 1, 1, 0],
                              [0, 0, 1, 1],
                              [4, 3, 2, 3]]))
     c_known = np.array([0.5, 0.5, 3])
     assert np.allclose(c_known, f_1.center)
 def test_frac_3(self):
     # Fracture plane defined by x + y + z = 1
     f_1 = Fracture(np.array([[0, 1, 1, 0],
                              [0, 0, 1, 1],
                              [1, 0, -1, 0]]))
     c_known = np.array([0.5, 0.5, 0])
     assert np.allclose(c_known, f_1.center)
 def test_frac_rand(self):
     r = np.random.rand(4)
     x = np.array([0, 1, 1, 0])
     y = np.array([0, 0, 1, 1])
     z = (r[0] - r[1] * x - r[2] * y) / r[3]
     f = Fracture(np.vstack((x, y, z)))
     z_cc = (r[0] - 0.5 * r[1] - 0.5 * r[2]) / r[3]
     c_known = np.array([0.5, 0.5, z_cc])
     assert np.allclose(c_known, f.center)
 def test_full_incline(self):
     p = np.array([[-0.5, 0.5, 0.5, -0.5], [0.5, 0.5, 1.5, 1.5],
                   [-0.5, -0.5, 1, 1]])
     f = Fracture(p)
     network = FractureNetwork([f])
     network.impose_external_boundary(self.domain)
     p_known = np.array([[0., 0.5, 0.5, 0], [5. / 6, 5. / 6, 1, 1],
                         [0., 0., 0.25, 0.25]])
     assert len(network._fractures) == 1
     p_comp = network._fractures[0].p
     assert self._arrays_equal(p_known, p_comp)
 def setup(self):
     self.f_1 = Fracture(
         np.array([[0, 1, 1, 0], [.5, .5, .5, .5], [0, 0, 1, 1]]))
 def test_frac_1(self):
     f_1 = Fracture(np.array([[0, 2, 2, 0],
                              [0, 2, 2, 0],
                              [-1, -1, 1, 1]]))
     c_known = np.array([1, 1, 0])
     assert np.allclose(c_known, f_1.center)