SpECTRE is an open-source code for multi-scale, multi-physics problems in astrophysics and gravitational physics. In the future, we hope that it can be applied to problems across discipline boundaries in fluid dynamics, geoscience, plasma physics, nuclear physics, and engineering. It runs at petascale and is designed for future exascale computers.
SpECTRE is being developed in support of our collaborative Simulating eXtreme Spacetimes (SXS) research program into the multi-messenger astrophysics of neutron star mergers, core-collapse supernovae, and gamma-ray bursts.
See its webpage for more information.
We begin by preparing a build of SpECTRE that can be used to perform evolutions of Einstein equations / other evolution systems. Build instructions are available on the formal webpage under the heading Using Spack to set up a SpECTRE environment. Build instructions have been simplified and further tested and documented on this wikipage as well.
1. Evolve scalar field in flat spacetime
The equations of motion of scalar fields in flat or curved spacetime have been coded up in SpECTRE
in 1, 2 and 3 spatial dimensions. These are available as the ScalarWave
and CurvedScalarWave
evolution systems. One can also set the curved background spacetime to be Minkowskian when evolving the CurvedScalarWave
system to the same effect. In this exercise we will go the latter route and simply work with the CurvedScalarWave
system only.
Start with building the requisite evolution executable. This can be done with
make EvolvePlaneWaveMinkowski2D
for scalar field in 2 spatial dimensions and a plane-wave profile. Having compiled the executable, one can run it with the -h
flag to see the various input options it needs. The convention is to set all options in a separate YAML file.
Here is a sample config file that can be used to evolve the scalar field in 2D. Save it to disk as PlaneWaveMinkowski2D.yaml
, and run
${PATH_TO_EXE}/EvolvePlaneWaveMinkowski2D --input-file PlaneWaveMinkowski2D.yaml
2. Evolve scalar field in curved but stationary spacetime
make EvolveScalarWaveKerrSchild3D
Here is a sample config file that can be used to evolve a scalar field pulse that has the profile of (l, m) = (2, 2)
quadrupole, and the spacetime background is provided by a Kerr black hole of specified mass and spin angular momentum.
${PATH_TO_EXE}/EvolveScalarWaveKerrSchild3D --input-file ScalarWaveKerrSchild3D.yaml
3. Evolve Einstein equations for Kerr spacetime
make EvolveGhKerrSchild
Here is a sample config file that can be used to evolve Einstein equations for a single Kerr black hole. Since the solution here is not supposed to depend on time, this is a fairly straightforward evolution in principle. In practice though, the problem of unconstrained violations of Einstein constraints arising from the smallest numerical errors made evolving this system a challenge for years before early 2000s. Its therefore instructive to examine the stability and convergence of our evolution,
${PATH_TO_EXE}/EvolveGhKerrSchild --input-file KerrSchild.yaml
Common instructions after evolving
Visualization of output is possible using the software Paraview. Paraview is a commonly used visualization software that is the staple one used for fluid dynamics and associated simulations. Its installation instructions are available on its webpage for most operating systems. Please install it before proceeding further.
First one needs to convert the data output during the evolution above to a format that Paraview can read and process. There is a script available in src/Visualization/Python/GenerateXdmf.py
within the Github repo of SpECTRE
. As always, you can run this with the -h
flag to see what inputs the script takes. In most cases this amounts to running:
${PATH_TO_SPECTRE}/src/Visualization/Python/GenerateXdmf.py \
--file-prefix PlaneWaveMinkowski2DVolume \
--output PlaneWaveMinkowski2DVolume \
--subfile-name VolumeData
where the names PlaneWaveMinkowski2DVolume
and VolumeData
were specified in the CONFIG file above as the name of output HDF5 file, and name of the relevant dataset within that HDF5 file. So, please see your particular config file and use the relevant strings specified in there, and do NOT copy the above command AS-IS. The --output
option can be specified as you wish to name the output file from this script.
After running the above command, we expect to get a file named PlaneWaveMinkowski2DVolume.xmf
. This file can be opened with the Paraview GUI using its XDMF reader.