def test_refinement_grid_1d_general_orientation(self): x = np.array([0, 2, 6]) * np.ones((3, 1)) g = TensorGrid(x[0]) g.nodes = x h = refinement.refine_grid_1d(g, ratio=2) self.assertTrue( np.allclose( h.nodes, np.array([[0, 1, 2, 4, 6], [0, 1, 2, 4, 6], [0, 1, 2, 4, 6]])))
def test_refinement_grid_1d_non_uniform(self): x = np.array([0, 2, 6]) g = TensorGrid(x) h = refinement.refine_grid_1d(g, ratio=2) self.assertTrue(np.allclose(h.nodes[0], np.array([0, 1, 2, 4, 6])))