Soliton initialisation
UltraDark.Initialise.add_fdm_soliton!
— Methodadd_fdm_soliton!(grids::AbstractGrids, [psi], mass, position, velocity, phase, t0)
Add a fuzzy dark matter soliton to grids
. The density profile is rescaled to the desired mass and the phase is set to the desired velocity.
If the argument psi
is passed, the soliton is added to the array-like psi
rather than than grids.ψx
. grids
is still used to calculate coordinates.
Note that due to coarse grid effects, the mass of the added soliton may not match the input mass exactly.
The included density profile from comes from PyUltraLight.
Examples
The following script adds a soliton to a grid and checks that the resulting total mass is correct.
using UltraDark
using UltraDark.Initialise
resol = 64
grids = Grids(10.0, resol)
mass = 10.0
position = [0.0, 0.0, 0.0]
velocity = [0.0, 0.0, 0.0]
phase = 0.0
t0 = 0.0
add_fdm_soliton!(grids, mass, position, velocity, phase, t0)
# Ensure density is correct
UltraDark.update_gravitational_potential!(grids, ())
actual_mass = UltraDark.mass(grids)
isapprox(mass, actual_mass, rtol = 1e-3)
# output
true