Example #1
0
 def _test(self, points, centroids, lengths, widths, areas):
     fake_coords = numpy.array([[0]])
     self.points = numpy.array(points, dtype=float)
     mesh = RectangularMesh(fake_coords, fake_coords, fake_coords)
     cell_center, cell_length, cell_width, cell_area \
             = mesh.get_cell_dimensions()
     self.assertTrue(numpy.allclose(cell_length, lengths),
                     '%s != %s' % (cell_length, lengths))
     self.assertTrue(numpy.allclose(cell_width, widths),
                     '%s != %s' % (cell_width, widths))
     self.assertTrue(numpy.allclose(cell_area, areas),
                     '%s != %s' % (cell_area, areas))
     self.assertTrue(numpy.allclose(cell_center, centroids),
                     '%s != %s' % (cell_center, centroids))
Example #2
0
 def _test(self, points, centroids, lengths, widths, areas):
     fake_coords = numpy.array([[0]])
     self.points = numpy.array(points, dtype=float)
     mesh = RectangularMesh(fake_coords, fake_coords, fake_coords)
     cell_center, cell_length, cell_width, cell_area \
             = mesh.get_cell_dimensions()
     self.assertTrue(numpy.allclose(cell_length, lengths),
                     '%s != %s' % (cell_length, lengths))
     self.assertTrue(numpy.allclose(cell_width, widths),
                     '%s != %s' % (cell_width, widths))
     self.assertTrue(numpy.allclose(cell_area, areas),
                     '%s != %s' % (cell_area, areas))
     self.assertTrue(numpy.allclose(cell_center, centroids),
                     '%s != %s' % (cell_center, centroids))