{"id":18634595,"url":"https://github.com/abrg-models/tessellations","last_synced_at":"2025-11-04T11:30:30.617Z","repository":{"id":77802493,"uuid":"385953830","full_name":"ABRG-Models/Tessellations","owner":"ABRG-Models","description":"Code for the paper Biological Action at a Distance","archived":false,"fork":false,"pushed_at":"2022-02-23T11:47:05.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-27T08:27:08.768Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ABRG-Models.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-14T13:39:18.000Z","updated_at":"2022-06-21T06:08:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"2a0b4a89-2344-41ef-ac27-841562145213","html_url":"https://github.com/ABRG-Models/Tessellations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ABRG-Models%2FTessellations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ABRG-Models%2FTessellations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ABRG-Models%2FTessellations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ABRG-Models%2FTessellations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ABRG-Models","download_url":"https://codeload.github.com/ABRG-Models/Tessellations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239432873,"owners_count":19637799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T05:19:45.519Z","updated_at":"2025-11-04T11:30:30.572Z","avatar_url":"https://github.com/ABRG-Models.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tessellations\nCode for the paper Biological Action at a Distance\n\n\nTo clone this project and its associated git submodule [morphologica](https://github.com/ABRG-Models/morphologica), use this command:\n\n```\ngit clone --recurse-submodules git@github.com:ABRG-Models/Tessellations.git\n```\n\nThis repository contains the code needed to evolve the Keller-Segel equations on a hexagonal\ngrid. A Voronoi tessellation is created using a number of randomly selected seedpoints which\nare created by running the **setCentres.cpp** program to produce **centres.inp**. The main program\nthen computes solutions on this Voronoi tessellation using Runge-Kutta integration of the\nequations adapted for a hexagonal grid. There are three separate integrations, the first on\nthe actual Voronoi tessellation, the second on the same regions but with the corners rounded and\nthe third with a second application of the rounding algorithm. In these last two the diffusion\nand chemotaxis constants are adjusted by the ratio of the square root of the original region area\ndivided by the square root of the rounded area. This is to ensure that the effects of rounding are\nnot contaminated by the effects of changing the area of the region. The json scripts contains a\nswitch which allows this adjustment to be turned off.\n\nThe programs and scripts in this repository allow the reproduction of Figures 3d and 3e of the paper.\n\nAll output files are written to the **logsMorph** directory.\n\nThe files used for determining the distribution of correlations all have\ncorrelation in their name and their suffix is .data. These files relate to the plots in figure 1 of the paper\n\"Biological Action at a Distance: Correlated pattern formation in adjacent tessellation domains without communication\"\nThere is a matlab script \"correlationMorph.m\" that produces histograms of the distributions in the **logsMorph**\ndirectory.\n\nThe code utilises the morphologica library which is included in the git download from Tessellations. The main\nprogram **pFieldVis.cpp** also uses .h files which are in the top directory\n**region.h** defines a Voronoi tesselation on a hexagonal grid and defines all the methods for integrating\nthe Keller-Segel equations and analyzing the results.\n**ksSolver.h** provides a Keller-Segel solver for the morphed grids which need to be solved in a different way to the\noriginal tessellation.\n**hexGeometry.h** provides a class and methods for creating and manipulating geometric objects on a hexagonal grid.\n**analysis.h** provides helper functions for the other classes.\n\nTo compile the code carry out the following actions, starting from the Tessellations directory:\n\n```\nmkdir build; pushd build\ncmake ..\nmake setCentres\nmake pFieldVis\npopd # To return to the parent Tessellations directory\n```\n\nYou can now run the code from a cold start, i.e from intial random fields.\n\nFirst, if it does not exist, create the **logsMorph** directory\n\n```\nmkdir logsMorph\n```\n\n**pFieldVisjson.sh** is a script which writes out the json configuration file **pFieldVis.json**. The script takes three arguments so that the parameters **Dn**, **Dchi** and **Dc** can be set in the json.\nYou can edit the script **pFieldVisjson.sh** if you wish to change any of the other parameters that are written out in the **pFieldVis.json** file.\n**pFieldVis.json** will be read by the main program when it runs from the scripts **coldpFieldVis.py** and **warmpFieldVis.py**.\n\nTo observe how **pFieldVisjson.sh** creates pFieldVis.json with your own parameters, try:\n```\n./pFieldVisjson.sh 1 2 3\n```\nthen examine the text file **pFieldVis.json**.\n\nThe script **coldpFieldVis.py** will run **setCentres**, **pFieldVisjson.sh** and finally the main program **pFieldVis** from a cold start, i.e. from random initial fields:\n```\npython coldpFieldVis.py\n```\nIt will create several windows in which will appear visualisations of the simulations and it will exit once the simulations have completed.\n\nSometimes the following error message appears and the program crashes.\n```\n\"terminate called after throwing an instance of 'std::runtime_error'\n  what():  t out of range [0,1]\nAborted (core dumped)\"\n```\nIn this case simply running the script again will produce a different tessellation and the program should complete. It seems\nthat every so often a tessellation is created by **setCentres.cpp** that triggers an error message from the morphologica\nlibraries. We are investigating this issue and will update\nthe software when it is solved.\n\nTo produce the correlation histograms run the matlab script **correlationMorph.m**. To produce sufficiently representative\nsample of the full distribution you need to run **coldpFieldVis.py** at least 10 times. Do not clean up the files after\neach run since each run will add a new set of correlations based on a new random Voronoi tessellation.\n\nTo produce the alpha values and histograms of Fig3d and Fig3e run the following four python scripts\nFig3dAdj.py Fig3dRand.py Fig3eAdj.py Fig3eRan.py\n\nAll the output files will be in **logsMorph**.\n\nIf you want to run with different parameters you will need to cleanup logsMorph otherwise the new results will be appended\nto the old data files. If you want to do a continuation run then you may not want to do this because you may wish the\nnew results to be appended to the old.\n```\n./cleanOutput.sh\n```\nThis will leave the startup files in **logsMorph** which have the suffix .h5\n\nIf you wish to continue, starting from the state of the previous runs, change the relevant parameter (Lcontinue) in **pFieldjson.sh** and run\n```\npython warmpFieldVis.py\n```\nyou can continue the run at the same parameters or else at different ones this is set in the **warmpFieldVis.py** script. If\nyou try a continuation run by using **coldpFieldVis.sh** you will get severe errors because the tessellation seedpoints will\nhave been changed so the domains are different.\n\nThe startup .h5 files (**first.h5**, **second.h5** etc) will be overwritten so if you wish to save a configuration for particular parameters you will\nhave to rename and save them in another directory for reuse.\n\nIf you wish to run on from a warm start keeping all parameters the same there is no need to rerun the script to create\n**pFieldVis.json**. The purpose of running the script is to change parameter values by making a new .json file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabrg-models%2Ftessellations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabrg-models%2Ftessellations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabrg-models%2Ftessellations/lists"}