def test_division(): h5store = 'small_hexagonal.hf5' datasets = load_datasets(h5store, data_names=['face', 'vert', 'edge']) specs = sheet_spec() sheet = Sheet('emin', datasets, specs) geom.update_all(sheet) Nf, Ne, Nv = sheet.Nf, sheet.Ne, sheet.Nv cell_division(sheet, 17, geom) assert sheet.Nf - Nf == 1 assert sheet.Nv - Nv == 2 assert sheet.Ne - Ne == 6
def test_division(): h5store = os.path.join(stores_dir, "small_hexagonal.hf5") datasets = load_datasets(h5store, data_names=["face", "vert", "edge"]) specs = cylindrical_sheet() sheet = Sheet("emin", datasets, specs) geom.update_all(sheet) Nf, Ne, Nv = sheet.Nf, sheet.Ne, sheet.Nv cell_division(sheet, 17, geom) assert sheet.Nf - Nf == 1 assert sheet.Nv - Nv == 2 assert sheet.Ne - Ne == 6
def test_x_and_y_boundary_celldiv(): dsets = hdf5.load_datasets( Path(stores.stores_dir) / "planar_periodic8x8.hf5") specs = config.geometry.planar_sheet() specs["settings"]["boundaries"] = {"x": [-0.1, 8.1], "y": [-0.1, 8.1]} sheet = Sheet("periodic", dsets, specs) coords = ["x", "y"] draw_specs = config.draw.sheet_spec() PlanarGeometry.update_all(sheet) Nf = sheet.Nf # arbitrarily choose a cells on x_boundary and y_boundary to divide div_cell = sheet.face_df.index[(sheet.face_df["at_x_boundary"] == True) & (sheet.face_df["at_y_boundary"] == True)][0] daughter = cell_division(sheet, div_cell, PlanarGeometry, angle=0.6) assert sheet.validate() assert sheet.Nf == Nf + 1