This repository was created for the 2023 Chaste workshop in Oxford. It introduces some simple examples of vertex model simulations, and then examples of how simulations can be customised by writing new C++ classes.
The simulations are found in the following test suite:
The custom Chaste classes are defined in the following files:
-
There are a few ways to use Chaste's source code. Professional C++ developers may wish to link to Chaste as an external C++ library rather than use the User Project framework described below. People new to C++ may be tempted to directly alter code in the Chaste source folders; this should generally be avoided as we won't know whether any problems you may run into are down to Chaste or your changes to it!
-
Instead of these options, 'User Projects' allow you to use Chaste source code and have the benefit of using the Chaste build/testing framework, by putting User Projects under the projects folder. User Projects work exactly like new Chaste modules (
global
,heart
,cell_based
, etc.) and can depend on any of the Chaste modules (or indeed other User Projects). We tend to supply User Projects to accompany and reproduce research articles. -
Instructions on how to create your own User Project from a 'template' project can also be found here. Alternatively, if you're using Chaste via Docker, you can run the provided script
new_project.sh
(in thescripts
directory) and pass the name that you want to call your project e.g.new_project.sh my_chaste_proj
. -
⚠️ When you create a new user project, make sure you run the setup_project.py script to ensure it relies on the correct Chaste libraries. -
Once you have created the repository on GitHub (with the same name) and committed some changes, use the following commands to push your project to GitHub:
git remote add origin https://github.com/<username>/my_chaste_proj.git git push -u origin main
-
If the above command gives you the error
fatal: remote origin already exists
, then instead use the commands:git remote set-url origin https://github.com/<username>/my_chaste_proj.git git push -u origin main
-
Your project and its revision history is now safely stored on GitHub.
- Look through the structure of the user project and make sure you understand what all the files are there for.
- Go through the steps to create a new user project, making sure you have run the setup_project.py script.
- Read through the code in test/TestCustomVertexSimulations.hpp and make sure you undersand what it is doing.
- Compile and run the test suite in test/TestCustomVertexSimulations.hpp.
- Open the output in ParaView and see what each simulation has produced.
- Look at the code in the src directory and make sure you understand it.
- Make some modifications to one or more of those classes, and see how that modification affects the output of the relevant test.
- Create a custom class. This might be a division rule, force, or simulation modifier similar to the existing custom classes, or, it could be something different such as a new cell writer.
- Take one of the simulations in the test suite in test/TestCustomVertexSimulations.hpp, and re-write it as a node based simulation. You may find one of the tutorials useful: https://chaste.cs.ox.ac.uk/trac/wiki/UserTutorials#Cell-basedChaste
- Write a custom class that would make sense for a node based simulation, and add it to your new simulation.