Skip to content

Adding examples

llibert94 edited this page Aug 23, 2023 · 6 revisions

Detailed guidance on how to add a new example, with general points and coding conventions, can be found in the GRChombo wiki. As described there, all changes should be made in a new fork, and changes in the main branch should be pulled into that fork at regular intervals.

Here we outline the general process for adding a new example to the GRFolres code. The code is divided into three folders - 'Source', 'Examples', and 'Tests'. The 'main' function for each example is located in a sub-directory of the examples folder, along with all example-specific code (such as the initial data, diagnostic variables, and simulation parameters). The 'Source' directory includes all the files relevant for computing the rhs of the Four-Derivative Scalar-Tensor theory of gravity.

If you intend to use an existing example with a new set of parameters, a new sub-folder should be created inside the relevant example folder. This sub-folder should contain a jobscript and the new parameter files, which can both be made by copying and modifying the existing files.

If you intend to made modifications to the code, the first step is to create a new project-specific folder in 'Examples'. The easiest way to do this is by copying and modifying an existing example, changing the file names and include guards as necessary.

If your example includes a new modified gravity model that may be used by others, this can be placed in the 'Source' directory. The existing classes in these folders should not be modifed. If your new class is similar to an existing class, it may be easiest to inherit from that class. In general we consider the couplings to be example specific, so they live in the examples folders, but default templates can be found in the source code.

Running 'make all' in the GRFolres folder will compile all examples and tests, and should be done regularly to ensure that new changes have not affected the existing examples or tests.