{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "\n", "# Start-to-Finish Example: Head-On Black Hole Collision\n", "\n", "## Author: Zach Etienne\n", "### Formatting improvements courtesy Brandon Clark\n", "\n", "## This module implements a basic numerical relativity code to merge two black holes in *spherical-like coordinates*, as well as the gravitational wave analysis provided by the $\\psi_4$ NRPy+ tutorial notebooks ([$\\psi_4$](Tutorial-Psi4.ipynb) & [$\\psi_4$ tetrad](Tutorial-Psi4_tetrads.ipynb)).\n", "\n", "### Here we place the black holes initially on the $z$-axis, so the entire simulation is axisymmetric about the $\\phi$-axis. Minimal sampling in the $\\phi$ direction greatly speeds up the simulation.\n", "\n", "**Notebook Status:** Validated \n", "\n", "**Validation Notes:** This module has been validated to exhibit convergence to zero of the Hamiltonian constraint violation at the expected order to the exact solution *after a short numerical evolution of the initial data* (see [plots at bottom](#convergence)), and all quantities have been validated against the [original SENR code](https://bitbucket.org/zach_etienne/nrpy). Finally, excellent agreement is seen in the gravitational wave signal from the ringing remnant black hole for multiple decades in amplitude when compared to black hole perturbation theory predictions.\n", "\n", "### NRPy+ Source Code for this module: \n", "* [BSSN/BrillLindquist.py](../edit/BSSN/BrillLindquist.py); [\\[**tutorial**\\]](Tutorial-ADM_Initial_Data-Brill-Lindquist.ipynb): Brill-Lindquist initial data; sets all ADM variables in Cartesian basis: \n", "* [BSSN/ADM_Exact_Spherical_or_Cartesian_to_BSSNCurvilinear.py](../edit/BSSN/ADM_Exact_Spherical_or_Cartesian_to_BSSNCurvilinear.py); [\\[**tutorial**\\]](Tutorial-ADM_Initial_Data-Converting_Exact_ADM_Spherical_or_Cartesian_to_BSSNCurvilinear.ipynb): Spherical/Cartesian ADM$\\to$Curvilinear BSSN converter function, for which exact expressions are given for ADM quantities.\n", "* [BSSN/BSSN_ID_function_string.py](../edit/BSSN/BSSN_ID_function_string.py): Sets up the C code string enabling initial data be set up in a point-by-point fashion\n", "* [BSSN/BSSN_constraints.py](../edit/BSSN/BSSN_constraints.py); [\\[**tutorial**\\]](Tutorial-BSSN_constraints.ipynb): Hamiltonian constraint in BSSN curvilinear basis/coordinates\n", "* [BSSN/BSSN_RHSs.py](../edit/BSSN/BSSN_RHSs.py); [\\[**tutorial**\\]](Tutorial-BSSN_time_evolution-BSSN_RHSs.ipynb): Generates the right-hand sides for the BSSN evolution equations in singular, curvilinear coordinates\n", "* [BSSN/BSSN_gauge_RHSs.py](../edit/BSSN/BSSN_gauge_RHSs.py); [\\[**tutorial**\\]](Tutorial-BSSN_time_evolution-BSSN_gauge_RHSs.ipynb): Generates the right-hand sides for the BSSN gauge evolution equations in singular, curvilinear coordinates\n", "* [BSSN/Psi4.py](../edit/BSSN/Psi4.py); [\\[**tutorial**\\]](Tutorial-Psi4.ipynb): Generates expressions for $\\psi_4$, the outgoing Weyl scalar\n", " + [BSSN/Psi4_tetrads.py](../edit/BSSN/Psi4_tetrads.py); [\\[**tutorial**\\]](Tutorial-Psi4_tetrads.ipynb): Generates quasi-Kinnersley tetrad needed for $\\psi_4$-based gravitational wave extraction\n", "\n", "## Introduction:\n", "Here we use NRPy+ to generate the C source code necessary to set up initial data for two black holes (Brill-Lindquist, [Brill & Lindquist, Phys. Rev. 131, 471, 1963](https://journals.aps.org/pr/abstract/10.1103/PhysRev.131.471); see also Eq. 1 of [Brandt & Brügmann, arXiv:gr-qc/9711015v1](https://arxiv.org/pdf/gr-qc/9711015v1.pdf)). Then we use it to generate the RHS expressions for [Method of Lines](https://reference.wolfram.com/language/tutorial/NDSolveMethodOfLines.html) time integration based on the [explicit Runge-Kutta fourth-order scheme](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) (RK4).\n", "\n", "The entire algorithm is outlined as follows, with links to the relevant NRPy+ tutorial notebooks listed at each step:\n", "\n", "1. Allocate memory for gridfunctions, including temporary storage for the Method of Lines time integration\n", " * [**NRPy+ tutorial on Method of Lines algorithm**](Tutorial-Method_of_Lines-C_Code_Generation.ipynb).\n", "1. Set gridfunction values to initial data \n", " * [**NRPy+ tutorial on Brill-Lindquist initial data**](Tutorial-ADM_Initial_Data-Brill-Lindquist.ipynb)\n", " * [**NRPy+ tutorial on validating Brill-Lindquist initial data**](Tutorial-Start_to_Finish-BSSNCurvilinear-Setting_up_Exact_Initial_Data.ipynb).\n", "1. Next, integrate the initial data forward in time using the Method of Lines coupled to a Runge-Kutta explicit timestepping algorithm:\n", " 1. At the start of each iteration in time, output the Hamiltonian constraint violation \n", " * [**NRPy+ tutorial on BSSN constraints**](Tutorial-BSSN_constraints.ipynb).\n", " 1. At each RK time substep, do the following:\n", " 1. Evaluate BSSN RHS expressions \n", " * [**NRPy+ tutorial on BSSN right-hand sides**](Tutorial-BSSN_time_evolution-BSSN_RHSs.ipynb)\n", " * [**NRPy+ tutorial on BSSN gauge condition right-hand sides**](Tutorial-BSSN_time_evolution-BSSN_gauge_RHSs.ipynb) \n", " 1. Apply singular, curvilinear coordinate boundary conditions [*a la* the SENR/NRPy+ paper](https://arxiv.org/abs/1712.07658)\n", " * [**NRPy+ tutorial on setting up singular, curvilinear boundary conditions**](Tutorial-Start_to_Finish-Curvilinear_BCs.ipynb)\n", " 1. Enforce constraint on conformal 3-metric: $\\det{\\bar{\\gamma}_{ij}}=\\det{\\hat{\\gamma}_{ij}}$ \n", " * [**NRPy+ tutorial on enforcing $\\det{\\bar{\\gamma}_{ij}}=\\det{\\hat{\\gamma}_{ij}}$ constraint**](Tutorial-BSSN_enforcing_determinant_gammabar_equals_gammahat_constraint.ipynb)\n", "1. Repeat above steps at two numerical resolutions to confirm convergence to zero." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Table of Contents\n", "$$\\label{toc}$$\n", "\n", "This notebook is organized as follows\n", "\n", "1. [Step 1](#initializenrpy): Set core NRPy+ parameters for numerical grids and reference metric\n", "1. [Step 2](#adm_id): Import Brill-Lindquist ADM initial data C function from the [`BSSN.BrillLindquist`](../edit/BSSN/BrillLindquist.py) NRPy+ module\n", "1. [Step 3](#bssn): Output C code for BSSN spacetime solve\n", " 1. [Step 3.a](#bssnrhs): Output C code for BSSN RHS expressions\n", " 1. [Step 3.b](#hamconstraint): Output C code for Hamiltonian constraint\n", " 1. [Step 3.c](#enforce3metric): Enforce conformal 3-metric $\\det{\\bar{\\gamma}_{ij}}=\\det{\\hat{\\gamma}_{ij}}$ constraint\n", " 1. [Step 3.d](#psi4): Compute $\\psi_4$, which encodes gravitational wave information in our numerical relativity calculations\n", " 1. [Step 3.e](#decomposepsi4): Decompose $\\psi_4$ into spin-weight -2 spherical harmonics\n", " 1. [Step 3.e.i](#spinweight): Output ${}^{-2}Y_{\\ell,m}$, up to and including $\\ell=\\ell_{\\rm max}$=`l_max` (set to 2 here)\n", " 1. [Step 3.e.ii](#full_diag): Decomposition of $\\psi_4$ into spin-weight -2 spherical harmonics: Full C-code diagnostic implementation \n", " 1. [Step 3.f](#coutput): Output all NRPy+ C-code kernels, in parallel if possible \n", " 1. [Step 3.g](#cparams_rfm_and_domainsize): Output C codes needed for declaring and setting Cparameters; also set `free_parameters.h`\n", "1. [Step 4](#bc_functs): Set up boundary condition functions for chosen singular, curvilinear coordinate system\n", "1. [Step 5](#mainc): `BrillLindquist_Playground.c`: The Main C Code\n", "1. [Step 6](#visualize): Data Visualization Animations\n", " 1. [Step 6.a](#installdownload): Install `scipy` and download `ffmpeg` if they are not yet installed/downloaded\n", " 1. [Step 6.b](#genimages): Generate images for visualization animation\n", " 1. [Step 6.c](#genvideo): Generate visualization animation\n", "1. [Step 7](#convergence): Visualize the numerical error, and confirm that it converges to zero with increasing numerical resolution (sampling)\n", "1. [Step 8](#latex_pdf_output): Output this notebook to $\\LaTeX$-formatted PDF file" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 1: Set core NRPy+ parameters for numerical grids and reference metric \\[Back to [top](#toc)\\]\n", "$$\\label{initializenrpy}$$" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Step P0: Set the option for evolving the initial data forward in time\n", "# Options include \"low resolution\" and \"high resolution\"\n", "EvolOption = \"low resolution\"\n", "\n", "# Step P1: Import needed NRPy+ core modules:\n", "from outputC import lhrh,outCfunction,outC_function_dict # NRPy+: Core C code output module\n", "import finite_difference as fin # NRPy+: Finite difference C code generation module\n", "import NRPy_param_funcs as par # NRPy+: Parameter interface\n", "import grid as gri # NRPy+: Functions having to do with numerical grids\n", "import indexedexp as ixp # NRPy+: Symbolic indexed expression (e.g., tensors, vectors, etc.) support\n", "import reference_metric as rfm # NRPy+: Reference metric support\n", "import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface\n", "import shutil, os, sys, time # Standard Python modules for multiplatform OS-level functions, benchmarking\n", "\n", "# Step P2: Create C code output directory:\n", "Ccodesdir = os.path.join(\"BSSN_Two_BHs_Collide_Ccodes_psi4\")\n", "# First remove C code output directory if it exists\n", "# Courtesy https://stackoverflow.com/questions/303200/how-do-i-remove-delete-a-folder-that-is-not-empty\n", "shutil.rmtree(Ccodesdir, ignore_errors=True)\n", "# Then create a fresh directory\n", "cmd.mkdir(Ccodesdir)\n", "\n", "# Step P3: Create executable output directory:\n", "outdir = os.path.join(Ccodesdir, \"output\")\n", "cmd.mkdir(outdir)\n", "\n", "# Step 1: Set the spatial dimension parameter\n", "# to three (BSSN is a 3+1 decomposition\n", "# of Einstein's equations), and then read\n", "# the parameter as DIM.\n", "DIM = 3\n", "par.set_parval_from_str(\"grid::DIM\",DIM)\n", "\n", "# Step 1.a: Enable SIMD-optimized code?\n", "# I.e., generate BSSN and Ricci C code kernels using SIMD-vectorized\n", "# compiler intrinsics, which *greatly improve the code's performance*,\n", "# though at the expense of making the C-code kernels less\n", "# human-readable.\n", "# * Important note in case you wish to modify the BSSN/Ricci kernels\n", "# here by adding expressions containing transcendental functions\n", "# (e.g., certain scalar fields):\n", "# Note that SIMD-based transcendental function intrinsics are not\n", "# supported by the default installation of gcc or clang (you will\n", "# need to use e.g., the SLEEF library from sleef.org, for this\n", "# purpose). The Intel compiler suite does support these intrinsics\n", "# however without the need for external libraries.\n", "enable_SIMD = True\n", "\n", "# Step 2: Set some core parameters, including CoordSystem MoL timestepping algorithm,\n", "# FD order, floating point precision, and CFL factor:\n", "# Choices are: Spherical, SinhSpherical, SinhSphericalv2, Cylindrical, SinhCylindrical,\n", "# SymTP, SinhSymTP\n", "CoordSystem = \"SinhSpherical\"\n", "\n", "# Decompose psi_4 (second time derivative of gravitational\n", "# wave strain) into all spin-weight=-2\n", "# l,m spherical harmonics, starting at l=2\n", "# going up to and including l_max, set here:\n", "l_max = 2\n", "\n", "if EvolOption == \"low resolution\":\n", " # domain_size sets the default value for:\n", " # * Spherical's params.RMAX\n", " # * SinhSpherical*'s params.AMAX\n", " # * Cartesians*'s -params.{x,y,z}min & .{x,y,z}max\n", " # * Cylindrical's -params.ZMIN & .{Z,RHO}MAX\n", " # * SinhCylindrical's params.AMPL{RHO,Z}\n", " # * *SymTP's params.AMAX\n", " domain_size = 150 # Length scale of computational domain\n", " FD_order = 8 # Finite difference order: even numbers only, starting with 2. 12 is generally unstable\n", "elif EvolOption == \"high resolution\":\n", " # See above for description of the domain_size parameter\n", " domain_size = 300 # Length scale of computational domain\n", " FD_order = 10 # Finite difference order: even numbers only, starting with 2. 12 is generally unstable\n", "else:\n", " print(\"Error: EvolOption = \"+str(EvolOption)+\" unrecognized.\")\n", " exit(1)\n", "\n", "# sinh_width sets the default value for:\n", "# * SinhSpherical's params.SINHW\n", "# * SinhCylindrical's params.SINHW{RHO,Z}\n", "# * SinhSymTP's params.SINHWAA\n", "sinh_width = 0.2 # If Sinh* coordinates chosen\n", "\n", "# sinhv2_const_dr sets the default value for:\n", "# * SinhSphericalv2's params.const_dr\n", "# * SinhCylindricalv2's params.const_d{rho,z}\n", "sinhv2_const_dr = 0.05 # If Sinh*v2 coordinates chosen\n", "\n", "# SymTP_bScale sets the default value for:\n", "# * SinhSymTP's params.bScale\n", "SymTP_bScale = 0.5 # If SymTP chosen\n", "\n", "# Step 2.b: Set the timestepping order,\n", "# the core data type, and the CFL factor.\n", "# Step 2.b: Set the order of spatial and temporal derivatives;\n", "# the core data type, and the CFL factor.\n", "# RK_method choices include: Euler, \"RK2 Heun\", \"RK2 MP\", \"RK2 Ralston\", RK3, \"RK3 Heun\", \"RK3 Ralston\",\n", "# SSPRK3, RK4, DP5, DP5alt, CK5, DP6, L6, DP8\n", "RK_method = \"RK4\"\n", "REAL = \"double\" # Best to use double here.\n", "CFL_FACTOR= 1.0 # (GETS OVERWRITTEN WHEN EXECUTED.) In pure axisymmetry (symmetry_axes = 2 below) 1.0 works fine. Otherwise 0.5 or lower.\n", "\n", "# Step 3: Generate Runge-Kutta-based (RK-based) timestepping code.\n", "# As described above the Table of Contents, this is a 3-step process:\n", "# 3.A: Evaluate RHSs (RHS_string)\n", "# 3.B: Apply boundary conditions (post_RHS_string, pt 1)\n", "# 3.C: Enforce det(gammabar) = det(gammahat) constraint (post_RHS_string, pt 2)\n", "import MoLtimestepping.C_Code_Generation as MoL\n", "from MoLtimestepping.RK_Butcher_Table_Dictionary import Butcher_dict\n", "RK_order = Butcher_dict[RK_method][1]\n", "cmd.mkdir(os.path.join(Ccodesdir,\"MoLtimestepping/\"))\n", "MoL.MoL_C_Code_Generation(RK_method,\n", " RHS_string = \"\"\"\n", "Ricci_eval(&rfmstruct, ¶ms, RK_INPUT_GFS, auxevol_gfs);\n", "rhs_eval(&rfmstruct, ¶ms, auxevol_gfs, RK_INPUT_GFS, RK_OUTPUT_GFS);\"\"\",\n", " post_RHS_string = \"\"\"\n", "apply_bcs_curvilinear(¶ms, &bcstruct, NUM_EVOL_GFS, evol_gf_parity, RK_OUTPUT_GFS);\n", "enforce_detgammahat_constraint(&rfmstruct, ¶ms, RK_OUTPUT_GFS);\\n\"\"\",\n", " outdir = os.path.join(Ccodesdir,\"MoLtimestepping/\"))\n", "\n", "# Step 4: Set the coordinate system for the numerical grid\n", "par.set_parval_from_str(\"reference_metric::CoordSystem\",CoordSystem)\n", "rfm.reference_metric() # Create ReU, ReDD needed for rescaling B-L initial data, generating BSSN RHSs, etc.\n", "\n", "# Step 5: Set the finite differencing order to FD_order (set above).\n", "par.set_parval_from_str(\"finite_difference::FD_CENTDERIVS_ORDER\", FD_order)\n", "\n", "# Step 6: Copy SIMD/SIMD_intrinsics.h to $Ccodesdir/SIMD/SIMD_intrinsics.h\n", "cmd.mkdir(os.path.join(Ccodesdir,\"SIMD\"))\n", "shutil.copy(os.path.join(\"SIMD/\")+\"SIMD_intrinsics.h\",os.path.join(Ccodesdir,\"SIMD/\"))\n", "\n", "# Step 7: Set the direction=2 (phi) axis to be the symmetry axis; i.e.,\n", "# axis \"2\", corresponding to the i2 direction.\n", "# This sets all spatial derivatives in the phi direction to zero.\n", "par.set_parval_from_str(\"indexedexp::symmetry_axes\",\"2\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 1.c: Output needed C code for finding the minimum proper distance between grid points, needed for [CFL](https://en.wikipedia.org/w/index.php?title=Courant%E2%80%93Friedrichs%E2%80%93Lewy_condition&oldid=806430673)-limited timestep \\[Back to [top](#toc)\\]\n", "$$\\label{cfl}$$\n", "\n", "In order for our explicit-timestepping numerical solution to the scalar wave equation to be stable, it must satisfy the [CFL](https://en.wikipedia.org/w/index.php?title=Courant%E2%80%93Friedrichs%E2%80%93Lewy_condition&oldid=806430673) condition:\n", "$$\n", "\\Delta t \\le \\frac{\\min(ds_i)}{c},\n", "$$\n", "where $c$ is the wavespeed, and\n", "$$ds_i = h_i \\Delta x^i$$ \n", "is the proper distance between neighboring gridpoints in the $i$th direction (in 3D, there are 3 directions), $h_i$ is the $i$th reference metric scale factor, and $\\Delta x^i$ is the uniform grid spacing in the $i$th direction:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Output the find_timestep() function to a C file.\n", "rfm.out_timestep_func_to_file(os.path.join(Ccodesdir,\"find_timestep.h\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 2: Import Brill-Lindquist ADM initial data C function from the [`BSSN.BrillLindquist`](../edit/BSSN/BrillLindquist.py) NRPy+ module \\[Back to [top](#toc)\\]\n", "$$\\label{adm_id}$$\n", "\n", "The [`BSSN.BrillLindquist`](../edit/BSSN/BrillLindquist.py) NRPy+ module does the following:\n", "\n", "1. Set up Brill-Lindquist initial data [ADM](https://en.wikipedia.org/wiki/ADM_formalism) quantities in the **Cartesian basis**, as [documented here](Tutorial-ADM_Initial_Data-Brill-Lindquist.ipynb). \n", "1. Convert the ADM **Cartesian quantities** to **BSSN quantities in the desired Curvilinear basis** (set by reference_metric::CoordSystem), as [documented here](Tutorial-ADM_Initial_Data-Converting_ADMCartesian_to_BSSNCurvilinear.ipynb).\n", "1. Sets up the standardized C function for setting all BSSN Curvilinear gridfunctions in a pointwise fashion, as [written here](../edit/BSSN/BSSN_ID_function_string.py), and returns the C function as a Python string." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import BSSN.BrillLindquist as bl\n", "def BrillLindquistID():\n", " print(\"Generating optimized C code for Brill-Lindquist initial data. May take a while, depending on CoordSystem.\")\n", " start = time.time()\n", "\n", " bl.BrillLindquist() # Registers ID C function in dictionary, used below to output to file.\n", " with open(os.path.join(Ccodesdir,\"initial_data.h\"),\"w\") as file:\n", " file.write(outC_function_dict[\"initial_data\"])\n", " end = time.time()\n", " print(\"(BENCH) Finished BL initial data codegen in \"+str(end-start)+\" seconds.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 3: Output C code for BSSN spacetime solve \\[Back to [top](#toc)\\]\n", "$$\\label{bssn}$$\n", "\n", "\n", "\n", "## Step 3.a: Output C code for BSSN RHS expressions \\[Back to [top](#toc)\\]\n", "$$\\label{bssnrhs}$$" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Generating symbolic expressions for BSSN RHSs...\n", "(BENCH) Finished BSSN symbolic expressions in 3.0587854385375977 seconds.\n" ] } ], "source": [ "import BSSN.BSSN_RHSs as rhs\n", "import BSSN.BSSN_gauge_RHSs as gaugerhs\n", "# Set the *covariant*, second-order Gamma-driving shift condition\n", "par.set_parval_from_str(\"BSSN.BSSN_gauge_RHSs::ShiftEvolutionOption\", \"GammaDriving2ndOrder_Covariant\")\n", "\n", "print(\"Generating symbolic expressions for BSSN RHSs...\")\n", "start = time.time()\n", "# Enable rfm_precompute infrastructure, which results in\n", "# BSSN RHSs that are free of transcendental functions,\n", "# even in curvilinear coordinates, so long as\n", "# ConformalFactor is set to \"W\" (default).\n", "cmd.mkdir(os.path.join(Ccodesdir,\"rfm_files/\"))\n", "par.set_parval_from_str(\"reference_metric::enable_rfm_precompute\",\"True\")\n", "par.set_parval_from_str(\"reference_metric::rfm_precompute_Ccode_outdir\",os.path.join(Ccodesdir,\"rfm_files/\"))\n", "\n", "# Evaluate BSSN + BSSN gauge RHSs with rfm_precompute enabled:\n", "import BSSN.BSSN_quantities as Bq\n", "par.set_parval_from_str(\"BSSN.BSSN_quantities::LeaveRicciSymbolic\",\"True\")\n", "\n", "rhs.BSSN_RHSs()\n", "gaugerhs.BSSN_gauge_RHSs()\n", "\n", "# We use betaU as our upwinding control vector:\n", "Bq.BSSN_basic_tensors()\n", "betaU = Bq.betaU\n", "\n", "import BSSN.Enforce_Detgammahat_Constraint as EGC\n", "enforce_detg_constraint_symb_expressions = EGC.Enforce_Detgammahat_Constraint_symb_expressions()\n", "\n", "# Next compute Ricci tensor\n", "par.set_parval_from_str(\"BSSN.BSSN_quantities::LeaveRicciSymbolic\",\"False\")\n", "Bq.RicciBar__gammabarDD_dHatD__DGammaUDD__DGammaU()\n", "\n", "# Now register the Hamiltonian as a gridfunction.\n", "H = gri.register_gridfunctions(\"AUX\",\"H\")\n", "# Then define the Hamiltonian constraint and output the optimized C code.\n", "import BSSN.BSSN_constraints as bssncon\n", "bssncon.BSSN_constraints(add_T4UUmunu_source_terms=False)\n", "\n", "# Now that we are finished with all the rfm hatted\n", "# quantities in generic precomputed functional\n", "# form, let's restore them to their closed-\n", "# form expressions.\n", "par.set_parval_from_str(\"reference_metric::enable_rfm_precompute\",\"False\") # Reset to False to disable rfm_precompute.\n", "rfm.ref_metric__hatted_quantities()\n", "end = time.time()\n", "print(\"(BENCH) Finished BSSN symbolic expressions in \"+str(end-start)+\" seconds.\")\n", "\n", "def BSSN_RHSs():\n", " print(\"Generating C code for BSSN RHSs in \"+par.parval_from_str(\"reference_metric::CoordSystem\")+\" coordinates.\")\n", " start = time.time()\n", "\n", " # Construct the left-hand sides and right-hand-side expressions for all BSSN RHSs\n", " lhs_names = [ \"alpha\", \"cf\", \"trK\"]\n", " rhs_exprs = [gaugerhs.alpha_rhs, rhs.cf_rhs, rhs.trK_rhs]\n", " for i in range(3):\n", " lhs_names.append( \"betU\"+str(i))\n", " rhs_exprs.append(gaugerhs.bet_rhsU[i])\n", " lhs_names.append( \"lambdaU\"+str(i))\n", " rhs_exprs.append(rhs.lambda_rhsU[i])\n", " lhs_names.append( \"vetU\"+str(i))\n", " rhs_exprs.append(gaugerhs.vet_rhsU[i])\n", " for j in range(i,3):\n", " lhs_names.append( \"aDD\"+str(i)+str(j))\n", " rhs_exprs.append(rhs.a_rhsDD[i][j])\n", " lhs_names.append( \"hDD\"+str(i)+str(j))\n", " rhs_exprs.append(rhs.h_rhsDD[i][j])\n", "\n", " # Sort the lhss list alphabetically, and rhss to match.\n", " # This ensures the RHSs are evaluated in the same order\n", " # they're allocated in memory:\n", " lhs_names,rhs_exprs = [list(x) for x in zip(*sorted(zip(lhs_names,rhs_exprs), key=lambda pair: pair[0]))]\n", "\n", " # Declare the list of lhrh's\n", " BSSN_evol_rhss = []\n", " for var in range(len(lhs_names)):\n", " BSSN_evol_rhss.append(lhrh(lhs=gri.gfaccess(\"rhs_gfs\",lhs_names[var]),rhs=rhs_exprs[var]))\n", "\n", " # Set up the C function for the BSSN RHSs\n", " desc=\"Evaluate the BSSN RHSs\"\n", " name=\"rhs_eval\"\n", " outCfunction(\n", " outfile = os.path.join(Ccodesdir,name+\".h\"), desc=desc, name=name,\n", " params = \"\"\"rfm_struct *restrict rfmstruct,const paramstruct *restrict params,\n", " const REAL *restrict auxevol_gfs,const REAL *restrict in_gfs,REAL *restrict rhs_gfs\"\"\",\n", " body = fin.FD_outputC(\"returnstring\",BSSN_evol_rhss, params=\"outCverbose=False,enable_SIMD=True\",\n", " upwindcontrolvec=betaU),\n", " loopopts = \"InteriorPoints,enable_SIMD,enable_rfm_precompute\")\n", " end = time.time()\n", " print(\"(BENCH) Finished BSSN_RHS C codegen in \" + str(end - start) + \" seconds.\")\n", "\n", "def Ricci():\n", " print(\"Generating C code for Ricci tensor in \"+par.parval_from_str(\"reference_metric::CoordSystem\")+\" coordinates.\")\n", " start = time.time()\n", " desc=\"Evaluate the Ricci tensor\"\n", " name=\"Ricci_eval\"\n", " outCfunction(\n", " outfile = os.path.join(Ccodesdir,name+\".h\"), desc=desc, name=name,\n", " params = \"\"\"rfm_struct *restrict rfmstruct,const paramstruct *restrict params,\n", " const REAL *restrict in_gfs,REAL *restrict auxevol_gfs\"\"\",\n", " body = fin.FD_outputC(\"returnstring\",\n", " [lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"RbarDD00\"),rhs=Bq.RbarDD[0][0]),\n", " lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"RbarDD01\"),rhs=Bq.RbarDD[0][1]),\n", " lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"RbarDD02\"),rhs=Bq.RbarDD[0][2]),\n", " lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"RbarDD11\"),rhs=Bq.RbarDD[1][1]),\n", " lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"RbarDD12\"),rhs=Bq.RbarDD[1][2]),\n", " lhrh(lhs=gri.gfaccess(\"auxevol_gfs\",\"RbarDD22\"),rhs=Bq.RbarDD[2][2])],\n", " params=\"outCverbose=False,enable_SIMD=True\"),\n", " loopopts = \"InteriorPoints,enable_SIMD,enable_rfm_precompute\")\n", " end = time.time()\n", " print(\"(BENCH) Finished Ricci C codegen in \" + str(end - start) + \" seconds.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.b: Output C code for Hamiltonian constraint \\[Back to [top](#toc)\\]\n", "$$\\label{hamconstraint}$$\n", "\n", "Next output the C code for evaluating the Hamiltonian constraint [(**Tutorial**)](Tutorial-BSSN_constraints.ipynb). In the absence of numerical error, this constraint should evaluate to zero. However it does not due to numerical (typically truncation and roundoff) error. We will therefore measure the Hamiltonian constraint violation to gauge the accuracy of our simulation, and, ultimately determine whether errors are dominated by numerical finite differencing (truncation) error as expected." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def Hamiltonian():\n", " start = time.time()\n", " print(\"Generating optimized C code for Hamiltonian constraint. May take a while, depending on CoordSystem.\")\n", " # Set up the C function for the Hamiltonian RHS\n", " desc=\"Evaluate the Hamiltonian constraint\"\n", " name=\"Hamiltonian_constraint\"\n", " outCfunction(\n", " outfile = os.path.join(Ccodesdir,name+\".h\"), desc=desc, name=name,\n", " params = \"\"\"rfm_struct *restrict rfmstruct,const paramstruct *restrict params,\n", " REAL *restrict in_gfs, REAL *restrict aux_gfs\"\"\",\n", " body = fin.FD_outputC(\"returnstring\",lhrh(lhs=gri.gfaccess(\"aux_gfs\", \"H\"), rhs=bssncon.H),\n", " params=\"outCverbose=False\"),\n", " loopopts = \"InteriorPoints,enable_rfm_precompute\")\n", "\n", " end = time.time()\n", " print(\"(BENCH) Finished Hamiltonian C codegen in \" + str(end - start) + \" seconds.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.c: Enforce conformal 3-metric $\\det{\\bar{\\gamma}_{ij}}=\\det{\\hat{\\gamma}_{ij}}$ constraint \\[Back to [top](#toc)\\]\n", "$$\\label{enforce3metric}$$\n", "\n", "Then enforce conformal 3-metric $\\det{\\bar{\\gamma}_{ij}}=\\det{\\hat{\\gamma}_{ij}}$ constraint (Eq. 53 of [Ruchlin, Etienne, and Baumgarte (2018)](https://arxiv.org/abs/1712.07658)), as [documented in the corresponding NRPy+ tutorial notebook](Tutorial-BSSN_enforcing_determinant_gammabar_equals_gammahat_constraint.ipynb)\n", "\n", "Applying curvilinear boundary conditions should affect the initial data at the outer boundary, and will in general cause the $\\det{\\bar{\\gamma}_{ij}}=\\det{\\hat{\\gamma}_{ij}}$ constraint to be violated there. Thus after we apply these boundary conditions, we must always call the routine for enforcing the $\\det{\\bar{\\gamma}_{ij}}=\\det{\\hat{\\gamma}_{ij}}$ constraint:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": true }, "outputs": [], "source": [ "def gammadet():\n", " start = time.time()\n", " print(\"Generating optimized C code for gamma constraint. May take a while, depending on CoordSystem.\")\n", "\n", " # Set up the C function for the det(gammahat) = det(gammabar)\n", " EGC.output_Enforce_Detgammahat_Constraint_Ccode(Ccodesdir,exprs=enforce_detg_constraint_symb_expressions)\n", " end = time.time()\n", " print(\"(BENCH) Finished gamma constraint C codegen in \" + str(end - start) + \" seconds.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.d: Compute $\\psi_4$, which encodes gravitational wave information in our numerical relativity calculations \\[Back to [top](#toc)\\]\n", "$$\\label{psi4}$$\n", "\n", "The [Weyl scalar](https://en.wikipedia.org/wiki/Weyl_scalar) $\\psi_4$ encodes gravitational wave information in our numerical relativity calculations. For more details on how it is computed, see [this NRPy+ tutorial notebook for information on $\\psi_4$](Tutorial-Psi4.ipynb) and [this one on the Quasi-Kinnersley tetrad](Tutorial-Psi4_tetrads.ipynb) (as implemented in [Baker, Campanelli, Lousto (2001)](https://arxiv.org/pdf/gr-qc/0104063.pdf)).\n", "\n", "$\\psi_4$ is related to the gravitational wave strain via\n", "$$\n", "\\psi_4 = \\ddot{h}_+ - i \\ddot{h}_\\times,\n", "$$\n", "where $\\ddot{h}_+$ is the second time derivative of the $+$ polarization of the gravitational wave strain $h$, and $\\ddot{h}_\\times$ is the second time derivative of the $\\times$ polarization of the gravitational wave strain $h$." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Generating symbolic expressions for psi4...\n", "(BENCH) Finished psi4 symbolic expressions in 13.001359939575195 seconds.\n", "Output C function psi4() to file BSSN_Two_BHs_Collide_Ccodes_psi4/psi4.h\n" ] } ], "source": [ "import BSSN.Psi4_tetrads as BP4t\n", "par.set_parval_from_str(\"BSSN.Psi4_tetrads::TetradChoice\",\"QuasiKinnersley\")\n", "#par.set_parval_from_str(\"BSSN.Psi4_tetrads::UseCorrectUnitNormal\",\"True\")\n", "import BSSN.Psi4 as BP4\n", "print(\"Generating symbolic expressions for psi4...\")\n", "start = time.time()\n", "BP4.Psi4()\n", "end = time.time()\n", "print(\"(BENCH) Finished psi4 symbolic expressions in \"+str(end-start)+\" seconds.\")\n", "\n", "psi4r_0pt = gri.register_gridfunctions(\"AUX\",\"psi4r_0pt\")\n", "psi4r_1pt = gri.register_gridfunctions(\"AUX\",\"psi4r_1pt\")\n", "psi4r_2pt = gri.register_gridfunctions(\"AUX\",\"psi4r_2pt\")\n", "psi4i_0pt = gri.register_gridfunctions(\"AUX\",\"psi4i_0pt\")\n", "psi4i_1pt = gri.register_gridfunctions(\"AUX\",\"psi4i_1pt\")\n", "psi4i_2pt = gri.register_gridfunctions(\"AUX\",\"psi4i_2pt\")\n", "\n", "\n", "desc=\"\"\"Since it's so expensive to compute, instead of evaluating\n", "psi_4 at all interior points, this functions evaluates it on a\n", "point-by-point basis.\"\"\"\n", "name=\"psi4\"\n", "outCfunction(\n", " outfile = os.path.join(Ccodesdir,name+\".h\"), desc=desc, name=name,\n", " params = \"\"\"const paramstruct *restrict params,\n", " const int i0,const int i1,const int i2,\n", " REAL *restrict xx[3], const REAL *restrict in_gfs, REAL *restrict aux_gfs\"\"\",\n", " body = \"\"\"\n", " const int idx = IDX3S(i0,i1,i2);\n", " const REAL xx0 = xx[0][i0];const REAL xx1 = xx[1][i1];const REAL xx2 = xx[2][i2];\n", "// Real part of psi_4, divided into 3 terms\n", " {\n", "#include \"Psi4re_pt0_lowlevel.h\"\n", " }\n", " {\n", "#include \"Psi4re_pt1_lowlevel.h\"\n", " }\n", " {\n", "#include \"Psi4re_pt2_lowlevel.h\"\n", " }\n", "// Imaginary part of psi_4, divided into 3 terms\n", " {\n", "#include \"Psi4im_pt0_lowlevel.h\"\n", " }\n", " {\n", "#include \"Psi4im_pt1_lowlevel.h\"\n", " }\n", " {\n", "#include \"Psi4im_pt2_lowlevel.h\"\n", " }\"\"\")\n", "\n", "def Psi4re(part):\n", " print(\"Generating C code for psi4_re_pt\"+str(part)+\" in \"+par.parval_from_str(\"reference_metric::CoordSystem\")+\" coordinates.\")\n", " start = time.time()\n", " Psi4re_pt = fin.FD_outputC(\"returnstring\",\n", " [lhrh(lhs=gri.gfaccess(\"aux_gfs\",\"psi4r_\"+str(part)+\"pt\"),rhs=BP4.psi4_re_pt[part])],\n", " params=\"outCverbose=False,CSE_sorting=none\") # Generating the CSE for psi4 is the slowest\n", " # operation in this notebook, and much of the CSE\n", " # time is spent sorting CSE expressions. Disabling\n", " # this sorting makes the C codegen 3-4x faster,\n", " # but the tradeoff is that every time this is\n", " # run, the CSE patterns will be different\n", " # (though they should result in mathematically\n", " # *identical* expressions). You can expect\n", " # roundoff-level differences as a result.\n", " with open(os.path.join(Ccodesdir,\"Psi4re_pt\"+str(part)+\"_lowlevel.h\"), \"w\") as file:\n", " file.write(Psi4re_pt)\n", " end = time.time()\n", " print(\"(BENCH) Finished generating psi4_re_pt\"+str(part)+\" in \"+str(end-start)+\" seconds.\")\n", "\n", "def Psi4im(part):\n", " print(\"Generating C code for psi4_im_pt\"+str(part)+\" in \"+par.parval_from_str(\"reference_metric::CoordSystem\")+\" coordinates.\")\n", " start = time.time()\n", " Psi4im_pt = fin.FD_outputC(\"returnstring\",\n", " [lhrh(lhs=gri.gfaccess(\"aux_gfs\",\"psi4i_\"+str(part)+\"pt\"),rhs=BP4.psi4_im_pt[part])],\n", " params=\"outCverbose=False,CSE_sorting=none\") # Generating the CSE for psi4 is the slowest\n", " # operation in this notebook, and much of the CSE\n", " # time is spent sorting CSE expressions. Disabling\n", " # this sorting makes the C codegen 3-4x faster,\n", " # but the tradeoff is that every time this is\n", " # run, the CSE patterns will be different\n", " # (though they should result in mathematically\n", " # *identical* expressions). You can expect\n", " # roundoff-level differences as a result.\n", " with open(os.path.join(Ccodesdir,\"Psi4im_pt\"+str(part)+\"_lowlevel.h\"), \"w\") as file:\n", " file.write(Psi4im_pt)\n", " end = time.time()\n", " print(\"(BENCH) Finished generating psi4_im_pt\"+str(part)+\" in \"+str(end-start)+\" seconds.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.e: Decompose $\\psi_4$ into spin-weight -2 spherical harmonics \\[Back to [top](#toc)\\]\n", "$$\\label{decomposepsi4}$$ \n", "\n", "Instead of measuring $\\psi_4$ for all possible (gravitational wave) observers in our simulation domain, we instead decompose it into a natural basis set, which by convention is the spin-weight -2 spherical harmonics.\n", "\n", "Here we implement the algorithm for decomposing $\\psi_4$ into spin-weight -2 spherical harmonic modes. The decomposition is defined as follows:\n", "\n", "$$\n", "{}^{-2}\\left[\\psi_4\\right]_{\\ell,m}(t,R) = \\int \\int \\psi_4(t,R,\\theta,\\phi)\\ \\left[{}^{-2}Y^*_{\\ell,m}(\\theta,\\phi)\\right] \\sin \\theta d\\theta d\\phi,\n", "$$\n", "\n", "where\n", "\n", "* ${}^{-2}Y^*_{\\ell,m}(\\theta,\\phi)$ is the complex conjugate of the spin-weight $-2$ spherical harmonic $\\ell,m$ mode\n", "* $R$ is the (fixed) radius at which we extract $\\psi_4$ information\n", "* $t$ is the time coordinate\n", "* $\\theta,\\phi$ are the polar and azimuthal angles, respectively (we use [the physics notation for spherical coordinates](https://en.wikipedia.org/wiki/Spherical_coordinate_system) here)\n", "\n", "\n", "\n", "### Step 3.e.i Output ${}^{-2}Y_{\\ell,m}$, up to and including $\\ell=\\ell_{\\rm max}$=`l_max` (set to 2 here) \\[Back to [top](#toc)\\]\n", "$$\\label{spinweight}$$ \n", "\n", "Here we output all spin-weight $-2$ spherical harmonics [**Tutorial Module**](Tutorial-SpinWeighted_Spherical_Harmonics.ipynb) for $\\ell=0$ up to and including $\\ell=\\ell_{\\rm max}$=`l_max` (set to 2 here)." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "import SpinWeight_minus2_SphHarmonics.SpinWeight_minus2_SphHarmonics as swm2\n", "cmd.mkdir(os.path.join(Ccodesdir,\"SpinWeight_minus2_SphHarmonics\"))\n", "swm2.SpinWeight_minus2_SphHarmonics(maximum_l=l_max,\n", " filename=os.path.join(Ccodesdir,\"SpinWeight_minus2_SphHarmonics/SpinWeight_minus2_SphHarmonics.h\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "### Step 3.e.ii Decomposition of $\\psi_4$ into spin-weight -2 spherical harmonics: Full C-code diagnostic implementation \\[Back to [top](#toc)\\]\n", "$$\\label{full_diag}$$ \n", "\n", "Note that this diagnostic implementation assumes that `Spherical`-like coordinates are used (e.g., `SinhSpherical` or `Spherical`), which are the most natural coordinate system for decomposing $\\psi_4$ into spin-weight -2 modes.\n", "\n", "First we process the inputs needed to compute $\\psi_4$ at all needed $\\theta,\\phi$ points " ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Writing BSSN_Two_BHs_Collide_Ccodes_psi4/driver_psi4_spinweightm2_decomposition.h\n" ] } ], "source": [ "%%writefile $Ccodesdir/driver_psi4_spinweightm2_decomposition.h\n", "\n", "void driver_psi4_spinweightm2_decomposition(const paramstruct *restrict params,\n", " const REAL curr_time,const int R_ext_idx,\n", " REAL *restrict xx[3],\n", " const REAL *restrict y_n_gfs,\n", " REAL *restrict diagnostic_output_gfs) {\n", " #include \"set_Cparameters.h\"\n", " // Step 1: Set the extraction radius R_ext based on the radial index R_ext_idx\n", " REAL R_ext;\n", " {\n", " REAL xx0 = xx[0][R_ext_idx];\n", " REAL xx1 = xx[1][1];\n", " REAL xx2 = xx[2][1];\n", " REAL xCart[3];\n", " xx_to_Cart(params,xx,R_ext_idx,1,1,xCart);\n", " R_ext = sqrt(xCart[0]*xCart[0] + xCart[1]*xCart[1] + xCart[2]*xCart[2]);\n", " }\n", "\n", " // Step 2: Compute psi_4 at this extraction radius and store to a local 2D array.\n", " const int sizeof_2Darray = sizeof(REAL)*(Nxx_plus_2NGHOSTS1-2*NGHOSTS)*(Nxx_plus_2NGHOSTS2-2*NGHOSTS);\n", " REAL *restrict psi4r_at_R_ext = (REAL *restrict)malloc(sizeof_2Darray);\n", " REAL *restrict psi4i_at_R_ext = (REAL *restrict)malloc(sizeof_2Darray);\n", " // ... also store theta, sin(theta), and phi to corresponding 1D arrays.\n", " REAL *restrict sinth_array = (REAL *restrict)malloc(sizeof(REAL)*(Nxx_plus_2NGHOSTS1-2*NGHOSTS));\n", " REAL *restrict th_array = (REAL *restrict)malloc(sizeof(REAL)*(Nxx_plus_2NGHOSTS1-2*NGHOSTS));\n", " REAL *restrict ph_array = (REAL *restrict)malloc(sizeof(REAL)*(Nxx_plus_2NGHOSTS2-2*NGHOSTS));\n", " const int i0=R_ext_idx;\n", "#pragma omp parallel for\n", " for(int i1=NGHOSTS;i1=0) sprintf(filename,\"outpsi4_l%d_m+%d-%d-r%.2f.txt\",l,m, Nxx0,(double)R_ext);\n", " FILE *outpsi4_l_m;\n", " // 0 = n*dt when n=0 is exactly represented in double/long double precision,\n", " // so no worries about the result being ~1e-16 in double/ld precision\n", " if(curr_time==0) outpsi4_l_m = fopen(filename, \"w\");\n", " else outpsi4_l_m = fopen(filename, \"a\");\n", " fprintf(outpsi4_l_m,\"%e %.15e %.15e\\n\", (double)(curr_time),\n", " (double)psi4r_l_m,(double)psi4i_l_m);\n", " fclose(outpsi4_l_m);\n", " }\n", " }\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we complete the function `output_psi4_spinweight_m2_decomposition()`, now calling the above routine and freeing all allocated memory." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Appending to BSSN_Two_BHs_Collide_Ccodes_psi4/driver_psi4_spinweightm2_decomposition.h\n" ] } ], "source": [ "%%writefile -a $Ccodesdir/driver_psi4_spinweightm2_decomposition.h\n", "\n", " // Step 4: Perform integrations across all l,m modes from l=2 up to and including L_MAX (global variable):\n", " lowlevel_decompose_psi4_into_swm2_modes(params, curr_time,R_ext, th_array,sinth_array, ph_array,\n", " psi4r_at_R_ext,psi4i_at_R_ext);\n", "\n", " // Step 5: Free all allocated memory:\n", " free(psi4r_at_R_ext); free(psi4i_at_R_ext);\n", " free(sinth_array); free(th_array); free(ph_array);\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.f: Output all NRPy+ C-code kernels, in parallel if possible \\[Back to [top](#toc)\\]\n", "$$\\label{coutput}$$ " ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Generating C code for psi4_re_pt0 in SinhSpherical coordinates.Generating C code for psi4_re_pt1 in SinhSpherical coordinates.Generating C code for psi4_re_pt2 in SinhSpherical coordinates.Generating C code for psi4_im_pt0 in SinhSpherical coordinates.Generating C code for psi4_im_pt1 in SinhSpherical coordinates.Generating C code for psi4_im_pt2 in SinhSpherical coordinates.Generating optimized C code for Brill-Lindquist initial data. May take a while, depending on CoordSystem.\n", "Generating C code for BSSN RHSs in SinhSpherical coordinates.\n", "\n", "Generating C code for Ricci tensor in SinhSpherical coordinates.\n", "\n", "\n", "Generating optimized C code for Hamiltonian constraint. May take a while, depending on CoordSystem.Generating optimized C code for gamma constraint. May take a while, depending on CoordSystem.\n", "\n", "\n", "\n", "\n", "Output C function enforce_detgammahat_constraint() to file BSSN_Two_BHs_Collide_Ccodes_psi4/enforce_detgammahat_constraint.h\n", "(BENCH) Finished gamma constraint C codegen in 0.10424590110778809 seconds.\n", "(BENCH) Finished generating psi4_im_pt1 in 12.016667366027832 seconds.\n", "(BENCH) Finished BL initial data codegen in 14.484731197357178 seconds.\n", "(BENCH) Finished generating psi4_im_pt2 in 15.47280764579773 seconds.\n", "Output C function rhs_eval() to file BSSN_Two_BHs_Collide_Ccodes_psi4/rhs_eval.h\n", "(BENCH) Finished BSSN_RHS C codegen in 20.126734733581543 seconds.\n", "(BENCH) Finished generating psi4_re_pt2 in 21.123689651489258 seconds.\n", "Output C function Ricci_eval() to file BSSN_Two_BHs_Collide_Ccodes_psi4/Ricci_eval.h\n", "(BENCH) Finished Ricci C codegen in 21.265940189361572 seconds.\n", "(BENCH) Finished generating psi4_re_pt1 in 22.23289155960083 seconds.\n", "Output C function Hamiltonian_constraint() to file BSSN_Two_BHs_Collide_Ccodes_psi4/Hamiltonian_constraint.h\n", "(BENCH) Finished Hamiltonian C codegen in 37.140023946762085 seconds.\n", "(BENCH) Finished generating psi4_im_pt0 in 38.12496042251587 seconds.\n", "(BENCH) Finished generating psi4_re_pt0 in 65.21467590332031 seconds.\n" ] } ], "source": [ "# Step 0: Import the multiprocessing module.\n", "import multiprocessing\n", "\n", "# Step 1: Create a list of functions we wish to evaluate in parallel\n", "funcs = [Psi4re,Psi4re,Psi4re,Psi4im,Psi4im,Psi4im, BrillLindquistID,BSSN_RHSs,Ricci,Hamiltonian,gammadet]\n", "\n", "# Step 1.a: Define master function for calling all above functions.\n", "# Note that lambdifying this doesn't work in Python 3\n", "def master_func(idx):\n", " if idx < 3: # Call Psi4re(arg)\n", " funcs[idx](idx)\n", " elif idx < 6: # Call Psi4im(arg-3)\n", " funcs[idx](idx-3)\n", " else: # All non-Psi4 functions:\n", " funcs[idx]()\n", "\n", "try:\n", " if os.name == 'nt':\n", " # It's a mess to get working in Windows, so we don't bother. :/\n", " # https://medium.com/@grvsinghal/speed-up-your-python-code-using-multiprocessing-on-windows-and-jupyter-or-ipython-2714b49d6fac\n", " raise Exception(\"Parallel codegen currently not available in Windows\")\n", " # Step 1.b: Import the multiprocessing module.\n", " import multiprocessing\n", "\n", " # Step 1.c: Evaluate list of functions in parallel if possible;\n", " # otherwise fallback to serial evaluation:\n", " pool = multiprocessing.Pool()\n", " pool.map(master_func,range(len(funcs)))\n", "except:\n", " # Steps 1.b-1.c, alternate: As fallback, evaluate functions in serial.\n", " # This will happen on Android and Windows systems\n", " for idx in range(len(funcs)):\n", " master_func(idx)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 3.g: Output C codes needed for declaring and setting Cparameters; also set `free_parameters.h` \\[Back to [top](#toc)\\]\n", "$$\\label{cparams_rfm_and_domainsize}$$\n", "\n", "Based on declared NRPy+ Cparameters, first we generate `declare_Cparameters_struct.h`, `set_Cparameters_default.h`, and `set_Cparameters[-SIMD].h`.\n", "\n", "Then we output `free_parameters.h`, which sets initial data parameters, as well as grid domain & reference metric parameters, applying `domain_size` and `sinh_width`/`SymTP_bScale` (if applicable) as set above" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "# Step 3.f.i: Generate declare_Cparameters_struct.h, set_Cparameters_default.h, and set_Cparameters[-SIMD].h\n", "par.generate_Cparameters_Ccodes(os.path.join(Ccodesdir))\n", "\n", "# Step 3.f.ii: Set free_parameters.h\n", "with open(os.path.join(Ccodesdir,\"free_parameters.h\"),\"w\") as file:\n", " file.write(\"\"\"\n", "// Set free-parameter values.\n", "\n", "// Set free-parameter values for BSSN evolution:\n", "params.eta = 2.0;\n", "\n", "// Set free parameters for the (Brill-Lindquist) initial data\n", "params.BH1_posn_x = 0.0; params.BH1_posn_y = 0.0; params.BH1_posn_z =+0.25;\n", "params.BH2_posn_x = 0.0; params.BH2_posn_y = 0.0; params.BH2_posn_z =-0.25;\n", "params.BH1_mass = 0.5; params.BH2_mass = 0.5;\\n\"\"\")\n", "\n", "# Append to $Ccodesdir/free_parameters.h reference metric parameters based on generic\n", "# domain_size,sinh_width,sinhv2_const_dr,SymTP_bScale,\n", "# parameters set above.\n", "rfm.out_default_free_parameters_for_rfm(os.path.join(Ccodesdir,\"free_parameters.h\"),\n", " domain_size,sinh_width,sinhv2_const_dr,SymTP_bScale)\n", "\n", "# Step 3.f.iii: Generate set_Nxx_dxx_invdx_params__and__xx.h:\n", "rfm.set_Nxx_dxx_invdx_params__and__xx_h(Ccodesdir)\n", "\n", "# Step 3.f.iv: Generate xx_to_Cart.h, which contains xx_to_Cart() for\n", "# (the mapping from xx->Cartesian) for the chosen\n", "# CoordSystem:\n", "rfm.xx_to_Cart_h(\"xx_to_Cart\",\"./set_Cparameters.h\",os.path.join(Ccodesdir,\"xx_to_Cart.h\"))\n", "\n", "# Step 3.f.v: Generate declare_Cparameters_struct.h, set_Cparameters_default.h, and set_Cparameters[-SIMD].h\n", "par.generate_Cparameters_Ccodes(os.path.join(Ccodesdir))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 4: Set up boundary condition functions for chosen singular, curvilinear coordinate system \\[Back to [top](#toc)\\]\n", "$$\\label{bc_functs}$$\n", "\n", "Next apply singular, curvilinear coordinate boundary conditions [as documented in the corresponding NRPy+ tutorial notebook](Tutorial-Start_to_Finish-Curvilinear_BCs.ipynb)" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Wrote to file \"BSSN_Two_BHs_Collide_Ccodes_psi4/boundary_conditions/parity_conditions_symbolic_dot_products.h\"\n", "Evolved parity: ( aDD00:4, aDD01:5, aDD02:6, aDD11:7, aDD12:8, aDD22:9,\n", " alpha:0, betU0:1, betU1:2, betU2:3, cf:0, hDD00:4, hDD01:5, hDD02:6,\n", " hDD11:7, hDD12:8, hDD22:9, lambdaU0:1, lambdaU1:2, lambdaU2:3, trK:0,\n", " vetU0:1, vetU1:2, vetU2:3 )\n", "Auxiliary parity: ( H:0, psi4i_0pt:0, psi4i_1pt:0, psi4i_2pt:0,\n", " psi4r_0pt:0, psi4r_1pt:0, psi4r_2pt:0 )\n", "AuxEvol parity: ( RbarDD00:4, RbarDD01:5, RbarDD02:6, RbarDD11:7,\n", " RbarDD12:8, RbarDD22:9 )\n", "Wrote to file \"BSSN_Two_BHs_Collide_Ccodes_psi4/boundary_conditions/EigenCoord_Cart_to_xx.h\"\n" ] } ], "source": [ "import CurviBoundaryConditions.CurviBoundaryConditions as cbcs\n", "cbcs.Set_up_CurviBoundaryConditions(os.path.join(Ccodesdir,\"boundary_conditions/\"),Cparamspath=os.path.join(\"../\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 5: `BrillLindquist_Playground.c`: The Main C Code \\[Back to [top](#toc)\\]\n", "$$\\label{mainc}$$" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "# Part P0: Define REAL, set the number of ghost cells NGHOSTS (from NRPy+'s FD_CENTDERIVS_ORDER),\n", "# and set the CFL_FACTOR (which can be overwritten at the command line)\n", "\n", "with open(os.path.join(Ccodesdir,\"BSSN_Playground_REAL__NGHOSTS__CFL_FACTOR.h\"), \"w\") as file:\n", " file.write(\"\"\"\n", "// Part P0.a: Set the number of ghost cells, from NRPy+'s FD_CENTDERIVS_ORDER\n", "#define NGHOSTS \"\"\"+str(int(FD_order/2)+1)+\"\"\"\n", "// Part P0.b: Set the numerical precision (REAL) to double, ensuring all floating point\n", "// numbers are stored to at least ~16 significant digits\n", "#define REAL \"\"\"+REAL+\"\"\"\n", "// Part P0.c: Set the number of ghost cells, from NRPy+'s FD_CENTDERIVS_ORDER\n", "REAL CFL_FACTOR = \"\"\"+str(CFL_FACTOR)+\"\"\"; // Set the CFL Factor. Can be overwritten at command line.\n", "// Part P0.d: We decompose psi_4 into all spin-weight=-2\n", "// l,m spherical harmonics, starting at l=2,\n", "// going up to and including l_max, set here:\n", "#define L_MAX \"\"\"+str(l_max)+\"\"\"\n", "\"\"\")" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Writing BSSN_Two_BHs_Collide_Ccodes_psi4/BrillLindquist_Playground.c\n" ] } ], "source": [ "%%writefile $Ccodesdir/BrillLindquist_Playground.c\n", "\n", "// Step P0: Define REAL and NGHOSTS; and declare CFL_FACTOR. This header is generated in NRPy+.\n", "#include \"BSSN_Playground_REAL__NGHOSTS__CFL_FACTOR.h\"\n", "\n", "#include \"rfm_files/rfm_struct__declare.h\"\n", "\n", "#include \"declare_Cparameters_struct.h\"\n", "\n", "// All SIMD intrinsics used in SIMD-enabled C code loops are defined here:\n", "#include \"SIMD/SIMD_intrinsics.h\"\n", "\n", "// Step P1: Import needed header files\n", "#include \"stdio.h\"\n", "#include \"stdlib.h\"\n", "#include \"math.h\"\n", "#include \"time.h\"\n", "#include \"stdint.h\" // Needed for Windows GCC 6.x compatibility\n", "#ifndef M_PI\n", "#define M_PI 3.141592653589793238462643383279502884L\n", "#endif\n", "#ifndef M_SQRT1_2\n", "#define M_SQRT1_2 0.707106781186547524400844362104849039L\n", "#endif\n", "#define wavespeed 1.0 // Set CFL-based \"wavespeed\" to 1.0.\n", "\n", "// Step P2: Declare the IDX4S(gf,i,j,k) macro, which enables us to store 4-dimensions of\n", "// data in a 1D array. In this case, consecutive values of \"i\"\n", "// (all other indices held to a fixed value) are consecutive in memory, where\n", "// consecutive values of \"j\" (fixing all other indices) are separated by\n", "// Nxx_plus_2NGHOSTS0 elements in memory. Similarly, consecutive values of\n", "// \"k\" are separated by Nxx_plus_2NGHOSTS0*Nxx_plus_2NGHOSTS1 in memory, etc.\n", "#define IDX4S(g,i,j,k) \\\n", "( (i) + Nxx_plus_2NGHOSTS0 * ( (j) + Nxx_plus_2NGHOSTS1 * ( (k) + Nxx_plus_2NGHOSTS2 * (g) ) ) )\n", "#define IDX4ptS(g,idx) ( (idx) + (Nxx_plus_2NGHOSTS0*Nxx_plus_2NGHOSTS1*Nxx_plus_2NGHOSTS2) * (g) )\n", "#define IDX3S(i,j,k) ( (i) + Nxx_plus_2NGHOSTS0 * ( (j) + Nxx_plus_2NGHOSTS1 * ( (k) ) ) )\n", "#define LOOP_REGION(i0min,i0max, i1min,i1max, i2min,i2max) \\\n", " for(int i2=i2min;i2Cartesian via\n", "// {xx[0][i0],xx[1][i1],xx[2][i2]}->{xCart[0],xCart[1],xCart[2]}\n", "#include \"xx_to_Cart.h\"\n", "\n", "// Step P5: Defines set_Nxx_dxx_invdx_params__and__xx(const int EigenCoord, const int Nxx[3],\n", "// paramstruct *restrict params, REAL *restrict xx[3]),\n", "// which sets params Nxx,Nxx_plus_2NGHOSTS,dxx,invdx, and xx[] for\n", "// the chosen Eigen-CoordSystem if EigenCoord==1, or\n", "// CoordSystem if EigenCoord==0.\n", "#include \"set_Nxx_dxx_invdx_params__and__xx.h\"\n", "\n", "// Step P6: Include basic functions needed to impose curvilinear\n", "// parity and boundary conditions.\n", "#include \"boundary_conditions/CurviBC_include_Cfunctions.h\"\n", "\n", "// Step P7: Implement the algorithm for upwinding.\n", "// *NOTE*: This upwinding is backwards from\n", "// usual upwinding algorithms, because the\n", "// upwinding control vector in BSSN (the shift)\n", "// acts like a *negative* velocity.\n", "//#define UPWIND_ALG(UpwindVecU) UpwindVecU > 0.0 ? 1.0 : 0.0\n", "\n", "// Step P8: Include function for enforcing detgammabar constraint.\n", "#include \"enforce_detgammahat_constraint.h\"\n", "\n", "// Step P9: Find the CFL-constrained timestep\n", "#include \"find_timestep.h\"\n", "\n", "// Step P10: Declare function necessary for setting up the initial data.\n", "// Step P10.a: Define BSSN_ID() for BrillLindquist initial data\n", "// Step P10.b: Set the generic driver function for setting up BSSN initial data\n", "#include \"initial_data.h\"\n", "\n", "// Step P11: Declare function for evaluating Hamiltonian constraint (diagnostic)\n", "#include \"Hamiltonian_constraint.h\"\n", "\n", "// Step P12: Declare rhs_eval function, which evaluates BSSN RHSs\n", "#include \"rhs_eval.h\"\n", "\n", "// Step P13: Declare Ricci_eval function, which evaluates Ricci tensor\n", "#include \"Ricci_eval.h\"\n", "\n", "// Step P14: Declare function for evaluating real and imaginary parts of psi4 (diagnostic)\n", "#include \"psi4.h\"\n", "#include \"SpinWeight_minus2_SphHarmonics/SpinWeight_minus2_SphHarmonics.h\"\n", "#include \"lowlevel_decompose_psi4_into_swm2_modes.h\"\n", "#include \"driver_psi4_spinweightm2_decomposition.h\"\n", "\n", "// main() function:\n", "// Step 0: Read command-line input, set up grid structure, allocate memory for gridfunctions, set up coordinates\n", "// Step 1: Set up initial data to an exact solution\n", "// Step 2: Start the timer, for keeping track of how fast the simulation is progressing.\n", "// Step 3: Integrate the initial data forward in time using the chosen RK-like Method of\n", "// Lines timestepping algorithm, and output periodic simulation diagnostics\n", "// Step 3.a: Output 2D data file periodically, for visualization\n", "// Step 3.b: Step forward one timestep (t -> t+dt) in time using\n", "// chosen RK-like MoL timestepping algorithm\n", "// Step 3.c: If t=t_final, output conformal factor & Hamiltonian\n", "// constraint violation to 2D data file\n", "// Step 3.d: Progress indicator printing to stderr\n", "// Step 4: Free all allocated memory\n", "int main(int argc, const char *argv[]) {\n", " paramstruct params;\n", "#include \"set_Cparameters_default.h\"\n", "\n", " // Step 0a: Read command-line input, error out if nonconformant\n", " if((argc != 4 && argc != 5) || atoi(argv[1]) < NGHOSTS || atoi(argv[2]) < NGHOSTS || atoi(argv[3]) < 2 /* FIXME; allow for axisymmetric sims */) {\n", " fprintf(stderr,\"Error: Expected three command-line arguments: ./BrillLindquist_Playground Nx0 Nx1 Nx2,\\n\");\n", " fprintf(stderr,\"where Nx[0,1,2] is the number of grid points in the 0, 1, and 2 directions.\\n\");\n", " fprintf(stderr,\"Nx[] MUST BE larger than NGHOSTS (= %d)\\n\",NGHOSTS);\n", " exit(1);\n", " }\n", " if(argc == 5) {\n", " CFL_FACTOR = strtod(argv[4],NULL);\n", " }\n", " if(CFL_FACTOR > 0.5 && atoi(argv[3])!=2) {\n", " fprintf(stderr,\"WARNING: CFL_FACTOR was set to %e, which is > 0.5.\\n\",CFL_FACTOR);\n", " fprintf(stderr,\" This will generally only be stable if the simulation is purely axisymmetric\\n\");\n", " fprintf(stderr,\" However, Nx2 was set to %d>2, which implies a non-axisymmetric simulation\\n\",atoi(argv[3]));\n", " }\n", " // Step 0b: Set up numerical grid structure, first in space...\n", " const int Nxx[3] = { atoi(argv[1]), atoi(argv[2]), atoi(argv[3]) };\n", " if(Nxx[0]%2 != 0 || Nxx[1]%2 != 0 || Nxx[2]%2 != 0) {\n", " fprintf(stderr,\"Error: Cannot guarantee a proper cell-centered grid if number of grid cells not set to even number.\\n\");\n", " fprintf(stderr,\" For example, in case of angular directions, proper symmetry zones will not exist.\\n\");\n", " exit(1);\n", " }\n", "\n", " // Step 0c: Set free parameters, overwriting Cparameters defaults\n", " // by hand or with command-line input, as desired.\n", "#include \"free_parameters.h\"\n", "\n", " // Step 0d: Uniform coordinate grids are stored to *xx[3]\n", " REAL *xx[3];\n", " // Step 0d.i: Set bcstruct\n", " bc_struct bcstruct;\n", " {\n", " int EigenCoord = 1;\n", " // Step 0d.ii: Call set_Nxx_dxx_invdx_params__and__xx(), which sets\n", " // params Nxx,Nxx_plus_2NGHOSTS,dxx,invdx, and xx[] for the\n", " // chosen Eigen-CoordSystem.\n", " set_Nxx_dxx_invdx_params__and__xx(EigenCoord, Nxx, ¶ms, xx);\n", " // Step 0d.iii: Set Nxx_plus_2NGHOSTS_tot\n", " #include \"set_Cparameters-nopointer.h\"\n", " const int Nxx_plus_2NGHOSTS_tot = Nxx_plus_2NGHOSTS0*Nxx_plus_2NGHOSTS1*Nxx_plus_2NGHOSTS2;\n", " // Step 0e: Find ghostzone mappings; set up bcstruct\n", " #include \"boundary_conditions/driver_bcstruct.h\"\n", " // Step 0e.i: Free allocated space for xx[][] array\n", " for(int i=0;i<3;i++) free(xx[i]);\n", " }\n", "\n", " // Step 0f: Call set_Nxx_dxx_invdx_params__and__xx(), which sets\n", " // params Nxx,Nxx_plus_2NGHOSTS,dxx,invdx, and xx[] for the\n", " // chosen (non-Eigen) CoordSystem.\n", " int EigenCoord = 0;\n", " set_Nxx_dxx_invdx_params__and__xx(EigenCoord, Nxx, ¶ms, xx);\n", "\n", " // Step 0g: Set all C parameters \"blah\" for params.blah, including\n", " // Nxx_plus_2NGHOSTS0 = params.Nxx_plus_2NGHOSTS0, etc.\n", " #include \"set_Cparameters-nopointer.h\"\n", " const int Nxx_plus_2NGHOSTS_tot = Nxx_plus_2NGHOSTS0*Nxx_plus_2NGHOSTS1*Nxx_plus_2NGHOSTS2;\n", "\n", " // Step 0h: Time coordinate parameters\n", " const REAL t_final = 1.5*domain_size; /* Final time is set so that at t=t_final,\n", " * data at the origin have not been corrupted\n", " * by the approximate outer boundary condition */\n", "\n", " // Step 0i: Set timestep based on smallest proper distance between gridpoints and CFL factor\n", " REAL dt = find_timestep(¶ms, xx);\n", " //fprintf(stderr,\"# Timestep set to = %e\\n\",(double)dt);\n", " int N_final = (int)(t_final / dt + 0.5); // The number of points in time.\n", " // Add 0.5 to account for C rounding down\n", " // typecasts to integers.\n", " const REAL out_approx_every_t = 0.5;\n", " int output_every_N = (int)(out_approx_every_t*((REAL)N_final)/t_final);\n", "\n", " // Step 0j: Error out if the number of auxiliary gridfunctions outnumber evolved gridfunctions.\n", " // This is a limitation of the RK method. You are always welcome to declare & allocate\n", " // additional gridfunctions by hand.\n", " if(NUM_AUX_GFS > NUM_EVOL_GFS) {\n", " fprintf(stderr,\"Error: NUM_AUX_GFS > NUM_EVOL_GFS. Either reduce the number of auxiliary gridfunctions,\\n\");\n", " fprintf(stderr,\" or allocate (malloc) by hand storage for *diagnostic_output_gfs. \\n\");\n", " exit(1);\n", " }\n", "\n", " // Step 0k: Allocate memory for gridfunctions\n", " #include \"MoLtimestepping/RK_Allocate_Memory.h\"\n", " REAL *restrict auxevol_gfs = (REAL *)malloc(sizeof(REAL) * NUM_AUXEVOL_GFS * Nxx_plus_2NGHOSTS_tot);\n", "\n", " // Step 0l: Set up precomputed reference metric arrays\n", " // Step 0l.i: Allocate space for precomputed reference metric arrays.\n", " #include \"rfm_files/rfm_struct__malloc.h\"\n", "\n", " // Step 0l.ii: Define precomputed reference metric arrays.\n", " {\n", " #include \"set_Cparameters-nopointer.h\"\n", " #include \"rfm_files/rfm_struct__define.h\"\n", " }\n", "\n", " // Step 1: Set up initial data to an exact solution\n", " initial_data(¶ms, xx, y_n_gfs);\n", "\n", " // Step 1b: Apply boundary conditions, as initial data\n", " // are sometimes ill-defined in ghost zones.\n", " // E.g., spherical initial data might not be\n", " // properly defined at points where r=-1.\n", " apply_bcs_curvilinear(¶ms, &bcstruct, NUM_EVOL_GFS,evol_gf_parity, y_n_gfs);\n", " enforce_detgammahat_constraint(&rfmstruct, ¶ms, y_n_gfs);\n", "\n", " // Step 2: Start the timer, for keeping track of how fast the simulation is progressing.\n", "#ifdef __linux__ // Use high-precision timer in Linux.\n", " struct timespec start, end;\n", " clock_gettime(CLOCK_REALTIME, &start);\n", "#else // Resort to low-resolution, standards-compliant timer in non-Linux OSs\n", " // http://www.cplusplus.com/reference/ctime/time/\n", " time_t start_timer,end_timer;\n", " time(&start_timer); // Resolution of one second...\n", "#endif\n", "\n", " // Step 3: Integrate the initial data forward in time using the chosen RK-like Method of\n", " // Lines timestepping algorithm, and output periodic simulation diagnostics\n", " for(int n=0;n<=N_final;n++) { // Main loop to progress forward in time.\n", "\n", " // Step 3.a: Output diagnostics\n", " if(n%output_every_N == 0) {\n", " // Step 3.a.i: Output psi4 spin-weight -2 decomposed data, every N_output_every\n", " for(int r_ext_idx = (Nxx_plus_2NGHOSTS0-NGHOSTS)/4;\n", " r_ext_idx<(Nxx_plus_2NGHOSTS0-NGHOSTS)*0.9;\n", " r_ext_idx+=5) {\n", " // psi_4 mode-by-mode spin-weight -2 spherical harmonic decomposition routine\n", " driver_psi4_spinweightm2_decomposition(¶ms, ((REAL)n)*dt,r_ext_idx,\n", " xx, y_n_gfs, diagnostic_output_gfs);\n", " }\n", " }\n", " if(n%100 == 0) {\n", " // Step 3.a.ii: Regularly output conformal factor & Hamiltonian\n", " // constraint violation to 2D data file\n", " // Evaluate Hamiltonian constraint violation\n", " Hamiltonian_constraint(&rfmstruct, ¶ms, y_n_gfs, diagnostic_output_gfs);\n", " char filename[100];\n", " sprintf(filename,\"out%d-%08d.txt\",Nxx[0],n);\n", " FILE *out2D = fopen(filename, \"w\");\n", " LOOP_REGION(NGHOSTS,Nxx_plus_2NGHOSTS0-NGHOSTS,\n", " NGHOSTS,Nxx_plus_2NGHOSTS1-NGHOSTS,\n", " NGHOSTS,Nxx_plus_2NGHOSTS2-NGHOSTS) {\n", " REAL xCart[3]; xx_to_Cart(¶ms,xx,i0,i1,i2, xCart);\n", " int idx = IDX3S(i0,i1,i2);\n", " fprintf(out2D,\"%e %e %e %e\\n\",xCart[1],xCart[2],\n", " y_n_gfs[IDX4ptS(CFGF,idx)], log10(fabs(diagnostic_output_gfs[IDX4ptS(HGF,idx)])));\n", " }\n", " fclose(out2D);\n", " }\n", "\n", " // Step 3.b: Step forward one timestep (t -> t+dt) in time using\n", " // chosen RK-like MoL timestepping algorithm\n", "#include \"MoLtimestepping/RK_MoL.h\"\n", "\n", " // Step 3.c: If t=t_final, output conformal factor & Hamiltonian\n", " // constraint violation to 2D data file\n", " if(n==N_final-1) {\n", " // Evaluate Hamiltonian constraint violation\n", " Hamiltonian_constraint(&rfmstruct, ¶ms, y_n_gfs, diagnostic_output_gfs);\n", " char filename[100];\n", " sprintf(filename,\"out%d.txt\",Nxx[0]);\n", " FILE *out2D = fopen(filename, \"w\");\n", " LOOP_REGION(NGHOSTS,Nxx_plus_2NGHOSTS0-NGHOSTS,\n", " NGHOSTS,Nxx_plus_2NGHOSTS1-NGHOSTS,\n", " NGHOSTS,Nxx_plus_2NGHOSTS2-NGHOSTS) {\n", " REAL xCart[3]; xx_to_Cart(¶ms,xx,i0,i1,i2, xCart);\n", " int idx = IDX3S(i0,i1,i2);\n", " fprintf(out2D,\"%e %e %e %e\\n\",xCart[1],xCart[2], y_n_gfs[IDX4ptS(CFGF,idx)],\n", " log10(fabs(diagnostic_output_gfs[IDX4ptS(HGF,idx)])));\n", " }\n", " fclose(out2D);\n", " }\n", " // Step 3.d: Progress indicator printing to stderr\n", "\n", " // Step 3.d.i: Measure average time per iteration\n", "#ifdef __linux__ // Use high-precision timer in Linux.\n", " clock_gettime(CLOCK_REALTIME, &end);\n", " const long long unsigned int time_in_ns = 1000000000L * (end.tv_sec - start.tv_sec) + end.tv_nsec - start.tv_nsec;\n", "#else // Resort to low-resolution, standards-compliant timer in non-Linux OSs\n", " time(&end_timer); // Resolution of one second...\n", " REAL time_in_ns = difftime(end_timer,start_timer)*1.0e9+0.5; // Round up to avoid divide-by-zero.\n", "#endif\n", " const REAL s_per_iteration_avg = ((REAL)time_in_ns / (REAL)n) / 1.0e9;\n", "\n", " const int iterations_remaining = N_final - n;\n", " const REAL time_remaining_in_mins = s_per_iteration_avg * (REAL)iterations_remaining / 60.0;\n", "\n", " const REAL num_RHS_pt_evals = (REAL)(Nxx[0]*Nxx[1]*Nxx[2]) * 4.0 * (REAL)n; // 4 RHS evals per gridpoint for RK4\n", " const REAL RHS_pt_evals_per_sec = num_RHS_pt_evals / ((REAL)time_in_ns / 1.0e9);\n", "\n", " // Step 3.d.ii: Output simulation progress to stderr\n", " if(n % 40 == 0) {\n", " fprintf(stderr,\"%c[2K\", 27); // Clear the line\n", " fprintf(stderr,\"It: %d t=%.2f dt=%.2e | %.1f%%; ETA %.0f s | t/h %.2f | gp/s %.2e\\r\", // \\r is carriage return, move cursor to the beginning of the line\n", " n, n * (double)dt, (double)dt, (double)(100.0 * (REAL)n / (REAL)N_final),\n", " (double)time_remaining_in_mins*60, (double)(dt * 3600.0 / s_per_iteration_avg), (double)RHS_pt_evals_per_sec);\n", " fflush(stderr); // Flush the stderr buffer\n", " } // End progress indicator if(n % 10 == 0)\n", " } // End main loop to progress forward in time.\n", " fprintf(stderr,\"\\n\"); // Clear the final line of output from progress indicator.\n", "\n", " // Step 4: Free all allocated memory\n", "#include \"rfm_files/rfm_struct__freemem.h\"\n", "#include \"boundary_conditions/bcstruct_freemem.h\"\n", "#include \"MoLtimestepping/RK_Free_Memory.h\"\n", " free(auxevol_gfs);\n", " for(int i=0;i<3;i++) free(xx[i]);\n", "\n", " return 0;\n", "}" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Now compiling, should take ~10 seconds...\n", "\n", "Compiling executable...\n", "(EXEC): Executing `gcc -std=gnu99 -Ofast -fopenmp -march=native -funroll-loops BSSN_Two_BHs_Collide_Ccodes_psi4/BrillLindquist_Playground.c -o BSSN_Two_BHs_Collide_Ccodes_psi4/output/BrillLindquist_Playground -lm`...\n", "(BENCH): Finished executing in 9.224141120910645 seconds.\n", "Finished compilation.\n", "(BENCH) Finished in 9.232537031173706 seconds.\n", "\n", "\n", "Now running. Should take ~30 minutes...\n", "\n", "(EXEC): Executing `taskset -c 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ./BrillLindquist_Playground 270 8 2`...\n", "\u001b[2KIt: 30600 t=224.92 dt=7.35e-03 | 100.0%; ETA 0 s | t/h 2704.49 | gp/s 1.77e+066\n", "(BENCH): Finished executing in 299.734411239624 seconds.\n", "(BENCH) Finished in 299.74692583084106 seconds.\n", "\n", "\n" ] } ], "source": [ "if EvolOption == \"low resolution\":\n", " Nr = 270\n", " Ntheta = 8\n", "elif EvolOption == \"high resolution\":\n", " Nr = 800\n", " Ntheta = 16\n", "else:\n", " print(\"Error: unknown EvolOption!\")\n", " sys.exit(1)\n", "\n", "import cmdline_helper as cmd\n", "\n", "print(\"Now compiling, should take ~10 seconds...\\n\")\n", "start = time.time()\n", "cmd.C_compile(os.path.join(Ccodesdir, \"BrillLindquist_Playground.c\"),\n", " os.path.join(outdir, \"BrillLindquist_Playground\"),\n", " compile_mode=\"optimized\")\n", "end = time.time()\n", "print(\"(BENCH) Finished in \"+str(end-start)+\" seconds.\\n\\n\")\n", "\n", "if Nr == 800:\n", " print(\"Now running. Should take ~8 hours...\\n\")\n", "if Nr == 270:\n", " print(\"Now running. Should take ~30 minutes...\\n\")\n", "\n", "# Change to output directory\n", "os.chdir(os.path.join(outdir))\n", "cmd.delete_existing_files(\"out*.txt\")\n", "cmd.delete_existing_files(\"out*.png\")\n", "cmd.Execute(\"BrillLindquist_Playground\", str(Nr)+\" \"+str(Ntheta)+\" 2\")\n", "# Change back to root directory\n", "os.chdir(os.path.join(\"..\", \"..\"))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 6: Comparison with black hole perturbation theory \\[Back to [top](#toc)\\]\n", "$$\\label{compare}$$\n", "\n", "According to black hole perturbation theory ([Berti et al](https://arxiv.org/abs/0905.2975)), the resultant black hole should ring down with dominant, spin-weight $s=-2$ spherical harmonic mode $(l=2,m=0)$ according to\n", "\n", "$$\n", "{}_{s=-2}\\text{Re}(\\psi_4)_{l=2,m=0} = A e^{−0.0890 t/M} \\cos(0.3737 t/M+ \\phi),\n", "$$\n", "\n", "where $M=1$ for these data, and $A$ and $\\phi$ are an arbitrary amplitude and phase, respectively. Here we will plot the resulting waveform at $r/M=33.13$, comparing to the expected frequency and amplitude falloff predicted by black hole perturbation theory.\n", "\n", "Notice that we find about 4.2 orders of magnitude agreement! If you are willing to invest more resources and wait much longer, you will find approximately 8.5 orders of magnitude agreement (*better* than Fig 6 of [Ruchlin et al](https://arxiv.org/pdf/1712.07658.pdf)) if you adjust the above code parameters such that\n", "\n", "1. Finite-differencing order is set to 10\n", "1. Nr = 800\n", "1. Ntheta = 16\n", "1. Outer boundary (`AMPL`) set to 300\n", "1. Final time (`t_final`) set to 275\n", "1. Set the initial positions of the BHs to `BH1_posn_z = -BH2_posn_z = 0.25`" ] }, { "cell_type": "code", "execution_count": 18,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7YMPPqBVq1b07l2zvuCVV17JwIEDKSwstIIkBEEQghERI4N33nmHtWvX8tJLLxEfH8+ll15Kp06d+OCDD9i9ezcAHTt2rNFuxIgRvPDCC9xzzz2cOHGCI0eOOBKj7t27A67FrgCJiYm1thkwYAAJCQn88MMPAMybN4/y8vJqmcPdeemllwCsAAhPLFiwgNtuu40JEybw4YcfihclCEKTI2IEVFZW8vjjjzN06FCuvvpqAEJDQ7n44otZtWqVJUaePKPIyEjuu+8+q0bRoUOHrBLmvjA9GTMLg6eQbndCQkLo378/8+bN4+DBg7z//vsAPstSXHrppXTs2NEaQnTnwQcf5LLLLuODDz5g9uzZpKen06FDB4qKimq1R2gczEJvZimF3i+6iuzZGfHu0RpZqc3t7scGM+6F6OqDeuyQ34lX60ND2i6IGAGudT5btmxh8uTJ1QIPevTowS+//MLOnTuJiYmhVSvv+Z/s3pATz6hPnz4AHD3qykvlK3jBTps2bdixYwfr1q2joKAAcAmOL66//nrAlWXCzsyZM3n22WcJCwvjgw8+YO/evdx///3s27ePs846y2taJKHxeeRCVy0jVybpWHKKKqpVAxVqknNzTLMsnSC4kHcO+Oc//8npp59ueUUm3bt3p7y8nNWrV3scorNj94aciJH7HJFTMTrzzDMBV6j5zz//XKtIwknPyZynAtccWUZGBgAffPABo0ePJiQkhOeff54//OEPHD161FoPJQSWxPgQssfGkFXgX0LRxmZKTlnASlp76jst0XcJ84buT2hYTnkx2rhxIzk5OUyaNImwsOrFrXr06AG4si/UJhb+ekZdunQhNfVk7kEnAQwAKSkpgGue59ixY9xwww21tunXrx9du3bll19+sbb997//5eDBgwwePNiK0jN55pln+NWvfsXKlSurRe4JgePAMZnHE1o2p7wYvfrqq4SHh3ssNW4GGRw6dKhWz8hfMVJKWWJ32mmn1RBCb5jDexs2bACoISTeSElJYcGCBZYgvfzyy4SGhvKnP/3J4/GzZs0C4LHHHnN0fqHxKNhZyYh3j5I9tn6lDUziMw/x1HflpGQdsf6292Vutw8LxmcesvZNySljbHYpTy0+zqRP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VWsdqrUer7X+ULsWur4GzATaGX8LgiBUo7KyslryUif4m+nBjpmCqFOnTtxzzz2O2w0bNgw4+SC2i5Mn7MUN7XNAR48eRWtNZGQk3333HZdffjl33XUXH3/8Md9//z233nor4Mqb54mcnBySkpKsuardu3dbwpOc7IrhevDBB63rdMcMroCT83RlZWXVysd37NiR8PBwK2df165dq3lGY8eO9XntDUmdFr0aw3SXKaWsesda6+UiRIIgeOP7778nJyeHrVu3Om5j94ycJEm1Yz50Dxw44LgqLcCIESMASEtLA6B79+4+j7/hhhusv3ft2mV5IWlpaVx11VWsX7+ekpISkpOTCQ0N5aqrriIqKorrr78e8Ox9/POf/2T+/PmMHDmS2NhYoqKi2LJliyV25513HrGxsXzyySfs3LkTgOeee46zzjrLOscZZ5xh/W1mzBg5cmQ1L9EuTABnnnkmixYtYu/evURGRjoqD99Q1CW0+1VcEXOzcA3TSSSbIAiO8SfU2S5GpsfiFLNMenR0tF+1inr06MHs2bMtj6M2MerQoQMzZsxg3LhxzJkzh6+//pqHHnqIO+64g3vvvdc67uyzz67WzpxT2rFjR7XtGzdu5Pe//z1XXnklt912G0opOnTowKuvvmrN67Rp04aLL764WruUlBRWrlzJtddeW+36wSUypaWlXHPNNXTs2JHIyEgiIiJqiNGkSZMoKSkhKyvL72wZ9cUvMVJKPQhka61DtNYJWutQYKaxXRAEoVaaIpoOTj6M7733Xr/SF8XExHDNNdfQrl072rdv7zW5qp1x48YxY8YMRo4cSceOHbntttv49NNPq3kqZ555ZrU2pih89NFHTJs2zdr+1FNPERkZyRlnnMGoUaMoLy+nQ4cOdOvWjdmzZwMuQR8+fHi185122mnAyXIdHTp0YNu2bWzfvh04OVQ3dOhQzj33XJKSkkhKSqp2jgsuuIAePXpw/Pjx4BYjYLN2y0enXXnoJGhBEASfmHMrdV1nVFcx8jan4ouFCxdy1llnWcNV/rT7+uuvycnJ4Z577iE0NNQaFnO/7pCQEHr27MmKFSuqJSotLCykb9++PPfcc5x77rlERETQuXNn4uLirKHKN954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swgjAO28OsMoMjdqzPP4SZQ6VSf/xGEoEXESGjRGGHUuS05GsxMBuueN04pld2Ia5oEoUGRdUZCi8Z4QAcka3cTUkOIDFqsAAstD/GMBEEQhIAjnpEgCIIQcESMBEEQhIAjYiQIgiAEHBEjQRAEIeCIGAmCIAgBR8RIEARBCDj/H4pOv+sAwZ6jAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" }, { "data": { "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%matplotlib inline\n", "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from matplotlib.pyplot import savefig\n", "\n", "from matplotlib import rc\n", "rc('text', usetex=True)\n", "\n", "\n", "if Nr == 270:\n", " extraction_radius = \"30.20\"\n", " Amplitude = 1.8e-2\n", " Phase = 2.8\n", "elif Nr == 800:\n", " extraction_radius = \"33.64\"\n", " Amplitude = 1.8e-2\n", " Phase = 2.8\n", "else:\n", " print(\"Error: output is not tuned for Nr = \"+str(Nr)+\" . Plotting disabled.\")\n", " exit(1)\n", "\n", "# Transposed for easier unpacking:\n", "t,psi4r,psi4i = np.loadtxt(os.path.join(outdir, \"outpsi4_l2_m+0-\"+str(Nr)+\"-r\"+extraction_radius+\".txt\")).T\n", "\n", "t_retarded = []\n", "log10abspsi4r = []\n", "bh_pert_thry = []\n", "for i in range(len(psi4r)):\n", " retarded_time = t[i]-float(extraction_radius)\n", " t_retarded.append(retarded_time)\n", " log10abspsi4r.append(np.log(float(extraction_radius)*np.abs(psi4r[i]))/np.log(10))\n", " bh_pert_thry.append(np.log(Amplitude*np.exp(-0.0890*retarded_time)*np.abs(np.cos(0.3737*retarded_time+Phase)))/np.log(10))\n", "\n", "# print(bh_pert_thry)\n", "\n", "fig, ax = plt.subplots()\n", "plt.title(\"Grav. Wave Agreement with BH perturbation theory\",fontsize=18)\n", "plt.xlabel(\"$(t - R_{ext})/M$\",fontsize=16)\n", "plt.ylabel('$\\log_{10}|\\psi_4|$',fontsize=16)\n", "\n", "ax.plot(t_retarded, log10abspsi4r, 'k-', label='SENR/NRPy+ simulation')\n", "ax.plot(t_retarded, bh_pert_thry, 'k--', label='BH perturbation theory')\n", "# ax.set_xlim([0,t_retarded[len(psi4r1)-1]])\n", "ax.set_xlim([0, 1.5*domain_size - float(extraction_radius)])\n", "ax.set_ylim([-13.5, -1.5])\n", "\n", "plt.xticks(size = 14)\n", "plt.yticks(size = 14)\n", "\n", "legend = ax.legend(loc='upper right', shadow=True, fontsize='x-large')\n", "legend.get_frame().set_facecolor('C1')\n", "\n", "plt.show()\n", "\n", "# Note that you'll need `dvipng` installed to generate the following file:\n", "savefig(os.path.join(outdir, \"BHperttheorycompare.png\"), dpi=150)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 7: Output this notebook to $\\LaTeX$-formatted PDF file \\[Back to [top](#toc)\\]\n", "$$\\label{latex_pdf_output}$$\n", "\n", "The following code cell converts this Jupyter notebook into a proper, clickable $\\LaTeX$-formatted PDF file. After the cell is successfully run, the generated PDF may be found in the root NRPy+ tutorial directory, with filename\n", "[Tutorial-Start_to_Finish-BSSNCurvilinear-Two_BHs_Collide-Psi4.pdf](Tutorial-Start_to_Finish-BSSNCurvilinear-Two_BHs_Collide-Psi4.pdf) (Note that clicking on this link may not work; you may need to open the PDF file through another means.)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Created Tutorial-Start_to_Finish-BSSNCurvilinear-Two_BHs_Collide-Psi4.tex,\n", " and compiled LaTeX file to PDF file Tutorial-Start_to_Finish-\n", " BSSNCurvilinear-Two_BHs_Collide-Psi4.pdf\n" ] } ], "source": [ "import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface\n", "cmd.output_Jupyter_notebook_to_LaTeXed_PDF(\"Tutorial-Start_to_Finish-BSSNCurvilinear-Two_BHs_Collide-Psi4\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.0rc2" } }, "nbformat": 4, "nbformat_minor": 2 }