Skip to content
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

periodic boundary #12

Open
Mobinati opened this issue Jul 15, 2024 · 10 comments
Open

periodic boundary #12

Mobinati opened this issue Jul 15, 2024 · 10 comments

Comments

@Mobinati
Copy link

hello there, I have been trying to find a way to have a periodic boundary where cells would be limited to a box and I finally got to this notebook : PeriodicBoundaryConditions.ipynb

where it uses some modules as this:

from cgal4py.delaunay import Delaunay2, PeriodicDelaunay2

But there is an issue for matching the libraries of CGAL and cgal4py that I can't make it work.

I know that some functions, like Division, boundary cells can be read. but the idea of right side cells being part of left side cells in a way of being counted in energy minimization, I still am not sure how to do it.

appericiate if you could give a hint.

@glyg
Copy link
Member

glyg commented Aug 29, 2024

Hi @Mobinati sorry for the late reply
Sorry but I did not author the periodic boundaries bit, and unfortunately my regular job does not allow me much time on tyssue these days.

I don't even remember porting cgal4py code to python 3

Sorry I can't be of more help :/

@Mobinati
Copy link
Author

Mobinati commented Aug 30, 2024 via email

@Mobinati
Copy link
Author

Mobinati commented Oct 4, 2024 via email

@glyg
Copy link
Member

glyg commented Oct 7, 2024

Hi @Mobinati it's @gcourcou who worked on that (4 years ago!) Hopefully he'll be able to give you a hand
Sorry again I can't !

G

@gcourcou
Copy link

gcourcou commented Oct 8, 2024

Hello @Mobinati and @glyg ,

I am going to have to find some old code to figure this out. Did you want constant size boundaries or expanding?

Looking at some code quickly, let me know if any of it helps:

from tyssue import config, Sheet
from tyssue import PlanarGeometry
from tyssue import stores
from tyssue.solvers.quasistatic import QSSolver
from tyssue.dynamics.planar_vertex_model import PlanarModel as model

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']
PlanarGeometry.update_all(sheet)

## solver
solver = QSSolver(with_collisions=False, with_t1=True, with_t3=True)
nondim_specs = config.dynamics.quasistatic_plane_spec()
dim_model_specs = model.dimensionalize(nondim_specs)
sheet.update_specs(dim_model_specs, reset=True)
###


solver.find_energy_min(sheet, PlanarGeometry, model, periodic=True)

Seems that the periodic boundary that I used was loaded from a pre-configured file named 'planar_periodic8x8.hf5' after that I used periodic=True in the find_energy_min function.

Also did you check this test resource?
https://github.com/DamCB/tyssue/blob/c15063e0ae3ee29e178180f157d7113723a7b247/tests/solvers/test_periodic_sheet.py

@Mobinati
Copy link
Author

Mobinati commented Oct 9, 2024 via email

@gcourcou
Copy link

gcourcou commented Oct 9, 2024

Hey @glyg ! I worked on having expanding boundaries during cell division (basically made the boundary box size a model variable for energy minimization).

@Mobinati for periodic boundaries, the code above should give you the information you need ! (set periodic=False if you do not want the boundaries to expand). Let me know if you need more help.

@glyg
Copy link
Member

glyg commented Oct 10, 2024

Thanks a lot for reaching out @gcourcou !

@Mobinati
Copy link
Author

Hey @glyg ! I worked on having expanding boundaries during cell division (basically made the boundary box size a model variable for energy minimization).

@Mobinati for periodic boundaries, the code above should give you the information you need ! (set periodic=False if you do not want the boundaries to expand). Let me know if you need more help.

thanks a lot @gcourcou and @glyg for your responses and follow up. I still haven't been able to run your code there are several errors of

"Expression (np.float64(1.0)) / ((np.float64(4.0)) * (sub_area)) has forbidden control characters."

popping up; I am trying to solve it first. but I would send here the feedback if it works.
thanks a lot for spending time solving my problem.

@Mobinati
Copy link
Author

hello there @gcourcou and @glyg. thanks for the codes. I could successfully run the code but this is the tissue I get:

Screenshot from 2024-09-07 00-44-26
I tried to re-install CGAL and then tyssue again as I got the error: "collision solver could not be imported You may need to install CGAL and re-install tyssue". I tried it in several environments with different tissue versions. nut I think the problem is that I install tyssue independently from CGAL. and I don't know how to make tyssue use CGAL. do you have any instructions for how to reinstall tyssue in a way it would use CGAL so I can have the pbc on my tissue please?

Bests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants