Skip to content

Commit

Permalink
Major update: Begin synchronizing with BH@H branch; also various smal…
Browse files Browse the repository at this point in the history
…l fixes & spellchecks
  • Loading branch information
zachetienne committed Mar 7, 2021
1 parent 9808c96 commit 8755f74
Show file tree
Hide file tree
Showing 155 changed files with 7,128 additions and 5,519 deletions.
4 changes: 2 additions & 2 deletions BSSN/ADM_Exact_Spherical_or_Cartesian_to_BSSNCurvilinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def Convert_Spherical_or_Cartesian_ADM_to_BSSN_curvilinear(CoordType_in, Sph_r_t
# of xx0,xx1,xx2, so here we call sympify_integers__replace_rthph() to replace
# r,th,ph or x,y,z, respectively, with the appropriate functions of xx0,xx1,xx2
# as defined for this particular reference metric in reference_metric.py's
# xxSph[] or xxCart[], respectively:
# xxSph[] or xx_to_Cart[], respectively:

# Note that substitution only works when the variable is not an integer. Hence the
# if isinstance(...,...) stuff:
Expand All @@ -71,7 +71,7 @@ def sympify_integers__replace_rthph_or_Cartxyz(obj, rthph_or_xyz, rthph_or_xyz_o
if CoordType_in == "Spherical":
r_th_ph_or_Cart_xyz_of_xx = rfm.xxSph
elif CoordType_in == "Cartesian":
r_th_ph_or_Cart_xyz_of_xx = rfm.xxCart
r_th_ph_or_Cart_xyz_of_xx = rfm.xx_to_Cart
else:
print("Error: Can only convert ADM Cartesian or Spherical initial data to BSSN Curvilinear coords.")
sys.exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def Convert_Spherical_or_Cartesian_ADM_to_BSSN_curvilinear(CoordType_in, ADM_inp
# of xx0,xx1,xx2, so here we call sympify_integers__replace_rthph() to replace
# r,th,ph or x,y,z, respectively, with the appropriate functions of xx0,xx1,xx2
# as defined for this particular reference metric in reference_metric.py's
# xxSph[] or xxCart[], respectively:
# xxSph[] or xx_to_Cart[], respectively:

# Define the input variables:
gammaSphorCartDD = ixp.declarerank2("gammaSphorCartDD", "sym01")
Expand All @@ -54,7 +54,7 @@ def Convert_Spherical_or_Cartesian_ADM_to_BSSN_curvilinear(CoordType_in, ADM_inp
if CoordType_in == "Spherical":
r_th_ph_or_Cart_xyz_oID_xx = rfm.xxSph
elif CoordType_in == "Cartesian":
r_th_ph_or_Cart_xyz_oID_xx = rfm.xxCart
r_th_ph_or_Cart_xyz_oID_xx = rfm.xx_to_Cart
else:
print("Error: Can only convert ADM Cartesian or Spherical initial data to BSSN Curvilinear coords.")
sys.exit(1)
Expand Down
8 changes: 4 additions & 4 deletions BSSN/Psi4_tetrads.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def Psi4_tetrads():

# Step 2.a: Declare the Cartesian x,y,z in terms of
# xx0,xx1,xx2.
x = rfm.xxCart[0]
y = rfm.xxCart[1]
z = rfm.xxCart[2]
x = rfm.xx_to_Cart[0]
y = rfm.xx_to_Cart[1]
z = rfm.xx_to_Cart[2]

# Step 2.b: Declare detgamma and gammaUU from
# BSSN.ADM_in_terms_of_BSSN;
Expand All @@ -70,7 +70,7 @@ def Psi4_tetrads():
Jac_dUCart_dDrfmUD = ixp.zerorank2()
for i in range(DIM):
for j in range(DIM):
Jac_dUCart_dDrfmUD[i][j] = sp.simplify(sp.diff(rfm.xxCart[i], rfm.xx[j]))
Jac_dUCart_dDrfmUD[i][j] = sp.simplify(sp.diff(rfm.xx_to_Cart[i], rfm.xx[j]))

# Step 2.e: Invert above Jacobian to get needed d xx^j / d x_Cart^i
Jac_dUrfm_dDCartUD, dummyDET = ixp.generic_matrix_inverter3x3(Jac_dUCart_dDrfmUD)
Expand Down
10 changes: 5 additions & 5 deletions CurviBoundaryConditions/CurviBoundaryConditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def print_parity_list(gf_type, variable_names,parity_types):
rfm.reference_metric()

# Step 4: Output C code for the Eigen-Coordinate mapping from xx->Cartesian:
rfm.xxCart_h("EigenCoord_xxCart", os.path.join(Cparamspath,"set_Cparameters.h"), os.path.join(Ccodesdir, "EigenCoord_xxCart.h"))
rfm.xx_to_Cart_h("EigenCoord_xx_to_Cart", os.path.join(Cparamspath,"set_Cparameters.h"), os.path.join(Ccodesdir, "EigenCoord_xx_to_Cart.h"))

# Step 5: Output the Eigen-Coordinate mapping from Cartesian->xx:
# Step 5.a: Sanity check: First make sure that rfm.Cart_to_xx has been set. Error out if not!
Expand Down Expand Up @@ -327,7 +327,7 @@ def sommerfeld_params(self):
def dfdr_function(fd_order):
# function to write c code to calculate dfdr term in Sommerfeld boundary condition

# Read what # of dimensions being usded
# Read what # of dimensions being used
DIM = par.parval_from_str("grid::DIM")

# Set up the chosen reference metric from chosen coordinate system, set within NRPy+
Expand Down Expand Up @@ -513,7 +513,7 @@ def output_dfdx(intdirn, fd_order):
"""
if fd_order == 4:
contraction_term_func +="""
// foward/backward finite difference coefficients
// forward/backward finite difference coefficients
const REAL u0 =-25./12.;
const REAL u1 = 4.;
const REAL u2 = -3.;
Expand All @@ -527,7 +527,7 @@ def output_dfdx(intdirn, fd_order):
"""
if fd_order == 6:
contraction_term_func +="""
// foward/backward finite difference coefficients
// forward/backward finite difference coefficients
const REAL u0 = -49./20.;
const REAL u1 = 6.;
const REAL u2 = -15./2.;
Expand Down Expand Up @@ -555,7 +555,7 @@ def output_dfdx(intdirn, fd_order):

def write_sommerfeld_main_Ccode(self, Ccodesdir):
main_Ccode = """
// Boundary condtion driver routine: Apply BCs to all
// Boundary condition driver routine: Apply BCs to all
// boundary faces of the 3D numerical domain, filling in the
// outer boundary ghost zone layers, starting with the innermost
// layer and working outward.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "BCs_data_structs.h"
#include "EigenCoord_xxCart.h"
#include "EigenCoord_xx_to_Cart.h"
#include "set_up__bc_gz_map_and_parity_condns.h"
#include "set_bcstruct.h"
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void set_up__bc_gz_map_and_parity_condns(const paramstruct *restrict params,
LOOP_REGION(0,Nxx_plus_2NGHOSTS0,0,Nxx_plus_2NGHOSTS1,0,Nxx_plus_2NGHOSTS2) {
// Step 1: Convert the (curvilinear) coordinate (x0,x1,x2) to Cartesian coordinates
REAL xCart[3];
EigenCoord_xxCart(params, xx, i0,i1,i2, xCart);
EigenCoord_xx_to_Cart(params, xx, i0,i1,i2, xCart);
REAL Cartx = xCart[0];
REAL Carty = xCart[1];
REAL Cartz = xCart[2];
Expand All @@ -47,7 +47,7 @@ void set_up__bc_gz_map_and_parity_condns(const paramstruct *restrict params,
// make sure that the Cartesian coordinate matches the Cartesian coordinate of
// x0(i0),x1(i1),x2(i2). If not, error out!
REAL xCart_orig[3]; for(int ii=0;ii<3;ii++) xCart_orig[ii] = xCart[ii];
EigenCoord_xxCart(params, xx, i0_inbounds,i1_inbounds,i2_inbounds, xCart);
EigenCoord_xx_to_Cart(params, xx, i0_inbounds,i1_inbounds,i2_inbounds, xCart);

//fprintf(stderr,"Cartesian agreement: ( %.15e %.15e %.15e ) ?= ( %.15e %.15e %.15e )\n",
// (double)xCart_orig[0],(double)xCart_orig[1],(double)xCart_orig[2],
Expand Down
12 changes: 6 additions & 6 deletions Maxwell/InitialData.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def Toroidal():

global AidU, EidU, psi_ID

x = rfm.xxCart[0]
y = rfm.xxCart[1]
z = rfm.xxCart[2]
x = rfm.xx_to_Cart[0]
y = rfm.xx_to_Cart[1]
z = rfm.xx_to_Cart[2]

AidD_Sph = ixp.zerorank1()
# Set coordinate transformations:
Expand All @@ -60,9 +60,9 @@ def Toroidal():
Jac_dxSphU_dxCartD = ixp.zerorank2()
for i in range(DIM):
for j in range(DIM):
Jac_dxSphU_dxCartD[i][j] = sp.diff(rfm.xxSph[i],rfm.xxCart[j])
Jac_dxSphU_dxCartD[i][j] = sp.diff(rfm.xxSph[i],rfm.xx_to_Cart[j])

# Jac_dxCartU_dxSphD[i][j] = sp.diff(rfm.xxCart[i],rfm.xx[j])
# Jac_dxCartU_dxSphD[i][j] = sp.diff(rfm.xx_to_Cart[i],rfm.xx[j])
Jac_dxCartU_dxSphD,dummy = ixp.generic_matrix_inverter3x3(Jac_dxSphU_dxCartD)

for i in range(DIM):
Expand All @@ -83,7 +83,7 @@ def Toroidal():

for i in range(3):
for k in range(3):
AidU_Cart[i] = AidU_Cart[i].subs(cart_xx[k], rfm.xxCart[k])
AidU_Cart[i] = AidU_Cart[i].subs(cart_xx[k], rfm.xx_to_Cart[k])

# if radial_like_dst_xx0:
# for j in range(3):
Expand Down
2 changes: 1 addition & 1 deletion Maxwell/VacuumMaxwell_Flat_Evol_Curvilinear_rescaled.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def Convert_to_Cartesian_basis(VU):
Jac_dxCartU_dxOrigD = ixp.zerorank2()
for i in range(DIM):
for j in range(DIM):
Jac_dxCartU_dxOrigD[i][j] = sp.diff(rfm.xxCart[i], rfm.xx[j])
Jac_dxCartU_dxOrigD[i][j] = sp.diff(rfm.xx_to_Cart[i], rfm.xx[j])

for i in range(DIM):
for j in range(DIM):
Expand Down
2 changes: 1 addition & 1 deletion MoLtimestepping/C_Code_Generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def diagnostic_output_gfs_equal_to(gfs):
# ODE: y' = f(t,y), y(t_0) = y_0
# Starting at time t_n with solution having value y_n and trying to update to y_nplus1 with timestep dt

# Example of scheme for RK4 with k_1, k_2, k_3, k_4 (Using non-diagonal algortihm) Notice this requires storage of
# Example of scheme for RK4 with k_1, k_2, k_3, k_4 (Using non-diagonal algorithm) Notice this requires storage of
# y_n, y_nplus1, k_1 through k_4

# k_1 = dt*f(t_n, y_n)
Expand Down
50 changes: 25 additions & 25 deletions NRPyPN/PN-Hamiltonian-Nonspinning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:14:48.231728Z",
"iopub.status.busy": "2020-12-17T02:14:48.231251Z",
"iopub.status.idle": "2020-12-17T02:14:48.397777Z",
"shell.execute_reply": "2020-12-17T02:14:48.397275Z"
"iopub.execute_input": "2021-03-07T17:35:21.733138Z",
"iopub.status.busy": "2021-03-07T17:35:21.732281Z",
"iopub.status.idle": "2021-03-07T17:35:22.058067Z",
"shell.execute_reply": "2021-03-07T17:35:22.057510Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -133,10 +133,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:14:48.404523Z",
"iopub.status.busy": "2020-12-17T02:14:48.403980Z",
"iopub.status.idle": "2020-12-17T02:14:48.405778Z",
"shell.execute_reply": "2020-12-17T02:14:48.405349Z"
"iopub.execute_input": "2021-03-07T17:35:22.070031Z",
"iopub.status.busy": "2021-03-07T17:35:22.068878Z",
"iopub.status.idle": "2021-03-07T17:35:22.072056Z",
"shell.execute_reply": "2021-03-07T17:35:22.071450Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -204,10 +204,10 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:14:48.434290Z",
"iopub.status.busy": "2020-12-17T02:14:48.433866Z",
"iopub.status.idle": "2020-12-17T02:14:48.435720Z",
"shell.execute_reply": "2020-12-17T02:14:48.435290Z"
"iopub.execute_input": "2021-03-07T17:35:22.086537Z",
"iopub.status.busy": "2021-03-07T17:35:22.085568Z",
"iopub.status.idle": "2021-03-07T17:35:22.088646Z",
"shell.execute_reply": "2021-03-07T17:35:22.088002Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -237,10 +237,10 @@
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:14:48.441724Z",
"iopub.status.busy": "2020-12-17T02:14:48.441306Z",
"iopub.status.idle": "2020-12-17T02:14:48.442742Z",
"shell.execute_reply": "2020-12-17T02:14:48.442311Z"
"iopub.execute_input": "2021-03-07T17:35:22.100331Z",
"iopub.status.busy": "2021-03-07T17:35:22.099621Z",
"iopub.status.idle": "2021-03-07T17:35:22.101944Z",
"shell.execute_reply": "2021-03-07T17:35:22.102467Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -291,10 +291,10 @@
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:14:48.450466Z",
"iopub.status.busy": "2020-12-17T02:14:48.450044Z",
"iopub.status.idle": "2020-12-17T02:14:48.530709Z",
"shell.execute_reply": "2020-12-17T02:14:48.530287Z"
"iopub.execute_input": "2021-03-07T17:35:22.112417Z",
"iopub.status.busy": "2021-03-07T17:35:22.111695Z",
"iopub.status.idle": "2021-03-07T17:35:22.287409Z",
"shell.execute_reply": "2021-03-07T17:35:22.287855Z"
}
},
"outputs": [
Expand Down Expand Up @@ -354,10 +354,10 @@
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:14:48.533123Z",
"iopub.status.busy": "2020-12-17T02:14:48.532711Z",
"iopub.status.idle": "2020-12-17T02:14:50.580105Z",
"shell.execute_reply": "2020-12-17T02:14:50.580524Z"
"iopub.execute_input": "2021-03-07T17:35:22.292627Z",
"iopub.status.busy": "2021-03-07T17:35:22.291934Z",
"iopub.status.idle": "2021-03-07T17:35:25.582036Z",
"shell.execute_reply": "2021-03-07T17:35:25.582631Z"
}
},
"outputs": [
Expand Down Expand Up @@ -393,7 +393,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.8.2"
}
},
"nbformat": 4,
Expand Down
34 changes: 17 additions & 17 deletions NRPyPN/PN-Hamiltonian-SSS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:15:04.996628Z",
"iopub.status.busy": "2020-12-17T02:15:04.996125Z",
"iopub.status.idle": "2020-12-17T02:15:05.161645Z",
"shell.execute_reply": "2020-12-17T02:15:05.161023Z"
"iopub.execute_input": "2021-03-07T17:35:47.617159Z",
"iopub.status.busy": "2021-03-07T17:35:47.616249Z",
"iopub.status.idle": "2021-03-07T17:35:47.948492Z",
"shell.execute_reply": "2021-03-07T17:35:47.947745Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -131,10 +131,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:15:05.169590Z",
"iopub.status.busy": "2020-12-17T02:15:05.168952Z",
"iopub.status.idle": "2020-12-17T02:15:05.170792Z",
"shell.execute_reply": "2020-12-17T02:15:05.170292Z"
"iopub.execute_input": "2021-03-07T17:35:47.959986Z",
"iopub.status.busy": "2021-03-07T17:35:47.959235Z",
"iopub.status.idle": "2021-03-07T17:35:47.961367Z",
"shell.execute_reply": "2021-03-07T17:35:47.961857Z"
}
},
"outputs": [],
Expand Down Expand Up @@ -179,10 +179,10 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:15:05.177285Z",
"iopub.status.busy": "2020-12-17T02:15:05.176855Z",
"iopub.status.idle": "2020-12-17T02:15:05.313898Z",
"shell.execute_reply": "2020-12-17T02:15:05.313430Z"
"iopub.execute_input": "2021-03-07T17:35:47.971997Z",
"iopub.status.busy": "2021-03-07T17:35:47.970940Z",
"iopub.status.idle": "2021-03-07T17:35:48.202572Z",
"shell.execute_reply": "2021-03-07T17:35:48.202000Z"
}
},
"outputs": [
Expand Down Expand Up @@ -234,10 +234,10 @@
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2020-12-17T02:15:05.316567Z",
"iopub.status.busy": "2020-12-17T02:15:05.316117Z",
"iopub.status.idle": "2020-12-17T02:15:07.361348Z",
"shell.execute_reply": "2020-12-17T02:15:07.361788Z"
"iopub.execute_input": "2021-03-07T17:35:48.207312Z",
"iopub.status.busy": "2021-03-07T17:35:48.206537Z",
"iopub.status.idle": "2021-03-07T17:35:51.504767Z",
"shell.execute_reply": "2021-03-07T17:35:51.505461Z"
}
},
"outputs": [
Expand Down Expand Up @@ -273,7 +273,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.8.2"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 8755f74

Please sign in to comment.