def test_fmin(): eptm = lj.Epithelium(graphXMLfile=lj.data.small_xml(), save_dir=tmp_dir, identifier='test_epithelium', copy=True) eptm.isotropic_relax() mother_cell = _get_cell(eptm) area0 = eptm.cells.areas[mother_cell] growth_rate = 1.5 eptm.cells.prefered_vol[mother_cell] *= growth_rate eptm.set_local_mask(None) eptm.set_local_mask(mother_cell, wider=True) pos0, pos1 = lj.find_energy_min(eptm) print(eptm.cells.areas[mother_cell] / area0) assert_almost_equal(eptm.cells.areas[mother_cell] / area0, 1.568, decimal=3)
def show_optimisation(eptm, **kwargs): #eptm.update_gradient() pos0, pos1 = lj.find_energy_min(eptm, **kwargs) return pos0, pos1