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

Create user tutorial for cell-based simulation command line arguments and parameter sweeping #267

Open
AlexFletcher opened this issue May 7, 2024 · 9 comments · May be fixed by #282
Open

Comments

@AlexFletcher
Copy link
Member

AlexFletcher commented May 7, 2024

See https://github.com/Chaste/trac_archive/blob/6a7d720d0f6351f9b0d2c7b9b3464f4f265cfa41/attachment/ticket/2762/ExampleCellBasedExecutable.cpp, old tickets #2601 and #2762, and old wiki pages for inspiration; see also Boost program options and CommandLineArguments.

See also work done by @twinkarma as part of a previous BBSRC grant: https://github.com/twinkarma/chastesweep

@mirams
Copy link
Member

mirams commented May 9, 2024

Yeah, could probably be a generic tutorial (not just cell based) just showing how to use the CommandLineArguments. I think that basically does everything you need and boost program_options is a bit overkill, needing additional dependency etc.

@BJackal
Copy link
Contributor

BJackal commented May 21, 2024

Created two tutorials for passing command line arguments to Chaste tests. First, simple hello world test which takes in command line arguements, adds inputs together and cout's the result. Second tutorial shows how to utilise bash script with command line arguments to create a vertex mesh with varying height and width based on inputs.

@mirams
Copy link
Member

mirams commented May 21, 2024

Could you stick a link to the branch in here @BJackal (see cog next to "Development" on the right hand toolbar)

@mirams mirams added priority: normal good-first-issue Nice easy standalone tasks labels May 28, 2024
@BJackal
Copy link
Contributor

BJackal commented May 28, 2024

Two user tutorials have now been added for command line argument examples. The more simple "hello world" test case example and its corresponding bash script have been put in global. I'm not sure if this is the correct location but seemed the most appropriate. The second example of executing a simple vertex mesh test with a single command line argument for tissue height and width has also been added. The tutorial and its corresponding bash script have been placed within the cell_based section.

@BJackal BJackal linked a pull request Jun 5, 2024 that will close this issue
@Mintao919
Copy link

one of part comments (derived from the original TestRunningVertexBasedSimulationsTutorial.hpp) file shows the default time step 0.02 hours. But I think it should be 0.002 hours if print results every 0.1 hours for 50 time steps. Which number is the correct one for defaul time step. Furthermore, where can the default time step be found and modified ? How can it be changed ? Only in the orignal file or available to set it as an argument parameter ? Many thanks.

    * For longer simulations, we may not want to output the results
     * every time step. In this case we can use the following method,
     * to print results every 50 time steps instead. As the default time step
     * used by the simulator (for vertex based simulations), is 0.02 hours, this method will cause the
     * simulator to print results every 6 minutes (i.e. 0.1 hours).
     */

@BJackal
Copy link
Contributor

BJackal commented Jun 11, 2024

one of part comments (derived from the original TestRunningVertexBasedSimulationsTutorial.hpp) file shows the default time step 0.02 hours. But I think it should be 0.002 hours if print results every 0.1 hours for 50 time steps. Which number is the correct one for defaul time step. Furthermore, where can the default time step be found and modified ? How can it be changed ? Only in the orignal file or available to set it as an argument parameter ? Many thanks.

    * For longer simulations, we may not want to output the results
     * every time step. In this case we can use the following method,
     * to print results every 50 time steps instead. As the default time step
     * used by the simulator (for vertex based simulations), is 0.02 hours, this method will cause the
     * simulator to print results every 6 minutes (i.e. 0.1 hours).
     */

EDIT: This comment is not accurate please see jmosborne's comment below but will leave the comment here as it still contains useful information.

@Mintao919 , The default time step is defined in each class. For example within the Goldbeter1991SrnModel the default time step can be found on line 45 and is set at 0.1. For another method such as the DeltaNotchSrnModel on line 44 the default time step is set as 0.001.

You should always be able to find if a method has a default time step in its corresponding .cpp file. However for good practice it would always be best to define your own time step in your simulation. You should not need to change the default time step itself as it can always be set and changed in your test directly using simulator.SetDt(x);

Looking through the tutorials should assist in the understanding of how simulations are ran. Two suggestions, TestRunningvertexBasedSimulationTutorial.hpp and TestOffLatticeSimulationWithVertexBasedCellPopulation.hpp

@jmosborne
Copy link
Contributor

The cell based timestep is 1/120 for VT and OS and 1/200 for VD. If youre also solving odes (like Goldbeter) then it can uses a smaller timestep for the ODEs, but the simulator.SetDt(x) timestep is used for the cell movement.

@Mintao919
Copy link

The cell based timestep is 1/120 for VT and OS and 1/200 for VD. If youre also solving odes (like Goldbeter) then it can uses a smaller timestep for the ODEs, but the simulator.SetDt(x) timestep is used for the cell movement.

Hey James, thanks for your comments. Could you please share the full names of VT, OS and VD. Many thanks. @jmosborne

@jmosborne
Copy link
Contributor

Sorry,

  • VT-Voronoi Tesselation (MeshBased in Chaste)
  • OS-Overlapping Spheres (NodeBased in Chaste)
  • VD-Vertex Dynamics (Vertex in Chaste)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment