This thorn allows one to use SGRID-generated initial data of Binary Neutron Stars as a starting point for the Cactus simulation.
To initiate the simulations of Binary Neutron Stars, one needs realistic initial data that accurately encodes the state of both stars in orbit prior to merger. The numerical code, SGRID, allows the generation of initial data for stars characterized by arbitrary masses, spins, and orbital eccentricities, along with an equation of state.
SGRID is a separate numerical code that can create initial data. To do this, it has to be compiled and run separately from Cactus. This initial data can then be used by Cactus to conduct a time-dependent simulation. However, SGRID writes ID files in its own format. To make it usable for Cactus, it is necessary to provide this data on the grid points used by Cactus. This is achieved by interpolating data from SGRID’s grid points onto the grid points used by Cactus. The functions that perform the actual interpolation reside inside the SGRID library, which is usually compiled into Cactus by adding the thorn ExternalLibraries-SGRID.
To simplify this process, we have developed a Cactus thorn called DNSdata, which can read SGRID initial data into Cactus, allowing Cactus to perform the subsequent evolution.
Sgrid is a separate numerical code which creates initial data. One may find the details in:
https://www.physics.fau.edu/~wolf/Research/FAU-sgrid/
The arrangement containing the thorn can be downloaded by typing:
git clone git@github.com:wofti/CactusSgrid.git
The thorn is in the directory DNSdata.
The directory ”DNSdata/useful_files” contains several files that might be useful to a new user, such as the parfile example ”dns.par”.
Among other files, there is also a script named ”prepare_DNSdata.sh”. One can use it to set up Cactus together with this thorn. The only thing you need to do is execute the script, which will result in the downloading of Cactus and its components according to the thornlist ”dns.th”. The script contains many more lines that are currently commented out. These lines allow the user more flexibility during compilation, but it requires more independent work.
Explanation of the files in ”DNSdata/useful_files”:
dns.th - it is a thorns list required by Cactus (and by GetComponents script to download all necessary components to compile Cactus).
dns.par - it is an example of Cactus input parameter file. There is a place in it to set the parameters related to DNSdata thorn. In particular, you must set the path to SGRID-generated initial data in it.
dns.cfg - it is a configuration file which contains a compilation options. (In particular, the SGRID library path is set in it. These lines are commented out because it is not necessary as you compile Cactus with SGRID as an External Library, see next line)
MyConfig - it is a file required by SGRID to be compiled with a proper options. You are setting here the compiler, libraries, etc. (Not necessary anymore, since SGRID exist as a Cactus External Library now and is already included in the thornlist ”dns.th”)
s_comp.sh - it is just a sbatch submission script which you may use to compile Cactus. Of course, it is a template to be modified before using.
In order to read SGRID-generated initial data and make them ready for interpolation, the correct path to the ID directory must be provided. It requires the following variable in the parfile:
DNSdata::sgrid_datadir = ”path_to_ID_directory”
The standard SGRID ID packet is a directory containing three files:
”checkpoint.0” - contains the SGIRD ID
”ID_directory.par” - is SGRID’s own parameter file - needs to have the same name as the containing dir plus the .par extension
”BNSdata_properties.txt” - contains essential system characteristics that summarize the model
After the first initial stage of the run, when the SGRID interpolation is completed, the rest belongs solely to Cactus and is independent on the choice of ID delivery, in particular it is independent on this thorn.
The thorn DNSdata requires the following other thorns: ExternalLibraries-SGRID, ADMBase, and HydroBase.
To import metric quantities from an initial data solution, the following HydroBase and ADMBase variables need to be set to DNSdata:
HydroBase::initial_hydro = ”DNSdata”
ADMBase::initial_data = ”DNSdata”
ADMBase::initial_lapse = ”DNSdata”
ADMBase::initial_shift = ”zero”
ADMBase::initial_dtlapse = ”DNSdata”
ADMBase::initial_dtshift = ”zero”
Since some system characteristics are required by Cactus and should be correctly set in Cactus’ .par file, it is recommended to get familiar with ”BNSdata_properties.txt” file. Important points are:
a) Ensure that the center of the grid box in Cactus, specified by ”CarpetRegrid2::position_x_1,” corresponds to the density maximum of the neutron star (NS), denoted as ”xmax1” in the SGRID-generated ”BNSdata_properties.txt” file. IMPORTANT COMMENT about unequal mass binaries: SGRID uses coordinates where the origin of the coordinate system is at the point halfway between the two stars, whereas Cactus prefers coordinates where the origin is at the center of mass of the binary. The DNSdata thorn will translate the stars accordingly, but the user must understand where the stars then lie and should adjust the Cactus grid centers accordingly. I.e. ”xmax1” in ”BNSdata_properties.txt” needs to be shifted by the CM location ”x_CM” to obtain the x-coordinate in Cactus.
b) Ensure that the parameters related to the choice of the equation of state (EoS) align with SGRID’s EoS parameters. SGRID’s EoS is described in the file ”BNSdata_properties.txt”. For a piecewise polytrope the relevant lines are indicated by ”rho0_list”, ”n_list”, and ”kappa”. Here ”rho0_list” specifies the rest mass densities at which we switch between polytropes. ”n_list” gives the polytropic index n for each piece. Note that \(\Gamma = 1 + 1/n\) and \(P = K \rho _0^\Gamma \). ”kappa” specifies the K of the polytrope used for the lowest density.
We provide a sample of initial data located in the directory ”sgrid_id” within a standard ”test” directory. A brief test, which does not produce any output for the importer’s verification interface, is set up in the parfile ”DNSdata_test.par”, also located in the standard ”test” directory. It is a parfile based on slightly modified version of the ”bns.par” available at: https://www.einsteintoolkit.org/gallery/bns/bns.par.
It loads low-resolution initial data for spinless, equal-mass, highly eccentric, SLy-EoS system of Binary Neutron Star. The ”cctk_final_time” is set to be equal to 10.0.
idfiles_dir | Scope: private | STRING |
Description: Directory with ID .dat-files already interpolated to our current bam grid (needed if
DNSdataReader_use_interpolator = no)
| ||
Range | Default: (none) | |
interpolate_make_finer_grid2 | Scope: private | BOOLEAN |
Description: make finer grid2 to get a good guess for X,Y,Z [yes,no]
| ||
Default: yes | ||
interpolate_max_xyz_diff | Scope: private | REAL |
Description: if positive we quit if x(X,Y,Z), y(X,Y,Z), z(X,Y,Z) differ by more than this from
bam’s x,y,x
| ||
Range | Default: -1.0 | |
: | ||
interpolate_verbose | Scope: private | BOOLEAN |
Description: whether we print all points to stdout
| ||
Default: no | ||
keep_sgrid_output | Scope: private | BOOLEAN |
Description: whether we keep the output sgrid creates while running [yes,no]
| ||
Default: no | ||
rotation180 | Scope: private | BOOLEAN |
Description: rotate DNSdata by 180 degrees about z-axis [yes,no]
| ||
Default: no | ||
sgrid_datadir | Scope: private | STRING |
Description: location of sgrid outdir with data
| ||
Range | Default: (none) | |
sgrid_exe | Scope: private | STRING |
Description: location of sgrid executable
| ||
Range | Default: ./sgrid | |
use_interpolator | Scope: private | BOOLEAN |
Description: whether we use DNSdataReader_interpolator
| ||
Default: yes | ||
out_dir | Scope: shared from IO | STRING |
Implements:
dnsdata
Inherits:
grid
summationbyparts
admbase
hydrobase
This section lists all the variables which are assigned storage by thorn CactusSgrid/DNSdata. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.
NONE
CCTK_PARAMCHECK (conditional)
dnsdatapars
read pars from bnsdata_properties.txt
Language: | c | |
Type: | function | |
HydroBase_Initial (conditional)
dnsdatareader
read binary neutron star initial data
Language: | c | |
Type: | function | |