Skip to content

Commit

Permalink
Major NRPy+ update: Fix notebooks that adopted/documented old ADM spa…
Browse files Browse the repository at this point in the history
…cetime initial data interface.
  • Loading branch information
zachetienne committed Dec 28, 2022
1 parent 07dd7c6 commit e9ad4fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Tutorial-ADM_Initial_Data_Reader__BSSN_Converter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@
"* [`BSSN.StaticTrumpet`](BSSN/StaticTrumpet.py) for static trumpet nonspinning black hole initial data\n",
"* [`BSSN.BrillLindquist`](BSSN/BrillLindquist.py) for initial data of two nonspinning black holes at rest\n",
"\n",
"Any of these initial data set functions can be called with the function argument `ComputeADMGlobalsOnly=True`, and the ADM quantities will be exported as global variables. For example\n",
"When any of these initial data set functions is called, it will export the ADM quantities as global variables. For example\n",
"\n",
"```python\n",
"import BSSN.UIUCBlackHole as UIB\n",
"UIB.UIUCBlackHole(ComputeADMGlobalsOnly=True)\n",
"UIB.UIUCBlackHole()\n",
"pickled_NRPy_env = \\\n",
" add_to_Cfunction_dict_exact_ADM_ID_function(\"UIUCBlackHole\", \"Spherical\", UIB.alphaSph, UIB.betaSphU,\n",
" UIB.BSphU, UIB.betaSphU, UIB.gammaSphDD, UIB.KSphDD)\n",
Expand Down
38 changes: 19 additions & 19 deletions Tutorial-BSSN_in_terms_of_ADM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@
"outputs": [],
"source": [
"# Step 1: Import needed core NRPy+ modules\n",
"import sympy as sp # SymPy: The Python computer algebra package upon which NRPy+ depends\n",
"import NRPy_param_funcs as par # NRPy+: Parameter interface\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 sys # Standard Python modules for multiplatform OS-level functions\n",
"import BSSN.BSSN_quantities as Bq # NRPy+: This module depends on the parameter EvolvedConformalFactor_cf,\n",
" # which is defined in BSSN.BSSN_quantities\n",
"import sympy as sp # SymPy: The Python computer algebra package upon which NRPy+ depends\n",
"import NRPy_param_funcs as par # NRPy+: Parameter interface\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 sys # Standard Python modules for multiplatform OS-level functions\n",
"import BSSN.BSSN_quantities as Bq # NRPy+: This module depends on the parameter EvolvedConformalFactor_cf,\n",
" # which is defined in BSSN.BSSN_quantities\n",
"\n",
"# Step 1.a: Set DIM=3, as we're using a 3+1 decomposition of Einstein's equations\n",
"DIM=3"
Expand Down Expand Up @@ -488,22 +488,22 @@
"\n",
"# Step 3.b: Set up initial data; assume UIUC spinning black hole initial data\n",
"import BSSN.UIUCBlackHole as uibh\n",
"uibh.UIUCBlackHole(ComputeADMGlobalsOnly=True)\n",
"uibh.UIUCBlackHole()\n",
"\n",
"# Step 3.c: Call above functions to convert ADM to BSSN curvilinear\n",
"gammabarDD_hDD( uibh.gammaSphDD)\n",
"trK_AbarDD_aDD( uibh.gammaSphDD,uibh.KSphDD)\n",
"LambdabarU_lambdaU__exact_gammaDD(uibh.gammaSphDD)\n",
"cf_from_gammaDD( uibh.gammaSphDD)\n",
"betU_vetU( uibh.betaSphU,uibh.BSphU)\n",
"gammabarDD_hDD( uibh.gammaDD)\n",
"trK_AbarDD_aDD( uibh.gammaDD,uibh.KDD)\n",
"LambdabarU_lambdaU__exact_gammaDD(uibh.gammaDD)\n",
"cf_from_gammaDD( uibh.gammaDD)\n",
"betU_vetU( uibh.betaU,uibh.BU)\n",
"\n",
"# Step 3.d: Now load the BSSN_in_terms_of_ADM module and perform the same conversion\n",
"import BSSN.BSSN_in_terms_of_ADM as BitoA\n",
"BitoA.gammabarDD_hDD( uibh.gammaSphDD)\n",
"BitoA.trK_AbarDD_aDD( uibh.gammaSphDD,uibh.KSphDD)\n",
"BitoA.LambdabarU_lambdaU__exact_gammaDD(uibh.gammaSphDD)\n",
"BitoA.cf_from_gammaDD( uibh.gammaSphDD)\n",
"BitoA.betU_vetU( uibh.betaSphU,uibh.BSphU)\n",
"BitoA.gammabarDD_hDD( uibh.gammaDD)\n",
"BitoA.trK_AbarDD_aDD( uibh.gammaDD,uibh.KDD)\n",
"BitoA.LambdabarU_lambdaU__exact_gammaDD(uibh.gammaDD)\n",
"BitoA.cf_from_gammaDD( uibh.gammaDD)\n",
"BitoA.betU_vetU( uibh.betaU,uibh.BU)\n",
"\n",
"# Step 3.e: Perform the consistency check\n",
"print(\"Consistency check between this tutorial notebook and BSSN.BSSN_in_terms_of_ADM NRPy+ module: ALL SHOULD BE ZERO.\")\n",
Expand Down Expand Up @@ -579,7 +579,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.11.1"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions Tutorial-UnitTesting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"\n",
" module_name = 'bl'\n",
"\n",
" function_and_global_dict = {'BrillLindquist(ComputeADMGlobalsOnly = True)': \n",
" function_and_global_dict = {'BrillLindquist()': \n",
" ['alphaCart', 'betaCartU', 'BCartU', 'gammaCartDD', 'KCartDD']}\n",
" \n",
" create_test(module, module_name, function_and_global_dict)\n",
Expand Down Expand Up @@ -527,7 +527,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.11.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit e9ad4fa

Please sign in to comment.