Skip to content

Commit

Permalink
more abstracts.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyndalestutz committed Jun 13, 2023
1 parent 475d6d1 commit 41d9ff7
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 76 deletions.
2 changes: 1 addition & 1 deletion NRPyPlus_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
6 changes: 4 additions & 2 deletions Tutorial-Finite_Difference_Derivatives-FDtable_soln.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"\n",
"# Creating the Finite-Difference Table for Centered First and Second Derivatives, from 2nd through 10th-Order Accuracy\n",
"\n",
"<!-- abstract? -->\n",
"\n",
"## *Courtesy Brandon Clark*"
]
},
Expand Down Expand Up @@ -117,7 +119,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -131,7 +133,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
7 changes: 5 additions & 2 deletions Tutorial-Finite_Difference_Derivatives.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"## Author: Zach Etienne\n",
"### Formatting improvements courtesy Brandon Clark\n",
"\n",
"## This tutorial examines numerical derivatives via finite difference methods using the NRPy+ module. It outlines FD techniques, which involve creating an Nth-degree polynomial for a function on a uniform grid and approximating its derivatives. Key functions, `compute_fdcoeffs_fdstencl()` and `FD_outputC()`, which determine finite difference coefficients and generate respective C code, are detailed.\n",
"<br>\n",
"\n",
"### NRPy+ Source Code for this module: [finite_difference.py](../edit/finite_difference.py)\n"
]
},
Expand Down Expand Up @@ -313,7 +316,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2021-03-07T17:10:58.642904Z",
Expand Down Expand Up @@ -354,7 +357,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
6 changes: 4 additions & 2 deletions Tutorial-FishboneMoncriefID.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"## Author: Zach Etienne\n",
"### Formatting improvements courtesy Brandon Clark\n",
"\n",
"## This notebook outlines the implementation of Fishbone-Moncrief initial data for GRMHD simulations in the Einstein Toolkit (ETK) using the NRPy+ module. It transforms the spherical coordinate data into Cartesian coordinates, and constructs key physics quantities like four-velocity, Kerr-Schild metric, magnetic field, and Lorentz factor. Finally, the module outputs these calculations to C code.\n",
"<br>\n",
"\n",
"**Notebook Status:** <font color='green'><b> Validated </b></font>\n",
"\n",
Expand Down Expand Up @@ -1329,7 +1331,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1343,7 +1345,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
5 changes: 3 additions & 2 deletions Tutorial-GRFFE_Equations-Cartesian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"\n",
"## Authors: Patrick Nelson, Zach Etienne, and Leo Werneck\n",
"\n",
"## This notebook documents and constructs a number of quantities useful for building symbolic (SymPy) expressions for the equations of general relativistic force-free electrodynamics (GRFFE), using the same (Valencia) formalism as `IllinoisGRMHD`\n",
"## This notebook documents and constructs a number of quantities useful for building symbolic (SymPy) expressions for the equations of general relativistic force-free electrodynamics (GRFFE), using the same (Valencia) formalism as `IllinoisGRMHD`. The formulation further incorporates the computation of flux and source terms for the induction equation, with detailed code validation against the existing GRFFE equations NRPy+ module.\n",
"<br>\n",
"\n",
"**Notebook Status:** <font color='orange'><b> Self-Validated </b></font>\n",
"\n",
Expand Down Expand Up @@ -928,7 +929,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
9 changes: 6 additions & 3 deletions Tutorial-GRHD_Equations-Cartesian-c-code.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
" gtag('config', 'UA-59152712-8');\n",
"</script>\n",
"\n",
"# C code generation of GR HD Equations\n",
"# C code generation of GRHD Equations\n",
"\n",
"## Authors: Phil Chang & Zach Etienne\n",
"### Formatting improvements courtesy Brandon Clark\n",
"\n",
"## This notebook demonstrates the C code generation of General Relativistic HydroDynamics (GRHD) equations in conservative form using a specific state vector ${\\boldsymbol{\\mathcal{U}}}=(\\rho_*,\\tilde{S},\\tilde{\\tau})$. The process of transitioning between primitive and conservative variables, computing flux and source terms, as well as performing Lorentz boosts and other transformations are detailed.\n",
"<br>\n",
"<!-- omit white space somehow -->\n",
"$\\newcommand{\\be}{\\begin{equation}}$\n",
"$\\newcommand{\\ee}{\\end{equation}}$\n",
"$\\newcommand{\\grad}{{\\boldsymbol{\\nabla}}}$\n",
Expand Down Expand Up @@ -972,7 +975,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -986,7 +989,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.7.7"
},
"nteract": {
"version": "nteract-on-jupyter@1.9.7"
Expand Down
5 changes: 3 additions & 2 deletions Tutorial-GRHD_Equations-Cartesian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"\n",
"## Authors: Zach Etienne & Patrick Nelson\n",
"\n",
"## This notebook documents and constructs a number of quantities useful for building symbolic (SymPy) expressions for the equations of general relativistic hydrodynamics (GRHD), using the same (Valencia) formalism as `IllinoisGRMHD`\n",
"## This notebook documents and constructs a number of quantities useful for building symbolic (SymPy) expressions for the equations of general relativistic hydrodynamics (GRHD), using the same (Valencia) formalism as `IllinoisGRMHD`.\n",
"<br>\n",
"\n",
"**Notebook Status:** <font color='orange'><b> Self-Validated </b></font>\n",
"\n",
Expand Down Expand Up @@ -1038,7 +1039,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
100 changes: 90 additions & 10 deletions Tutorial-GRHD_UnitConversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
"\n",
"## GRHD Units in terms of EOS \n",
"\n",
"$\\newcommand{\\rhoCode}{{\\tilde{\\rho}}}$\n",
"## This notebook introduces an equation of state for general relativistic hydrodynamics (GRHD) and demonstrates the conversion of dimensional quantities to dimensionless units.\n",
"<!-- fact check this ^ -->\n",
"<br>\n",
"\n",
"**Notebook Status:** <font color='red'><b> Not Validated </b></font>\n",
"\n",
"\n",
"## Introduction\n",
"$\\newcommand{\\rhoCode}{{\\tilde{\\rho}}}$\n",
"$\\newcommand{\\MCode}{{\\tilde{M}}}$ $\\newcommand{\\rCode}{{\\tilde{r}}}$ $\\newcommand{\\PCode}{{\\tilde{P}}}$$\\newcommand{\\tCode}{{\\tilde{t}}}$$\\newcommand{\\Mfid}{{M_{\\rm fid}}}$$\\newcommand{\\MfidBar}{\\bar{M}_{\\rm fid}}$$\\newcommand{\\Mbar}{\\bar{M}}$\n",
"$\\newcommand{\\rBar}{\\bar{r}}$$\\newcommand{\\tBar}{\\bar{t}}$\n",
"In GRHD, we can set an equation of state of the form\n",
Expand Down Expand Up @@ -79,7 +86,30 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Zach's comments:\n",
"<a id='toc'></a>\n",
"\n",
"# Table of Contents\n",
"$$\\label{toc}$$\n",
"\n",
"The module is organized as follows:\n",
"\n",
"1. [Step 1](#comments): Zach's comments\n",
"1. [Step 2](#tov_solver): TOV solver as illustration\n",
" 1. [Step 2.a](#prescription): Another dimensionless prescription\n",
" 1. [Step 2.b](#metric): Metric for TOV equation\n",
"1. [Step 3](#adm_conversion): Convert metric to be in terms of ADM quantities\n",
"1. [Step 4](#cartesian_conversion): Convert to Cartesian coordinates\n",
"1. [Step 5](#latex_pdf_output): Output this notebook to $\\LaTeX$-formatted PDF file"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a id='comments'></a>\n",
"\n",
"# Step 1: Zach's comments \\[Back to [top](#toc)\\]\n",
"$$\\label{comments}$$\n",
"\n",
"Sound speed $c_s$ is defined as\n",
"\n",
Expand Down Expand Up @@ -114,7 +144,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# TOV Solver as illustration\n",
"<a id='tov_solver'></a>\n",
"\n",
"# Step 2: TOV Solver as illustration \\[Back to [top](#toc)\\]\n",
"$$\\label{tov_solver}$$\n",
"\n",
"The TOV equations are \n",
"\\begin{eqnarray}\n",
"\\frac{dP}{dr} &=& -\\mu\\frac{GM}{r^2}\\left(1 + \\frac P {\\mu c^2}\\right)\\left(1 + \\frac {4\\pi r^3 P}{Mc^2}\\right)\\left(1 - \\frac {2GM}{rc^2}\\right)^{-1}\\\\\n",
Expand Down Expand Up @@ -145,7 +179,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Another dimensionless prescription\n",
"<a id='prescription'></a>\n",
"\n",
"## Step 2.a: Another dimensionless prescription \\[Back to [top](#toc)\\]\n",
"$$\\label{prescription}$$\n",
"\n",
"Let consider an alternative formulation where rather than setting $K=1$, we set the characteristic mass $\\Mfid = M_0$. In this case,\n",
"\\begin{eqnarray}\n",
Expand All @@ -169,7 +206,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## metric for TOV equation\n",
"<a id='metric'></a>\n",
"\n",
"## Step 2.b: Metric for TOV equation \\[Back to [top](#toc)\\]\n",
"$$\\label{metric}$$\n",
"\n",
"The metric for the TOV equation (taken) from wikipedia is\n",
"\\begin{equation}\n",
Expand All @@ -194,7 +234,9 @@
"and BC:\n",
"\\begin{equation}\n",
"\\exp(\\nu) = \\left(1-\\frac {2\\MCode}{\\rCode}\\right)\n",
"\\end{equation}"
"\\end{equation}\n",
"\n",
"<!-- should the following code block be explained under its own heading? -->"
]
},
{
Expand Down Expand Up @@ -408,7 +450,10 @@
"collapsed": true
},
"source": [
"## Convert metric to be in terms of ADM quantities\n",
"<a id='adm_conversion'></a>\n",
"\n",
"# Step 3: Convert metric to be in terms of ADM quantities \\[Back to [top](#toc)\\]\n",
"$$\\label{adm_conversion}$$\n",
"\n",
"Above, the line element was written:\n",
"$$\n",
Expand Down Expand Up @@ -439,7 +484,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Convert to Cartesian coordinates\n",
"<a id='cartesian_conversion'></a>\n",
"\n",
"# Step 4: Convert to Cartesian coordinates \\[Back to [top](#toc)\\]\n",
"$$\\label{cartesian_conversion}$$\n",
"\n",
"The above metric is given in spherical coordinates and we need everything in Cartesian coordinates. Given this the \n",
"transformation to Cartesian coordinates is \n",
Expand Down Expand Up @@ -523,11 +571,43 @@
"outputC([gammaDD[0][0], gammaDD[0][1], gammaDD[0][2], gammaDD[1][1], gammaDD[1][2], gammaDD[2][2]],\n",
" [\"mi.gamDDxx\", \"mi.gamDDxy\", \"mi.gamDDxz\", \"mi.gamDDyy\", \"mi.gamDDyz\",\"mi.gamDDzz\"], filename=\"NRPY+spherical_to_Cartesian_metric.h\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<a id='latex_pdf_output'></a>\n",
"\n",
"# Step 5: 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-GRHD_UnitConversion.pdf](Tutorial-GRHD_UnitConversion.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": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Created Tutorial-GRHD_UnitConversion.tex, and compiled LaTeX file to PDF\n",
" file Tutorial-GRHD_UnitConversion.pdf\n"
]
}
],
"source": [
"import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface\n",
"cmd.output_Jupyter_notebook_to_LaTeXed_PDF(\"Tutorial-GRHD_UnitConversion\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -541,7 +621,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
5 changes: 3 additions & 2 deletions Tutorial-GRMHD_Equations-Cartesian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"\n",
"## Author: Zach Etienne\n",
"\n",
"## This notebook documents and constructs a number of quantities useful for building symbolic (SymPy) expressions for the equations of general relativistic magnetohydrodynamics (GRMHD), using the same (Valencia-like) formalism as `IllinoisGRMHD`\n",
"## This notebook documents and constructs a number of quantities useful for building symbolic (SymPy) expressions for the equations of general relativistic magnetohydrodynamics (GRMHD), using the same (Valencia-like) formalism as `IllinoisGRMHD`.\n",
"<br>\n",
"\n",
"**Notebook Status:** <font color='orange'><b> Self-Validated; induction equation not yet implemented </b></font>\n",
"\n",
Expand Down Expand Up @@ -459,7 +460,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 41d9ff7

Please sign in to comment.