-
Notifications
You must be signed in to change notification settings - Fork 0
Modifying the examples
The code has been designed so that the following aspects of the existing examples can be very straightforwardly modified within the Example folder:
- Change of parameters for the domain size, resolution, grid hierarchy etc
- Change in the matter profile for the scalar field and its conjugate momentum
- Change in the boundary conditions (periodic or asymptotically flat)
- Change in the scalar field potential, including its shape and mass/self interaction parameters
- Change in the black hole parameters (including up to two BHs)
- Switching the solver method between the existing CTTK and CTTKHybrid
For more advanced modifications, like adding a matter type or a new method, you will need to review the section Structure of GRTresna.
Here we will describe how we modify ScalarFieldBH
, as an example.
Go to the Examples folder and copy the whole folder of the example that most closely matches the one you want to create and rename it. In this case, to copy ScalarFieldBH
, you can simply use the following command,
cp -r ScalarFieldBH myCoolerScalarFieldBH
Before diving into your creativity, you might want to change the main file name Main_ScalarFieldBH.cpp
to Main_myCoolerScalarFieldBH.cpp
and ebase = Main_myCoolerScalarFieldBH
in GNUmakefile
.
Now, you are ready to make the example your own.
In the params.txt
, you can change most of setup of the solver, filesystem, grid and boundary conditions for the example, and also specify the black hole parameters. Please have a look at Guide to parameters for a more detailed description of these parameters.
For example, you can add a second black hole simply by modifiying the parameters for the second black hole (i.e. setting the mass to 1.0 and the spin to 0.5), and giving it a location separate from the first one.
The default scalar field profiles are set as Gaussian functions, both for the field profile and the momentum, with a quadratic potential. These can be changed within the MyMatterFunctions.cpp
to whatever profiles and scalar potential you are interested in.
This file also gives you the ability to add new parameters that you can read in from the params.txt
file to support your new profiles or potential, e.g. adding a self interaction strength as well as a scalar mass.
The current version of the solver supports the use of two different methods for solving the constraint equations: CTTK and Hybrid CTTK. See this article for full details of each approach.
The basic difference between the two methods is that in the Hybrid approach the conformal factor
The desired method is chosen in the GNUMakefile
, by leaving the line with the desired method uncommented and commenting out the other options. For example, for using the Hybrid CTTK method, this line should be used:
cxxcppflags = -DUSE_CTTKHybrid
Then, the command make realclean
should be used on the terminal after which the whole solver should be recompiled so that the desired method is implemented in the compilation.
The executable can then be compiled and run as described in Running the examples
It is essential to do a convergence test to see if the resulting initial condition data is correct. Getting a "small" constraint violation tells you nothing
- it should converge at the appropriate rate (second order, subject to caveats) when the resolution is increased, otherwise it is likely that you have a bug.
- it should be "small" when compared to the dominant source in the constraint equations. For example, Ham/(16pi*rho) ~ 0.01 would correspond to a 1% error.
Further instructions are given in Convergence testing.
Copyright GRTL Collaboration 2024