-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rearrangement (T1&T3) with QS Solver #257
Comments
oh yes there clearly is a bug there, can you post the code to reproduce? |
When I use the manager to perform T1, I switch off Here is the code : def sheet_init(nx, ny, gamma_0=0.5, phi=np.pi / 2, noise=0.2):
sheet = Sheet.planar_sheet_2d(
'sheet', nx=nx, ny=ny, distx=1, disty=1, noise=noise)
# Cut at the border to avoid strange cells
to_cut = sheet.cut_out([(0.1, nx), (0.1, ny)])
sheet.update_specs({"edge": {"gamma_0": gamma_0,
"phi0": phi},
})
geom.update_all(sheet)
sheet.remove(to_cut, trim_borders=True)
sheet.sanitize(trim_borders=True)
geom.update_all(sheet)
# Center sheet to (0,0)
geom.center(sheet)
geom.update_all(sheet)
sheet.edge_df["opposite"] = sheet.get_opposite()
return sheet, geom
nx = 20
ny = 20
noise = 0.3
gamma_0 = 0.
phi_apical = np.pi/2
phi_basal = 0
apical_sheet, geom = sheet_init(nx, ny, gamma_0, phi_apical, phi_basal, noise)
apical_sheet.get_opposite()
apical_sheet.update_specs({"settings":{"dt":0.01,
'threshold_length': 0.01,
'p_4': 0.1,
'p_5p': 0.01,}})
apical_sheet.face_df['prefered_area'] = 1.
apical_sheet.face_df['area_elasticity'] = 1.
apical_sheet.face_df['prefered_perimeter'] = 3*np.sqrt(apical_sheet.face_df['prefered_area'] )
apical_sheet.face_df['perimeter_elasticity'] = 1.
apical_sheet.vert_df['viscosity'] = 1.0
apical_sheet.edge_df['is_active'] = 1
apical_sheet_init = apical_sheet.copy(deep_copy=True)
#T1 with Solver
apical_sheet = apical_sheet_init.copy(deep_copy=True)
# Solver
solver_qs = QSSolver(with_t1=True, with_t3=True, with_collisions=False)
# Model
model = model_factory(
[
effectors.FaceAreaElasticity,
effectors.PerimeterElasticity,
])
for i in range(20):
# print(i)
res = solver_qs.find_energy_min(apical_sheet, PlanarGeometry, model, periodic=False, options={"gtol": 1e-8})
if res.success is False:
print (res)
apical_sheet.vert_df[["x", "y"]] += np.random.normal(scale=1e-3, size=(apical_sheet.Nv, 2))
PlanarGeometry.update_all(apical_sheet)
#T1 with Manager
apical_sheet = apical_sheet_init.copy(deep_copy=True)
# Solver
solver_qs = QSSolver(with_t1=False, with_t3=False, with_collisions=False)
# Manager
manager = EventManager('face')
manager.append(reconnect)
# Model
model = model_factory(
[
effectors.FaceAreaElasticity,
effectors.PerimeterElasticity,
])
for i in range(20):
manager.execute(apical_sheet)
res = solver_qs.find_energy_min(apical_sheet, PlanarGeometry, model, periodic=False, options={"gtol": 1e-8})
if res.success is False:
print (res)
apical_sheet.vert_df[["x", "y"]] += np.random.normal(scale=1e-3, size=(apical_sheet.Nv, 2))
PlanarGeometry.update_all(apical_sheet)
manager.update() |
Hi, It seems that with a planar monolayer, there is some issue when running |
HI, yes I think there is a bug in |
great!! |
Hi,
I proceed to some cell rearrangement with a 2D sheet, and the
QSSolver
. It seems to me that rearrangement proceed in the solver directly doesn't work very well compare to the ones proceed with the manager. And at the end, tissue looks to be more physiologic with the manager.As example, the initial state:
With T1&T3 proceed with QSSolver:
With the manager:
Should we put as deprecated
with_t1
andwith_t3
parameters functions in theQSSolver
as it is for theEulerSolver
? If yes, I can do it in the next PR.Sophie
The text was updated successfully, but these errors were encountered: