Skip to content

Commit

Permalink
Update for exercise 1 initial conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
KAClough committed Jun 24, 2024
1 parent 6782936 commit d7d427c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/bhinitialconditionswithSF.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# bhinitialconditions.py
# bhinitialconditionswithSF.py

# set the initial conditions for all the variables for an isotropic Schwarzschild BH
# see further details in https://github.com/GRChombo/engrenage/wiki/Running-the-black-hole-example

from source.uservariables import *
from source.tensoralgebra import *
from source.Grid import *
from source.mymatter import * # Need the scalar mass
import numpy as np
from scipy.interpolate import interp1d

Expand Down Expand Up @@ -36,6 +37,13 @@ def get_initial_state(a_grid) :
hpp[:] = em4phi * gpp_over_r2sintheta - 1.0
lapse.fill(1.0)
#lapse[:] = em4phi # optional, to pre collapse the lapse

# Set the scalar field value
u.fill(1.0e-6)
# To solve the constraints K^2 = 16\pi rho = 16\pi V(u)
# In practise this doesn't make a difference as the error is less than the
# derivatives, but it is good practise to think of it!
K[:] = np.sqrt(24.0 * np.pi * V_of_u(u))

# overwrite inner cells using parity under r -> - r
a_grid.fill_inner_boundary(initial_state)
Expand Down

0 comments on commit d7d427c

Please sign in to comment.