def __init__(self, figure, grid, bounding_box=None, U=None, vmin=None, vmax=None, codim=2, columns=2, colorbar=True, sync_timer=None):
    assert (grid.reference_element in (triangle, square))
    assert (grid.dim == 2)
    assert (codim in (0, 2))
    (subentities, coordinates, entity_map) = flatten_grid(grid)
    self.subentities = (subentities if (grid.reference_element is triangle) else np.vstack((subentities[:, 0:3], subentities[:, [2, 3, 0]])))
    self.coordinates = coordinates
    self.entity_map = entity_map
    self.reference_element = grid.reference_element
    self.colorbar = colorbar
    self.animate = self.set
    if (bounding_box is None):
        bounding_box = grid.bounding_box()
    assert ((len(bounding_box) == 2) and all(((len(b) == 2) for b in bounding_box)))
    aspect_ratio = ((bounding_box[1][1] - bounding_box[0][1]) / (bounding_box[1][0] - bounding_box[0][0]))
    super().__init__(U=U, figure=figure, grid=grid, vmin=vmin, vmax=vmax, codim=codim, columns=columns, sync_timer=sync_timer, aspect_ratio=aspect_ratio)
def __init__(self, figure, grid, bounding_box=None, U=None, vmin=None, vmax=None, codim=2, columns=2, colorbar=True, sync_timer=None):
    assert (grid.reference_element in (triangle, square))
    assert (grid.dim == 2)
    assert (codim in (0, 2))
    (subentities, coordinates, entity_map) = flatten_grid(grid)
    self.subentities = (subentities if (grid.reference_element is triangle) else np.vstack((subentities[:, 0:3], subentities[:, [2, 3, 0]])))
    self.coordinates = coordinates
    self.entity_map = entity_map
    self.reference_element = grid.reference_element
    self.colorbar = colorbar
    self.animate = self.set
    if (bounding_box is None):
        bounding_box = grid.bounding_box()
    assert ((len(bounding_box) == 2) and all(((len(b) == 2) for b in bounding_box)))
    aspect_ratio = ((bounding_box[1][1] - bounding_box[0][1]) / (bounding_box[1][0] - bounding_box[0][0]))
    super().__init__(U=U, figure=figure, grid=grid, vmin=vmin, vmax=vmax, codim=codim, columns=columns, sync_timer=sync_timer, aspect_ratio=aspect_ratio)