diff --git a/benchmarks/benchmark7.ipynb b/benchmarks/benchmark7.ipynb index 56be1dc2a..a88db049b 100644 --- a/benchmarks/benchmark7.ipynb +++ b/benchmarks/benchmark7.ipynb @@ -10,7 +10,7 @@ "application/javascript": [ " MathJax.Hub.Config({\n", " TeX: { equationNumbers: { autoNumber: \"AMS\" } }\n", - " });" + " });\n" ], "text/plain": [ "" @@ -123,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -135,7 +135,7 @@ "" ] }, - "execution_count": 1, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -212,7 +212,7 @@ "\n", "where $A_1$, $B_1$, $A_2$, $B_2$, and $C_2$ are constant parameters. \n", "\n", - "This manufactured solution is an equilbrium solution of the governing equation, when $S(x,y,t)=0$ and $\\alpha(x,t)$ is constant. The closeness of this manufactured solution to a solution of the nominal governing equation increases the likihood that the behavior of simulation codes when solving this benchmark problem is representive of the solution of the regular Allen-Cahn equation (i.e. without the source term). The form of $\\alpha(x,t)$ was chosen to yield complex behavior while still retaining a (somewhat) simple functional form. The two spatial sinusoidal terms introduce two controllable length scales to the interfacial shape. Summing them gives a \"beat\" pattern with a period longer than the period of either individual term, permitting a domain size that is larger than the wavelength of the sinusoids without a repeating pattern. The temporal sinusoidal term introduces a controllable time scale to the interfacial shape in addition to the phase transformation time scale, while the linear temporal dependence of the other term ensures that the sinusoidal term can go through multiple periods without $\\eta_{sol}$ repeating itself.\n", + "This manufactured solution is an equilbrium solution of the governing equation, when $S(x,y,t)=0$ and $\\alpha(x,t)$ is constant. The closeness of this manufactured solution to a solution of the nominal governing equation increases the likihood that the behavior of simulation codes when solving this benchmark problem is representive of the solution of the regular Allen-Cahn equation (i.e. without the source term). The form of $\\alpha(x,t)$ was chosen to yield complex behavior while still retaining a (somewhat) simple functional form. The two spatial sinusoidal terms introduce two controllable length scales to the interfacial shape. Summing them gives a \"beat\" pattern with a period longer than the period of either individual term, permitting a domain size that is larger than the wavelength of the sinusoids without a repeating pattern. The temporal sinusoidal term introduces a controllable time scale to the interfacial shape in addition to the phase transformation time scale, while the linear temporal dependence of the other term ensures that the sinusoidal term can go through multiple periods without $\\eta_{\\mathrm{sol}}$ repeating itself.\n", "\n", "Inserting the manufactured solution into the governing equation and solving for $S(x,y,t)$ yields:\n", "\n", @@ -234,7 +234,7 @@ "\\frac{\\partial \\alpha(x,t)}{\\partial t} = A_1 \\sin\\left(B_1 x\\right) + A_2 C_2 \\cos \\left(B_2 x + C_2 t \\right)\n", "\\end{equation}$$\n", "\n", - "** *N.B.*: Don't transcribe these equations. Please download the appropriate files from the [Appendix](#Appendix) **." + "> *N.B.*: Don't transcribe these equations. Please download the appropriate files from the [Appendix](#Appendix)." ] }, { @@ -242,15 +242,15 @@ "metadata": {}, "source": [ "# Domain geometry, boundary conditions, initial conditions, and stopping condition\n", - "The domain geometry is a rectangle that spans [0, 1] in $x$ and [0, 0.5] in $y$. This elongated domain was chosen to allow multiple peaks and valleys in $\\eta_{sol}$ without stretching the interface too much in the $y$ direction (which causes the thickness of the interface to change) or having large regions where $\\eta_{sol}$ never deviates from 0 or 1. Periodic boundary conditions are applied along the $x = 0$ and the $x = 1$ boundaries to accomodate the periodicity of $\\alpha(x,t)$. Dirichlet boundary conditions of $\\eta$ = 1 and $\\eta$ = 0 are applied along the $y = 0$ and the $y = 0.5$ boundaries, respectively. These boundary conditions are chosen to be consistent with $\\eta_{sol}(x,y,t)$. The initial condition is the manufactured solution at $t = 0$:\n", + "The domain geometry is a rectangle that spans [0, 1] in $x$ and [0, 0.5] in $y$. This elongated domain was chosen to allow multiple peaks and valleys in $\\eta_{\\mathrm{sol}}$ without stretching the interface too much in the $y$ direction (which causes the thickness of the interface to change) or having large regions where $\\eta_{\\mathrm{sol}}$ never deviates from 0 or 1. Periodic boundary conditions are applied along the $x = 0$ and the $x = 1$ boundaries to accomodate the periodicity of $\\alpha(x,t)$. Dirichlet boundary conditions of $\\eta$ = 1 and $\\eta$ = 0 are applied along the $y = 0$ and the $y = 0.5$ boundaries, respectively. These boundary conditions are chosen to be consistent with $\\eta_{\\mathrm{sol}}(x,y,t)$. The initial condition is the manufactured solution at $t = 0$:\n", "\n", "$$\n", "\\begin{equation}\n", - "\\eta_{sol}(x,y,0) = \\frac{1}{2}\\left[ 1 - \\tanh\\left( \\frac{y-\\left(\\frac{1}{4}+A_2 \\sin(B_2 x) \\right)}{\\sqrt{2 \\kappa}} \\right) \\right] \n", + "\\eta_{\\mathrm{sol}}(x,y,0) = \\frac{1}{2}\\left[ 1 - \\tanh\\left( \\frac{y-\\left(\\frac{1}{4}+A_2 \\sin(B_2 x) \\right)}{\\sqrt{2 \\kappa}} \\right) \\right] \n", "\\end{equation}\n", "$$\n", "\n", - "The stopping condition for all calculations is when t = 8 time units, which was chosen to let $\\alpha(x,t)$ evolve substantially, while still being slower than the characteristic time for the phase evolution (determined by the CFL condition for a uniform mesh with a reasonable level of resolution of $\\eta_{sol}$)." + "The stopping condition for all calculations is when t = 8 time units, which was chosen to let $\\alpha(x,t)$ evolve substantially, while still being slower than the characteristic time for the phase evolution (determined by the CFL condition for a uniform mesh with a reasonable level of resolution of $\\eta_{\\mathrm{sol}}$)." ] }, { @@ -283,15 +283,16 @@ "metadata": {}, "source": [ "## Part (a)\n", + "\n", "The objective of this test is to verify the accuracy of your simulation code in both time and space. Here, we make use of convergence tests, where either the mesh size (or grid point spacing) or the time step size is systematically changed to determine the response of the error to these quantities. Once a convergence test is completed the order of accuracy can be calculated from the result. The order of accuracy can be compared to the theoretical order of accuracy for the numerical method employed in the simulation. If the two match (to a reasonable degree), then one can be confident that the simulation code is working as expected. The remainder of this subsection will give instructions for convergence tests for this MMS problem.\n", "\n", "Implement the MMS problem specified above using the simulation code of your choice. Perform a spatial convergence test by running the simulation for a variety of mesh sizes. For each simulation, determine the discrete $L_2$ norm of the error at $t=8$:\n", "\n", "$$\\begin{equation}\n", - " L_2 = \\sqrt{\\sum\\limits_{x,y}\\left(\\eta^{t=8}_{x,y} - \\eta_{sol}(x,y,8)\\right)^2 \\Delta x \\Delta y}\n", + " L_2 = \\sqrt{\\sum\\limits_{x,y}\\left(\\eta^{t=8}_{x,y} - \\eta_{\\mathrm{sol}}(x,y,8)\\right)^2 \\Delta x \\Delta y}\n", "\\end{equation}$$\n", "\n", - "For all of these simulations, verify that the time step is small enough that any temporal error is much smaller that the total error. This can be accomplished by decreasing the time step until it has minimal effect on the error. Ensure that at least three simulation results have $L_2$ errors in the range $[5\\times10^{-3}, 1\\times10^{-4}]$, attempting to cover as much of that range as possible/practical. This maximum and minimum errors in the range roughly represent a poorly resolved simulation and a very well-resolved simulation.\n", + "For all of these simulations, verify that the time step is small enough that any temporal error is much smaller that the total error. This can be accomplished by decreasing the time step until it has minimal effect on the error. Ensure that at least three simulation results have $L_2$ errors in the range $[1 \\times 10^{-4}, 5 \\times 10^{-3}]$, attempting to cover as much of that range as possible/practical. This maximum and minimum errors in the range roughly represent a poorly resolved simulation and a very well-resolved simulation.\n", "\n", "Save the effective element size, $h$, and the $L_2$ error for each simulation.\n", "[Archive this data](https://github.com/usnistgov/pfhub/issues/491) in a\n", @@ -300,7 +301,7 @@ "the finest part of the mesh for nonuniform meshes. For irregular meshes\n", "with continuous distributions of element sizes, approximate the effective\n", "element size as the average of the square root of the area of the smallest\n", - "5% of the elements. Then [submit your results on the PFHub website](https://pages.nist.gov/pfhub/simulations/upload_form/) as a 2D data set with the effective mesh size as the x-axis column and the $L_2$ error as the y-axis column.\n", + "5% of the elements. Then [submit your results on the PFHub website](https://pages.nist.gov/pfhub/simulations/upload_form/) as a 2D data set with the effective mesh size as the $x$-axis column and the $L_2$ error as the $y$-axis column.\n", "\n", "Next, confirm that the observed order of accuracy is approximately equal to the expected value. Calculate the order of accuracy, $p$, with a least squares fit of the following function:\n", "\n", @@ -308,9 +309,9 @@ " \\log(E)=p \\log(R) + b\n", "\\end{equation}$$\n", "\n", - "where $E$ is the $L_2$ error, $R$ is the effective element size, and b is an intercept. Deviations of ±0.2 or more from the theoretical value are to be expected (depending on the range of errors considered and other factors).\n", + "where $E$ is the $L_2$ error, $R$ is the effective element size, and b is an intercept. Deviations of $\\pm 0.2$ or more from the theoretical value are to be expected (depending on the range of errors considered and other factors).\n", "\n", - "Finally, perform a similar convergence test, but for the time step, systematically changing the time step and recording the $L_2$ error. Use a time step that does not vary over the course of any single simulation. Verify that the spatial discretization error is small enough that it does not substantially contribute to the total error. Once again, ensure that at least three simulations have $L_2$ errors in the range $[5\\times10^{-3}, 1\\times10^{-4}]$, attempting to cover as much of that range as possible/practical. [Archive the effective mesh size and $L_2$ error](https://github.com/usnistgov/pfhub/issues/491) for each individual simulation in a CSV or JSON file. [Submit your results to the PFHub website](https://pages.nist.gov/pfhub/simulations/upload_form/) as a 2D data set with the time step size as the x-axis column and the $L_2$ error as the y-axis column. Confirm that the observed order of accuracy is approximately equal to the expected value." + "Finally, perform a similar convergence test, but for the time step, systematically changing the time step and recording the $L_2$ error. Use a time step that does not vary over the course of any single simulation. Verify that the spatial discretization error is small enough that it does not substantially contribute to the total error. Once again, ensure that at least three simulations have $L_2$ errors in the range $[1\\times10^{-4}, 5\\times10^{-3}]$, attempting to cover as much of that range as possible/practical. [Archive the effective mesh size and $L_2$ error](https://github.com/usnistgov/pfhub/issues/491) for each individual simulation in a CSV or JSON file. [Submit your results to the PFHub website](https://pages.nist.gov/pfhub/simulations/upload_form/) as a 2D data set with the time step size as the $x$-axis column and the $L_2$ error as the $y$-axis column. Confirm that the observed order of accuracy is approximately equal to the expected value." ] }, { @@ -318,10 +319,10 @@ "metadata": {}, "source": [ "## Part (b)\n", - "Now that your code has been verified in (a), the objective of this part is to determine the computational performance of your code at various levels of error. These results can then be used to objectively compare the performance between codes or settings within the same code. To make the problem more computationally demanding and stress solvers more than in (a), decrease $\\kappa$ by a factor of $256$ to $1.5625\\times10^{-6}$. This change will reduce the interfacial thickness by a factor of $16$.\n", + "Now that your code has been verified in (a), the objective of this part is to determine the computational performance of your code at various levels of error. These results can then be used to objectively compare the performance between codes or settings within the same code. To make the problem more computationally demanding and stress solvers more than in (a), decrease $\\kappa$ by a factor of $256$ to $1.5625 \\times 10^{-6}$. This change will reduce the interfacial thickness by a factor of $16$.\n", "\n", - "Run a series of simulations, attempting to optimize solver parameters (mesh, time step, tolerances, etc.) to minimize the required computational resources for at least three levels of $L_2$ error in range $[5\\times10^{-3}, 1\\times10^{-5}]$. Use the same CPU and processor type for all simulations. For the best of these simulations, save the wall time (in seconds), number of computing cores, normalized computing cost (wall time in seconds $\\times$ number of cores $\\times$ nominal core speed $/$ 2 GHz), maximum memory usage, and $L_2$ error at $t=8$ for each individual simulation. [Archive this data](https://github.com/usnistgov/pfhub/issues/491) in a\n", - "CSV or JSON file with one column (or key) for each of the quantities mentioned above. [Submit your results to the PFHub website](https://pages.nist.gov/pfhub/simulations/upload_form/) as two 2D data sets. For the first data set use the $L_2$ error as the x-axis column and the normalized computational cost as the y-axis column. For the second data set, use the $L_2$ error as the x-axis column and the wall time as the y-axis column." + "Run a series of simulations, attempting to optimize solver parameters (mesh, time step, tolerances, etc.) to minimize the required computational resources for at least three levels of $L_2$ error in range $[1 \\times 10^{-5}, 5 \\times 10^{-3}]$. Use the same CPU and processor type for all simulations. For the best of these simulations, save the wall time (in seconds), number of computing cores, normalized computing cost (wall time in seconds $\\times$ number of cores $\\times$ nominal core speed $/$ 2 GHz), maximum memory usage, and $L_2$ error at $t=8$ for each individual simulation. [Archive this data](https://github.com/usnistgov/pfhub/issues/491) in a\n", + "CSV or JSON file with one column (or key) for each of the quantities mentioned above. [Submit your results to the PFHub website](https://pages.nist.gov/pfhub/simulations/upload_form/) as two 2D data sets. For the first data set use the $L_2$ error as the $x$-axis column and the normalized computational cost as the $y$-axis column. For the second data set, use the $L_2$ error as the $x$-axis column and the wall time as the $y$-axis column." ] }, { @@ -342,7 +343,7 @@ "\n", "## Part (a) Guidelines\n", "\n", - "Two data items are required in the \"Data Files\" section of the [upload form]. The data items should be labeled as `spatial` and `temporal` in the `Short name of data` box. The 2D radio button should be checked and the columns corresponding to the x-axis (either $\\Delta t$ or $\\Delta x$) and the y-axis ($e_{L2}$) should be labeled correctly for each CSV file. The CSV file for the spatial data should have the form\n", + "Two data items are required in the \"Data Files\" section of the [upload form]. The data items should be labeled as `spatial` and `temporal` in the `Short name of data` box. The 2D radio button should be checked and the columns corresponding to the $x$-axis (either $\\Delta t$ or $\\Delta x$) and the $y$-axis ($e_{L2}$) should be labeled correctly for each CSV file. The CSV file for the spatial data should have the form\n", "\n", "```\n", "mesh_size,L2_error\n", @@ -364,7 +365,7 @@ "\n", "## Parts (b) and (c) Guidelines\n", "\n", - "Two data items are required in the \"Data Files\" section of the [upload form]. The data items should be labeled as `cost` and `time` in the `Short name of data` box. The 2D radio button should be checked and the columns corresponding to the x-axis ($e_{L2}$) and the y-axis (either $F_{\\text{cost}}$ or $t_{\\text{wall}}$) should be labeled correctly for each CSV file. The CSV file for the cost data should have the form\n", + "Two data items are required in the \"Data Files\" section of the [upload form]. The data items should be labeled as `cost` and `time` in the `Short name of data` box. The 2D radio button should be checked and the columns corresponding to the $x$-axis ($e_{L2}$) and the $y$-axis (either $F_{\\text{cost}}$ or $t_{\\text{wall}}$) should be labeled correctly for each CSV file. The CSV file for the cost data should have the form\n", "\n", "```\n", "cores,wall_time,memory,error,cost\n", @@ -396,14 +397,12 @@ }, { "cell_type": "markdown", - "metadata": { - "collapsed": true - }, + "metadata": {}, "source": [ "# Appendix\n", "\n", "## Computer algebra systems\n", - "Rigorous verification of software frameworks using MMS requires posing the equation and manufacturing the solution with as much complexity as possible. This can be straight-forward, but interesting equations produce complicated source terms. To streamline the MMS workflow, it is strongly recommended that you use a CAS such as SymPy, Maple, or Mathematica to generate source equations and turn it into executable code automatically. For accessibility, we will use [SymPy](http://www.sympy.org/), but so long as vector calculus is supported, CAS will do." + "Rigorous verification of software frameworks using MMS requires posing the equation and manufacturing the solution with as much complexity as possible. This can be straight-forward, but interesting equations produce complicated source terms. To streamline the MMS workflow, it is strongly recommended that you use a CAS such as SymPy, Maple, or Mathematica to generate source equations and turn it into executable code automatically. For accessibility, we will use [SymPy](http://www.sympy.org/), but so long as vector calculus is supported, any CAS will do." ] }, { @@ -417,88 +416,332 @@ "cell_type": "code", "execution_count": 5, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "alpha = A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) + 0.25 \n", - "\n", - "eta = -0.5*tanh(sqrt(2)*(-A1*t*sin(B1*x) - A2*sin(B2*x + C2*t) + y - 0.25)/(2*sqrt(kappa))) + 0.5 \n", - "\n", - "eta0 = -0.5*tanh(sqrt(2)*(-A2*sin(B2*x) + y - 0.25)/(2*sqrt(kappa))) + 0.5 \n", - "\n", - "S = -(tanh(sqrt(2)*(A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) - y + 0.25)/(2*sqrt(kappa)))**2 - 1)*(0.5*sqrt(kappa)*((A1*B1*t*cos(B1*x) + A2*B2*cos(B2*x + C2*t))**2 + 1)*tanh(sqrt(2)*(A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) - y + 0.25)/(2*sqrt(kappa))) - 0.5*sqrt(kappa)*tanh(sqrt(2)*(A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) - y + 0.25)/(2*sqrt(kappa))) + 0.25*sqrt(2)*kappa*(A1*B1**2*t*sin(B1*x) + A2*B2**2*sin(B2*x + C2*t)) + 0.25*sqrt(2)*(A1*sin(B1*x) + A2*C2*cos(B2*x + C2*t)))/sqrt(kappa)\n" - ] - } - ], + "outputs": [], "source": [ "# Sympy code to generate expressions for PFHub Problem 7 (MMS)\n", "\n", - "from sympy import symbols, simplify\n", - "from sympy import sin, cos, cosh, tanh, sqrt\n", - "from sympy.physics.vector import divergence, gradient, ReferenceFrame, time_derivative\n", + "from sympy import sin, cos, cosh, sech, tanh, sqrt, symbols\n", + "from sympy import Rational, diff, expand, simplify\n", + "from sympy import Eq, Function, init_printing\n", + "from sympy.abc import x, y, t\n", + "from sympy.physics.vector import ReferenceFrame, divergence, gradient, time_derivative\n", "from sympy.utilities.codegen import codegen\n", - "from sympy.abc import kappa, S, x, y, t\n", "\n", - "# Spatial coordinates: x=R[0], y=R[1], z=R[2]\n", - "R = ReferenceFrame('R')\n", + "init_printing()\n", "\n", - "# sinusoid amplitudes\n", - "A1, A2 = symbols('A1 A2')\n", - "B1, B2 = symbols('B1 B2')\n", - "C2 = symbols('C2')\n", + "R = ReferenceFrame(\"R\") # spatial coords\n", + "X = R[0]\n", + "Y = R[1]\n", "\n", - "# Define interface offset (alpha)\n", - "alpha = 0.25 + A1 * t * sin(B1 * R[0]) \\\n", - " + A2 * sin(B2 * R[0] + C2 * t)\n", + "A1, A2 = symbols(\"A_1 A_2\", real=True)\n", + "B1, B2 = symbols(\"B_1 B_2\", real=True)\n", + "C2, κ = symbols(\"C_2 kappa\", real=True)\n", "\n", - "# Define the solution equation (eta)\n", - "eta = 0.5 * (1 - tanh((R[1] - alpha) / sqrt(2*kappa)))\n", + "# Define α symbolically to simplify the expressions for visual comparison\n", "\n", - "# Compute the source term from the equation of motion\n", - "source = simplify(time_derivative(eta, R)\n", - " + 4 * eta * (eta - 1) * (eta - 1/2)\n", - " - kappa * divergence(gradient(eta, R), R))\n", + "α = Function(\"alpha\", real=True)(X, t)\n", + "ψ = (Y - α) / sqrt(2 * κ)\n", + "η = (1 - tanh(ψ)) / 2\n", "\n", - "# Replace R[i] with (x, y)\n", - "alpha = alpha.subs({R[0]: x, R[1]: y})\n", - "eta = eta.subs({R[0]: x, R[1]: y})\n", - "eta0 = eta.subs(t, 0)\n", - "source = source.subs({R[0]: x, R[1]: y})\n", + "source = time_derivative(η, R) \\\n", + " + 4 * η * (η - 1) * (η - Rational(1, 2)) \\\n", + " - divergence(κ * gradient(η, R), R)\n", "\n", - "print(\"alpha =\", alpha, \"\\n\")\n", - "print(\"eta =\", eta, \"\\n\")\n", - "print(\"eta0 =\", eta0, \"\\n\")\n", - "print(\"S =\", source)" + "# Nested `simplify` calls to incorporate the hyperbolic trig\n", + "# identity, which is not implemented in SymPy\n", + " \n", + "S = simplify(\n", + " expand(\n", + " simplify(\n", + " expand(source)\n", + " ).subs({cosh(ψ)**2: 1 / sech(ψ)**2})\n", + " )\n", + ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Code" + "Compare the generated expressions for $S(x, y, \\alpha)$, $\\alpha$, and the derivatives of $\\alpha$:" ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": 6, + "metadata": { + "scrolled": true, + "tags": [] + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA3oAAABBCAYAAACHBtaLAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4Ae2dXbLkNLaFDxU1AChGcGEGdDGAGxQP9x2oEVDMoDvqrd8qYAZ0j4CfGdBE9DvVPQPoETScGdRdn47kUjolW3baaWfmUoTTsn62tpa2pL0l2fnOmzdv7uwOEfjrX//6rUJ+0v3Hwxg/bYWA22Qr5OeVq/Z6Vzl/1vWJ/PfzqDiXETACRsAIGIE2BDzvtOGUUlmvSkhczn2OjL9jQ++wgaPgP9H988MYP22FwJJtIlqjKxtK885Wdb2mcoXjR6rPD7r+JL+NvStoXLUjBvzLWJUP4v1Lt+8VNK6rYASuAAHPO22NKJzY0FhE1xUt5vnPxkpWOutWYyA1xE+V8ccNNG8micB7oco+1f1PN1PpnVd0yTaJtL7S/W87r/ZVsCec/63ra1Xm77q8cHIVrXr3tdr0q1QV+VEW/qXrwxTm+3IICN9nooZxjVENxj8o7B+62xkBI1BAQP3D804BlzxIGC2m60ZanIDzHJ+DvKJ/qow/WpGXiyIt4Nh9QCn95KIYv2JmV2iTz0VzkpGn9J/pSjsXu0N7Tf5E+8+1Cg/F5XmUDrzfhc883P6LReCF2hLjIznGzA8UxvhptzwCGHY/6vpGpP+i66flizBFI3BdCKi/eN6pNGkcq5fUdSfrVbAmPqxbFdpIuFT1rjy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L3Dyzh1/weCPp9xGm7uWRsAIGIHdIWBDb3dNYoaMgBEwAkbgkhGQcfej+GdXj4+y2BkBI2AEjIAR2ASB/wfbNpWKxDZ7DAAAAABJRU5ErkJggg==", + "text/latex": [ + "$\\displaystyle S = - \\frac{\\left(2 \\sqrt{\\kappa} \\tanh{\\left(\\frac{\\sqrt{2} \\left(y - \\alpha{\\left(x,t \\right)}\\right)}{2 \\sqrt{\\kappa}} \\right)} \\left(\\frac{\\partial}{\\partial x} \\alpha{\\left(x,t \\right)}\\right)^{2} + \\sqrt{2} \\kappa \\frac{\\partial^{2}}{\\partial x^{2}} \\alpha{\\left(x,t \\right)} - \\sqrt{2} \\frac{\\partial}{\\partial t} \\alpha{\\left(x,t \\right)}\\right) \\operatorname{sech}^{2}{\\left(\\frac{\\sqrt{2} \\left(y - \\alpha{\\left(x,t \\right)}\\right)}{2 \\sqrt{\\kappa}} \\right)}}{4 \\sqrt{\\kappa}}$" + ], + "text/plain": [ + " ⎛ 2 2 ⎞ \n", + " ⎜ ⎛√2⋅(y - α(x, t))⎞ ⎛∂ ⎞ ∂ ∂ ⎟ 2⎛√2⋅(y - α(x, t))⎞ \n", + " -⎜2⋅√κ⋅tanh⎜────────────────⎟⋅⎜──(α(x, t))⎟ + √2⋅κ⋅───(α(x, t)) - √2⋅──(α(x, t))⎟⋅sech ⎜────────────────⎟ \n", + " ⎜ ⎝ 2⋅√κ ⎠ ⎝∂x ⎠ 2 ∂t ⎟ ⎝ 2⋅√κ ⎠ \n", + " ⎝ ∂x ⎠ \n", + "S = ───────────────────────────────────────────────────────────────────────────────────────────────────────────\n", + " 4⋅√κ " + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Eq(symbols(\"S\"), S.subs({X: x, Y: y}))" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "scrolled": false, + "tags": [] + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAA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XbSY/NMQyhaeWGgCFgCOwYATmCzxKP/zpY/Y7BjpJ2POEmmiFgCBgCGQjwa3ZCRbZjqKCwC0PAEDAEzgcB7RD4HcMtBY6YID6Z/0b5z/8Hl0I60ddK3dUAAAAASUVORK5CYII=", + "text/latex": [ + "$\\displaystyle \\alpha = A_{1} t \\sin{\\left(B_{1} x \\right)} + A_{2} \\sin{\\left(B_{2} x + C_{2} t \\right)} + \\frac{1}{4}$" + ], + "text/plain": [ + "α = A₁⋅t⋅sin(B₁⋅x) + A₂⋅sin(B₂⋅x + C₂⋅t) + 1/4" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "alpha = Rational(1, 4) + A1 * t * sin(B1 * X) + A2 * sin(B2 * X + C2 * t)\n", + "Eq(symbols(\"alpha\"), alpha.subs({X: x, Y: y}))" + ] + }, + { + "cell_type": "code", + "execution_count": 8, "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbMAAAAtCAYAAAAk9oUAAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAQt0lEQVR4Ae2d67EdtRKFt10nAAMRwM3AmAgwGRg7ApsMoPyPfy7IABwBNhlgR2DjDC43ApuTge/6dNQqzUMzmvfe0F01RzOSRmotLXVLmtlzbn38+PE0Jj/++OMd5bmv4wsdr3T9buweT3cEHAFHwBFwBPZC4PZYRXJcOLGnOnBgv+q4p7iXCl0cAUfAEXAEHIGzQODW0MosrsieKvwh11bX3+v6K4Xf5vF+7gg4Ao6AI+AIHIHA2MqMFdmT6NRy/VihPVD83TzSzx0BR8ARcAQcgSMQGHNm/5VSL+S0rnPl4jVxbEG6OAKOgCPgCDgChyJwNVS7nBYrsJJ8UMJXpUSPdwQcAUfAEXAE9kJg0JmhhBzaEwVf6rDV2RvF/a5r3mz8S4eLI+AIOAKOgCNwKAKDzkxO6w9p95fC70xLnd/XgYND3Jnd4OB/HQFHwBFwBA5EoPjMLDqyk8LkyNBT168UW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p8zaGxSoppbHXhBFchuspKojLZvuj8EDZlqDyJerJNVto+HCxJ94VZk8LO87/BG884UW1hVnb2KzMglK6r8KCvO9bGQeVdNFdMf2GVT2qZUObbd31QVsVtXX6VEjMzSffVeXjJeMyE8bRGm60MhcEmN1ZmUoxl9AslJkeGslzHOLYgG85M18QxeNmS3EJYDfKsZakTme3IYqNY/q+1QoxFHhOoL+kv2hL6TtdMYvhA8SxHv1Mr1uJBUndDHC6dK0xOmcASJhFea/F/6/KTzhucrM5D6XjJeMyFeI02N8ZZY2U2pJWIjKPjAWtjq1HXFHhf4WbPXVQ2xpfXbw8xtqr3e9XPg87VV54q16USgaN5UKOmc6UGpcvOcwk8vGyEx7XvG2cdZ6ZMbDPyRpCtzt4oDkPO1yR4eaKxQtI1To70fEtCUS6OgCPgCDgCjsA+CDScmRwS+8G8Apu2E3Ru24iswHgZhOdXxJGHrQjOeXUU54fjO2T1pLpdHAFHwBFwBP6lCCRnJieEIzspbKy8Yhz7m/z+AUeWfqSrc14g4C3HzT6JRf0ujoAj4Ag4Ao7AEAJXJMoZsbXICqvzw0jSJazAkBc3QfqL42u/EJIS/cQRcAQcAUfAEdgDgduxEp538cZiyTHxAgbPxew5mulmW4x27aEj4Ag4Ao6AI7A7ArfloFh14azscy8NJZSOw0J4ZpYkuy9sT6YEP3EEHAFHwBFwBHZGgJXZp7HON4W6WbXxSn7b2QUnl8dHB1coxqMdAUfAEXAEHIFtEGBlxm+n2tuHoTal8YIHTqvx27KQePMj5rQtGfOywnNxBBwBR8ARcAR2RYCVGcLqK72OT4ScE28vPtfBJ6z6fizMii7EKz1sVSpMzk1pLo6AI+AIOAKOwC4I5K/mswp7pONDVnPxW2xyXKzCeI7Gp6ZOuk6v7HPt4gg4Ao6AI+AI7IXA/wEn5lxyDlNpLgAAAABJRU5ErkJggg==", + "text/latex": [ + "$\\displaystyle \\frac{\\partial}{\\partial t} \\alpha{\\left(x,t \\right)} = A_{1} \\sin{\\left(B_{1} x \\right)} + A_{2} C_{2} \\cos{\\left(B_{2} x + C_{2} t \\right)}$" + ], + "text/plain": [ + "∂ \n", + "──(α(x, t)) = A₁⋅sin(B₁⋅x) + A₂⋅C₂⋅cos(B₂⋅x + C₂⋅t)\n", + "∂t " + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "### Python\n", + "alpha_t = simplify(expand(diff(alpha, t)))\n", "\n", - "Copy the first cell under Source Term directly into your program.\n", - "For a performance boost, convert the expressions into lambda functions:\n", + "Eq(diff(α, t).subs({X: x, Y: y}), alpha_t.subs({X: x, Y: y}))" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdsAAAAtCAYAAADmxsGEAAAACXBIWXMAAA7EAAAOxAGVKw4bAAARA0lEQVR4Ae2d7bXbNhKGZZ9bgDepINkO/FFBnA4cuwI7HWyO//mfT9JB4gripIPYFdhxB5utIM7twPs+EIYGKYAEJFKUrmbOoQDiYzB4McAAIEjd+vTp06aWXrx4cUdpH+r6Wtcb3X+ozevpHAFHwBFwBByBS0Xgdm3FZVgxss91YWB/0XVfYb/JdXIEHAFHwBFwBByBEQRu1axs44r2udwfUl66/4/uH8j9Lg13vyPgCDgCjoAj4Ah8RqB2ZcuK9lk0up9zb1e4jxR+Nw10vyPgCDgCjoAj4Ah8RqDW2P5XWV7LqF5/zrrZxHvC2GJ2cgQcAUfAEXAEHIEMAleZsJ0gGVWe0ZbooyIelCI93BFwBBwBR8ARuHQEqowtIMngPpNzT5etbt8p7HfdczL5L11OjoAj4Ag4Ao6AI5BBoMrYyqj+obx/yf3eeMj/UBcGGHJju8XBfx0BR8ARcAQcgR0EJp/ZRkO7kdsZWrjo/o0cC/tzh7MHOAKOgCPgCDgCjkBAYHRlK4PKyvWhLraPc8RHLqDXW8d/HQFHwBFwBBwBR2CIwNTKlvdqr2V0S1+K4nnt74q357hD/n7vCDgCjoAj4AhcPAJFYys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ZqOf1TXPw3YOWTXyYVJRegZby4pOP9cqu7bMRdIJCyYw9kwXBWGWzB8YHIpRJ+8xyugKO65nLp3spF4Qq3PXWc4jsBjA7Uh4zdkPj1FGJ/vMntl1UfKdMx77wjtHnXt9beeZbUkyKTOGmMMma28lbyQDhoGV9myGoFTvUrjK5ss3PHyfbeuqVJaHnz4Cp6CTUyi5zk4hdDPiz0EXbwbS5Vrk+tqOsVUiTt5yus9Wt+8UhlHhy0Ms5w9dUZYl9BhHwBFwBBwBR+AGItDbRpYh5Wg0R9i7LRn5eRfJ3lHqreIUznaOxT2Q/6kuVp1PdEHBUG+9/usIOAKOgCPgCFwmAret2jKc4ZNmcjtDS5zueYfKwnrPSRTOKyJ8GIDt3He6XunCOHNgAUPsp3QFgpMj4Ag4Ao7AZSMQVrYyjqxOOfzUezk8gQbDCb3eOsEIkyc1pmw78z4Uq1voC11pfAj0H0fAEXAEHAFH4NIQsG1kVqKcOC6dNGZr2L4zaxi9V/p0WxlDzQEqjO5G7uoHqUxQdx0BR8ARcAQcgTURuC2jyKoVY2qfruvJo3hWvBDHmDtS+NAw86WpX7sE7nEEHAFHwBFwBByBgADPbNnuhXjmmiNWvaxYs8aYDNEgY7S7bxArjK9OEebkCDgCjoAj4AhcNAKsbNkKDlu/QyQUxzNYVra9LeFoSPneo616OUDFNnS6rcy/qGT5Dsvxe0fAEXAEHAFH4CYjwMoWYvVqJ45DgAwln0HjdPG9gRElHiPL9VFxrF57n0pTGHGllbKinBwBR8ARcAQcgctBoPuohQwkq9gnulLDmf4tWYdKNLCcNOarUhvd8/oP+fngBa8HYYS7LWXdOzkCjoAj4Ag4AheLwP8B8rYZ1bJfnOwAAAAASUVORK5CYII=", + "text/latex": [ + "$\\displaystyle \\frac{\\partial}{\\partial x} \\alpha{\\left(x,t \\right)} = A_{1} B_{1} t \\cos{\\left(B_{1} x \\right)} + A_{2} B_{2} \\cos{\\left(B_{2} x + C_{2} t \\right)}$" + ], + "text/plain": [ + "∂ \n", + "──(α(x, t)) = A₁⋅B₁⋅t⋅cos(B₁⋅x) + A₂⋅B₂⋅cos(B₂⋅x + C₂⋅t)\n", + "∂x " + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "alpha_x = simplify(expand(diff(alpha, X)))\n", "\n", - "```python\n", - "from sympy.utilities.lambdify import lambdify\n", + "Eq(diff(α, X).subs({X: x, Y: y}), alpha_x.subs({X: x, Y: y}))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfIAAAAuCAYAAADTGpswAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAS6UlEQVR4Ae2d67XdtBLHN2edAnhUcKEDSCog6SCQCnLoIKx8y7cs6ABSAQkdABUk0MHlVkA4HeT+f9qSjmxLtmzL+5WZtbz1Hkl/jTQa+bE/ev/+/a4lPX/+/GPxe+Z5fu7dJ4q/bVmP8TIEDAFDwBAwBAyB3e56AxB+kNL+LvCV/yf5/9T1RYgz1xAwBAwBQ8AQMATaIPDRHIvcW9sPVDWW9u8K/9VvhuIw8R/K/Z00ueT9r66v5B/kJ4+RIWAIGAKGgCFgCCxD4Kq2mJQwCpwjc5Txz7ruKe613D5hjb/tR1rYEDAEDAFDwBAwBNojUGWRS2G7+95yv0+boPBThe/L/SaNT/1K+0HhR3LtaD0FxvyGgCFgCBgChkADBGotcizxGyljFHpKWOYo6S/TyOD38Y8U/irEmWsIGAKGgCFgCBgC7RCoVeTc434lxdx58tyHiePYvUNK49441jj3xjvlOhktYAgYAoaAIWAIGAKLEah6al2KGMu7RO+UcD9N9Er8e7kPifdh3L/TfOY3BAwBQ8AQMAQMgXUIVClyqpASvpHDEXmwrt8o7leFsbyjglYcYV45Q5GHI3cegOvcX1fYyBAwBAwBQ8AQMARWIlClyKWQf1M9f8tN3w9/oDDKHYqKXH7eGf/Yu3L2lJYNceYaAoaAIWAIGAKGwDoEJp9a90p8J9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gChoAhYAgYAnMQCA+7YUHzFa3S+9xY09zrRVkHmvWPNCr7wT3UEIAy1xAwBAwBQ8AQ2AqBKylYrGQUdfYrNErHUod4Si6S4vtKny/A/RIzmMcQMAQMAUPAEDAENkfgSjVwBA5xjztHWOudP6boZ/LKng1B/GQmGwSufl4LGwKGgCFgCBgChkA7BLDIeTUqPTKP3JXGPW8sct4fjOSVNJ+GC9Y697n7f3DxTOlZvpGReQwBQ8AQMAQMAUNgFQJY5BBWd+ehMylhPlTAU+h86a3/HjQKnKv6n8SU18gQMAQMAUPAEDAEGiMQ3yOXssb6fqwr/Z4w73wPrGrFcWTOE+l8SH+ncNU/iZHXyBAwBAwBQ8AQMATaIfB/u/i5nfT0UREAAAAASUVORK5CYII=", + "text/latex": [ + "$\\displaystyle \\frac{\\partial^{2}}{\\partial x^{2}} \\alpha{\\left(x,t \\right)} = - A_{1} B_{1}^{2} t \\sin{\\left(B_{1} x \\right)} - A_{2} B_{2}^{2} \\sin{\\left(B_{2} x + C_{2} t \\right)}$" + ], + "text/plain": [ + " 2 \n", + " ∂ 2 2 \n", + "───(α(x, t)) = - A₁⋅B₁ ⋅t⋅sin(B₁⋅x) - A₂⋅B₂ ⋅sin(B₂⋅x + C₂⋅t)\n", + " 2 \n", + "∂x " + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "alpha_xx = simplify(expand(diff(alpha, X, 2)))\n", "\n", - "apy = lambdify([x, y], alpha, modules='sympy')\n", - "epy = lambdify([x, y], eta, modules='sympy')\n", - "ipy = lambdify([x, y], eta0, modules='sympy')\n", - "Spy = lambdify([x, y], S, modules='sympy')\n", - "```\n", + "Eq(diff(α, X, X).subs({X: x, Y: y}), alpha_xx.subs({X: x, Y: y}))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "scrolled": false, + "tags": [] + }, + "outputs": [], + "source": [ + "eta = simplify(η.subs({R[0]: x, R[1]: y, α: alpha.subs({R[0]: x, R[1]: y})}))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "scrolled": false, + "tags": [] + }, + "outputs": [], + "source": [ + "eta0 = simplify(eta.subs({t: 0, α: alpha.subs({R[0]: x, R[1]: y, t: 0})}))" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "scrolled": false, + "tags": [] + }, + "outputs": [], + "source": [ + "source = S.subs(\n", + " {\n", + " α: alpha,\n", + " diff(α, t): alpha_t,\n", + " diff(α, X): alpha_x,\n", + " diff(α, X, 2): alpha_xx\n", + " }\n", + ").subs({X: x, Y: y})\n", + "\n", + "alpha = alpha.subs({X: x, Y: y})\n", + "eta = eta.subs({X: x, Y: y})\n", + "eta0 = eta0.subs({X: x, Y: y})" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Code" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Python\n", "\n", - "> Note: Click \"Code Toggle\" at the top of the page to see the Python expressions." + "Substituting the expression for $\\alpha$ into $S(x, y, \\alpha)$, the Python code for the full source term $S(x, y, t)$ is" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S = -(2*sqrt(kappa)*(A_1*B_1*t*cos(B_1*x) + A_2*B_2*cos(B_2*x + C_2*t))**2*tanh(sqrt(2)*(-A_1*t*sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 1/4)/(2*sqrt(kappa))) + sqrt(2)*kappa*(-A_1*B_1**2*t*sin(B_1*x) - A_2*B_2**2*sin(B_2*x + C_2*t)) - sqrt(2)*(A_1*sin(B_1*x) + A_2*C_2*cos(B_2*x + C_2*t)))*sech(sqrt(2)*(-A_1*t*sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 1/4)/(2*sqrt(kappa)))**2/(4*sqrt(kappa))\n" + ] + } + ], + "source": [ + "print(\"S =\", source)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "α = A_1*t*sin(B_1*x) + A_2*sin(B_2*x + C_2*t) + 1/4\n" + ] + } + ], + "source": [ + "print(\"α =\", alpha)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "η = tanh(sqrt(2)*(4*A_1*t*sin(B_1*x) + 4*A_2*sin(B_2*x + C_2*t) - 4*y + 1)/(8*sqrt(kappa)))/2 + 1/2\n" + ] + } + ], + "source": [ + "print(\"η =\", eta)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "η₀ = tanh(sqrt(2)*(4*A_2*sin(B_2*x) - 4*y + 1)/(8*sqrt(kappa)))/2 + 1/2\n" + ] + } + ], + "source": [ + "print(\"η₀ =\", eta0)" ] }, { @@ -510,8 +753,11 @@ }, { "cell_type": "code", - "execution_count": 6, - "metadata": {}, + "execution_count": 18, + "metadata": { + "scrolled": false, + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -520,7 +766,7 @@ "manufactured.h:\n", "\n", "/******************************************************************************\n", - " * Code generated with sympy 1.2 *\n", + " * Code generated with SymPy 1.11.1 *\n", " * *\n", " * See http://www.sympy.org/ for more information. *\n", " * *\n", @@ -531,10 +777,10 @@ "#ifndef PFHUB__MANUFACTURED__H\n", "#define PFHUB__MANUFACTURED__H\n", "\n", - "double alpha(double A1, double A2, double B1, double B2, double C2, double t, double x);\n", - "double eta(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y);\n", - "double eta0(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y);\n", - "double S(double S);\n", + "double alpha(double A_1, double A_2, double B_1, double B_2, double C_2, double t, double x);\n", + "double eta(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y);\n", + "double eta0(double A_2, double B_2, double kappa, double x, double y);\n", + "double S(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y);\n", "\n", "#endif\n", "\n", @@ -543,7 +789,7 @@ "manufactured.c:\n", "\n", "/******************************************************************************\n", - " * Code generated with sympy 1.2 *\n", + " * Code generated with SymPy 1.11.1 *\n", " * *\n", " * See http://www.sympy.org/ for more information. *\n", " * *\n", @@ -552,34 +798,34 @@ "#include \"manufactured.h\"\n", "#include \n", "\n", - "double alpha(double A1, double A2, double B1, double B2, double C2, double t, double x) {\n", + "double alpha(double A_1, double A_2, double B_1, double B_2, double C_2, double t, double x) {\n", "\n", " double alpha_result;\n", - " alpha_result = A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) + 0.25;\n", + " alpha_result = A_1*t*sin(B_1*x) + A_2*sin(B_2*x + C_2*t) + 1.0/4.0;\n", " return alpha_result;\n", "\n", "}\n", "\n", - "double eta(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y) {\n", + "double eta(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y) {\n", "\n", " double eta_result;\n", - " eta_result = -0.5*tanh((1.0/2.0)*M_SQRT2*(-A1*t*sin(B1*x) - A2*sin(B2*x + C2*t) + y - 0.25)/sqrt(kappa)) + 0.5;\n", + " eta_result = (1.0/2.0)*tanh((1.0/8.0)*M_SQRT2*(4*A_1*t*sin(B_1*x) + 4*A_2*sin(B_2*x + C_2*t) - 4*y + 1)/sqrt(kappa)) + 1.0/2.0;\n", " return eta_result;\n", "\n", "}\n", "\n", - "double eta0(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y) {\n", + "double eta0(double A_2, double B_2, double kappa, double x, double y) {\n", "\n", " double eta0_result;\n", - " eta0_result = -0.5*tanh((1.0/2.0)*M_SQRT2*(-A1*t*sin(B1*x) - A2*sin(B2*x + C2*t) + y - 0.25)/sqrt(kappa)) + 0.5;\n", + " eta0_result = (1.0/2.0)*tanh((1.0/8.0)*M_SQRT2*(4*A_2*sin(B_2*x) - 4*y + 1)/sqrt(kappa)) + 1.0/2.0;\n", " return eta0_result;\n", "\n", "}\n", "\n", - "double S(double S) {\n", + "double S(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y) {\n", "\n", " double S_result;\n", - " S_result = S;\n", + " S_result = -1.0/4.0*(2*sqrt(kappa)*pow(A_1*B_1*t*cos(B_1*x) + A_2*B_2*cos(B_2*x + C_2*t), 2)*tanh((1.0/2.0)*M_SQRT2*(-A_1*t*sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 1.0/4.0)/sqrt(kappa)) + M_SQRT2*kappa*(-A_1*pow(B_1, 2)*t*sin(B_1*x) - A_2*pow(B_2, 2)*sin(B_2*x + C_2*t)) - M_SQRT2*(A_1*sin(B_1*x) + A_2*C_2*cos(B_2*x + C_2*t)))*pow(1.0/((1.0/2.0)*exp((1.0/2.0)*M_SQRT2*((1.0/2.0)*I*A_1*t*(exp(I*B_1*x) - exp(-I*B_1*x)) + (1.0/2.0)*I*A_2*(-exp(I*(-B_2*x - C_2*t)) + exp(I*(B_2*x + C_2*t))) + y - 1.0/4.0)/sqrt(kappa)) + (1.0/2.0)*exp(-1.0/2.0*M_SQRT2*((1.0/2.0)*I*A_1*t*(exp(I*B_1*x) - exp(-I*B_1*x)) + (1.0/2.0)*I*A_2*(-exp(I*(-B_2*x - C_2*t)) + exp(I*(B_2*x + C_2*t))) + y - 1.0/4.0)/sqrt(kappa))), 2)/sqrt(kappa);\n", " return S_result;\n", "\n", "}\n", @@ -591,8 +837,8 @@ "[(c_name, code), (h_name, header)] = \\\n", "codegen([(\"alpha\", alpha),\n", " (\"eta\", eta),\n", - " (\"eta0\", eta),\n", - " (\"S\", S)],\n", + " (\"eta0\", eta0),\n", + " (\"S\", source)],\n", " language=\"C\",\n", " prefix=\"manufactured\",\n", " project=\"PFHub\")\n", @@ -611,8 +857,11 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": {}, + "execution_count": 19, + "metadata": { + "scrolled": false, + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -621,66 +870,83 @@ "manufactured.f:\n", "\n", "!******************************************************************************\n", - "!* Code generated with sympy 1.2 *\n", + "!* Code generated with SymPy 1.11.1 *\n", "!* *\n", "!* See http://www.sympy.org/ for more information. *\n", "!* *\n", "!* This file is part of 'PFHub' *\n", "!******************************************************************************\n", "\n", - "REAL*8 function alpha(A1, A2, B1, B2, C2, t, x)\n", + "REAL*8 function alpha(A_1, A_2, B_1, B_2, C_2, t, x)\n", "implicit none\n", - "REAL*8, intent(in) :: A1\n", - "REAL*8, intent(in) :: A2\n", - "REAL*8, intent(in) :: B1\n", - "REAL*8, intent(in) :: B2\n", - "REAL*8, intent(in) :: C2\n", + "REAL*8, intent(in) :: A_1\n", + "REAL*8, intent(in) :: A_2\n", + "REAL*8, intent(in) :: B_1\n", + "REAL*8, intent(in) :: B_2\n", + "REAL*8, intent(in) :: C_2\n", "REAL*8, intent(in) :: t\n", "REAL*8, intent(in) :: x\n", "\n", - "alpha = A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) + 0.25d0\n", + "alpha = A_1*t*sin(B_1*x) + A_2*sin(B_2*x + C_2*t) + 1.0d0/4.0d0\n", "\n", "end function\n", "\n", - "REAL*8 function eta(A1, A2, B1, B2, C2, kappa, t, x, y)\n", + "REAL*8 function eta(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)\n", "implicit none\n", - "REAL*8, intent(in) :: A1\n", - "REAL*8, intent(in) :: A2\n", - "REAL*8, intent(in) :: B1\n", - "REAL*8, intent(in) :: B2\n", - "REAL*8, intent(in) :: C2\n", + "REAL*8, intent(in) :: A_1\n", + "REAL*8, intent(in) :: A_2\n", + "REAL*8, intent(in) :: B_1\n", + "REAL*8, intent(in) :: B_2\n", + "REAL*8, intent(in) :: C_2\n", "REAL*8, intent(in) :: kappa\n", "REAL*8, intent(in) :: t\n", "REAL*8, intent(in) :: x\n", "REAL*8, intent(in) :: y\n", "\n", - "eta = -0.5d0*tanh(0.70710678118654752d0*kappa**(-0.5d0)*(-A1*t*sin(B1*x &\n", - " ) - A2*sin(B2*x + C2*t) + y - 0.25d0)) + 0.5d0\n", + "eta = (1.0d0/2.0d0)*tanh(0.17677669529663688d0*kappa**(-0.5d0)*(4.0d0* &\n", + " A_1*t*sin(B_1*x) + 4.0d0*A_2*sin(B_2*x + C_2*t) - 4.0d0*y + 1.0d0 &\n", + " )) + 1.0d0/2.0d0\n", "\n", "end function\n", "\n", - "REAL*8 function eta0(A1, A2, B1, B2, C2, kappa, t, x, y)\n", + "REAL*8 function eta0(A_2, B_2, kappa, x, y)\n", "implicit none\n", - "REAL*8, intent(in) :: A1\n", - "REAL*8, intent(in) :: A2\n", - "REAL*8, intent(in) :: B1\n", - "REAL*8, intent(in) :: B2\n", - "REAL*8, intent(in) :: C2\n", + "REAL*8, intent(in) :: A_2\n", + "REAL*8, intent(in) :: B_2\n", "REAL*8, intent(in) :: kappa\n", - "REAL*8, intent(in) :: t\n", "REAL*8, intent(in) :: x\n", "REAL*8, intent(in) :: y\n", "\n", - "eta0 = -0.5d0*tanh(0.70710678118654752d0*kappa**(-0.5d0)*(-A1*t*sin(B1*x &\n", - " ) - A2*sin(B2*x + C2*t) + y - 0.25d0)) + 0.5d0\n", + "eta0 = (1.0d0/2.0d0)*tanh(0.17677669529663688d0*kappa**(-0.5d0)*(4.0d0* &\n", + " A_2*sin(B_2*x) - 4.0d0*y + 1.0d0)) + 1.0d0/2.0d0\n", "\n", "end function\n", "\n", - "REAL*8 function S(S)\n", + "REAL*8 function S(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)\n", "implicit none\n", - "REAL*8, intent(in) :: S\n", + "REAL*8, intent(in) :: A_1\n", + "REAL*8, intent(in) :: A_2\n", + "REAL*8, intent(in) :: B_1\n", + "REAL*8, intent(in) :: B_2\n", + "REAL*8, intent(in) :: C_2\n", + "REAL*8, intent(in) :: kappa\n", + "REAL*8, intent(in) :: t\n", + "REAL*8, intent(in) :: x\n", + "REAL*8, intent(in) :: y\n", "\n", - "S = S\n", + "S = -1.0d0/4.0d0*(2*sqrt(kappa)*(A_1*B_1*t*cos(B_1*x) + A_2*B_2*cos(B_2* &\n", + " x + C_2*t))**2*tanh(0.70710678118654752d0*kappa**(-0.5d0)*(-A_1*t &\n", + " *sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 0.25d0)) + sqrt(2.0d0) &\n", + " *kappa*(-A_1*B_1**2*t*sin(B_1*x) - A_2*B_2**2*sin(B_2*x + C_2*t &\n", + " )) - sqrt(2.0d0)*(A_1*sin(B_1*x) + A_2*C_2*cos(B_2*x + C_2*t)))* &\n", + " 1d0/((1.0d0/2.0d0)*exp(0.70710678118654752d0*kappa**(-0.5d0)*( &\n", + " 0.5d0*cmplx(0,1)*A_1*t*(exp(cmplx(0,1)*B_1*x) - exp(-cmplx(0,1)* &\n", + " B_1*x)) + 0.5d0*cmplx(0,1)*A_2*(-exp(cmplx(0,1)*(-B_2*x - C_2*t &\n", + " )) + exp(cmplx(0,1)*(B_2*x + C_2*t))) + y - 0.25d0)) + (1.0d0/ &\n", + " 2.0d0)*exp(-0.70710678118654752d0*kappa**(-0.5d0)*(0.5d0*cmplx(0, &\n", + " 1)*A_1*t*(exp(cmplx(0,1)*B_1*x) - exp(-cmplx(0,1)*B_1*x)) + 0.5d0 &\n", + " *cmplx(0,1)*A_2*(-exp(cmplx(0,1)*(-B_2*x - C_2*t)) + exp(cmplx(0, &\n", + " 1)*(B_2*x + C_2*t))) + y - 0.25d0)))**2/sqrt(kappa)\n", "\n", "end function\n", "\n" @@ -691,8 +957,8 @@ "[(f_name, code), (f_name, header)] = \\\n", "codegen([(\"alpha\", alpha),\n", " (\"eta\", eta),\n", - " (\"eta0\", eta),\n", - " (\"S\", S)],\n", + " (\"eta0\", eta0),\n", + " (\"S\", source)],\n", " language=\"f95\",\n", " prefix=\"manufactured\",\n", " project=\"PFHub\")\n", @@ -710,8 +976,11 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": {}, + "execution_count": 20, + "metadata": { + "scrolled": false, + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -719,36 +988,36 @@ "text": [ "manufactured.jl:\n", "\n", - "# Code generated with sympy 1.2\n", + "# Code generated with SymPy 1.11.1\n", "#\n", "# See http://www.sympy.org/ for more information.\n", "#\n", "# This file is part of 'PFHub'\n", "\n", - "function alpha(A1, A2, B1, B2, C2, t, x)\n", + "function alpha(A_1, A_2, B_1, B_2, C_2, t, x)\n", "\n", - " out1 = A1.*t.*sin(B1.*x) + A2.*sin(B2.*x + C2.*t) + 0.25\n", + " out1 = A_1 .* t .* sin(B_1 .* x) + A_2 .* sin(B_2 .* x + C_2 .* t) + 1 // 4\n", "\n", " return out1\n", "end\n", "\n", - "function eta(A1, A2, B1, B2, C2, kappa, t, x, y)\n", + "function eta(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)\n", "\n", - " out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5\n", + " out1 = tanh(sqrt(2) * (4 * A_1 .* t .* sin(B_1 .* x) + 4 * A_2 .* sin(B_2 .* x + C_2 .* t) - 4 * y + 1) ./ (8 * sqrt(kappa))) / 2 + 1 // 2\n", "\n", " return out1\n", "end\n", "\n", - "function eta0(A1, A2, B1, B2, C2, kappa, t, x, y)\n", + "function eta0(A_2, B_2, kappa, x, y)\n", "\n", - " out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5\n", + " out1 = tanh(sqrt(2) * (4 * A_2 .* sin(B_2 .* x) - 4 * y + 1) ./ (8 * sqrt(kappa))) / 2 + 1 // 2\n", "\n", " return out1\n", "end\n", "\n", - "function S(S)\n", + "function S(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)\n", "\n", - " out1 = S\n", + " out1 = -(2 * sqrt(kappa) .* (A_1 .* B_1 .* t .* cos(B_1 .* x) + A_2 .* B_2 .* cos(B_2 .* x + C_2 .* t)) .^ 2 .* tanh(sqrt(2) * (-A_1 .* t .* sin(B_1 .* x) - A_2 .* sin(B_2 .* x + C_2 .* t) + y - 1 // 4) ./ (2 * sqrt(kappa))) + sqrt(2) * kappa .* (-A_1 .* B_1 .^ 2 .* t .* sin(B_1 .* x) - A_2 .* B_2 .^ 2 .* sin(B_2 .* x + C_2 .* t)) - sqrt(2) * (A_1 .* sin(B_1 .* x) + A_2 .* C_2 .* cos(B_2 .* x + C_2 .* t))) .* sech(sqrt(2) * (-A_1 .* t .* sin(B_1 .* x) - A_2 .* sin(B_2 .* x + C_2 .* t) + y - 1 // 4) ./ (2 * sqrt(kappa))) .^ 2 ./ (4 * sqrt(kappa))\n", "\n", " return out1\n", "end\n", @@ -760,8 +1029,8 @@ "[(f_name, code)] = \\\n", "codegen([(\"alpha\", alpha),\n", " (\"eta\", eta),\n", - " (\"eta0\", eta),\n", - " (\"S\", S)],\n", + " (\"eta0\", eta0),\n", + " (\"S\", source)],\n", " language=\"julia\",\n", " prefix=\"manufactured\",\n", " project=\"PFHub\")\n", @@ -779,20 +1048,23 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, + "execution_count": 21, + "metadata": { + "scrolled": false, + "tags": [] + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "alpha = A1*t*Sin[B1*x] + A2*Sin[B2*x + C2*t] + 0.25 \n", + "alpha = A_1*t*Sin[B_1*x] + A_2*Sin[B_2*x + C_2*t] + 1/4 \n", "\n", - "eta = -0.5*Tanh[(1/2)*2^(1/2)*(-A1*t*Sin[B1*x] - A2*Sin[B2*x + C2*t] + y - 0.25)/kappa^(1/2)] + 0.5 \n", + "eta = (1/2)*Tanh[(1/8)*2^(1/2)*(4*A_1*t*Sin[B_1*x] + 4*A_2*Sin[B_2*x + C_2*t] - 4*y + 1)/kappa^(1/2)] + 1/2 \n", "\n", - "eta0 = -0.5*Tanh[(1/2)*2^(1/2)*(-A2*Sin[B2*x] + y - 0.25)/kappa^(1/2)] + 0.5 \n", + "eta0 = (1/2)*Tanh[(1/8)*2^(1/2)*(4*A_2*Sin[B_2*x] - 4*y + 1)/kappa^(1/2)] + 1/2 \n", "\n", - "S = -(Tanh[(1/2)*2^(1/2)*(A1*t*Sin[B1*x] + A2*Sin[B2*x + C2*t] - y + 0.25)/kappa^(1/2)]^2 - 1)*(0.5*kappa^(1/2)*((A1*B1*t*Cos[B1*x] + A2*B2*Cos[B2*x + C2*t])^2 + 1)*Tanh[(1/2)*2^(1/2)*(A1*t*Sin[B1*x] + A2*Sin[B2*x + C2*t] - y + 0.25)/kappa^(1/2)] - 0.5*kappa^(1/2)*Tanh[(1/2)*2^(1/2)*(A1*t*Sin[B1*x] + A2*Sin[B2*x + C2*t] - y + 0.25)/kappa^(1/2)] + 0.25*2^(1/2)*kappa*(A1*B1^2*t*Sin[B1*x] + A2*B2^2*Sin[B2*x + C2*t]) + 0.25*2^(1/2)*(A1*Sin[B1*x] + A2*C2*Cos[B2*x + C2*t]))/kappa^(1/2) \n", + "S = -1/4*(2*kappa^(1/2)*(A_1*B_1*t*Cos[B_1*x] + A_2*B_2*Cos[B_2*x + C_2*t])^2*Tanh[(1/2)*2^(1/2)*(-A_1*t*Sin[B_1*x] - A_2*Sin[B_2*x + C_2*t] + y - 1/4)/kappa^(1/2)] + 2^(1/2)*kappa*(-A_1*B_1^2*t*Sin[B_1*x] - A_2*B_2^2*Sin[B_2*x + C_2*t]) - 2^(1/2)*(A_1*Sin[B_1*x] + A_2*C_2*Cos[B_2*x + C_2*t]))*Sech[(1/2)*2^(1/2)*(-A_1*t*Sin[B_1*x] - A_2*Sin[B_2*x + C_2*t] + y - 1/4)/kappa^(1/2)]^2/kappa^(1/2) \n", "\n" ] } @@ -815,8 +1087,11 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": {}, + "execution_count": 22, + "metadata": { + "scrolled": false, + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -825,33 +1100,33 @@ "manufactured.nb:\n", "\n", "alpha.m\n", - "function out1 = alpha(A1, A2, B1, B2, C2, t, x)\n", - " %ALPHA Autogenerated by sympy\n", - " % Code generated with sympy 1.2\n", + "function out1 = alpha(A_1, A_2, B_1, B_2, C_2, t, x)\n", + " %ALPHA Autogenerated by SymPy\n", + " % Code generated with SymPy 1.11.1\n", " %\n", " % See http://www.sympy.org/ for more information.\n", " %\n", " % This file is part of 'PFHub'\n", "\n", - " out1 = A1.*t.*sin(B1.*x) + A2.*sin(B2.*x + C2.*t) + 0.25;\n", + " out1 = A_1.*t.*sin(B_1.*x) + A_2.*sin(B_2.*x + C_2.*t) + 1/4;\n", "\n", "end\n", "\n", - "function out1 = eta(A1, A2, B1, B2, C2, kappa, t, x, y)\n", + "function out1 = eta(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)\n", "\n", - " out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5;\n", + " out1 = tanh(sqrt(2)*(4*A_1.*t.*sin(B_1.*x) + 4*A_2.*sin(B_2.*x + C_2.*t) - 4*y + 1)./(8*sqrt(kappa)))/2 + 1/2;\n", "\n", "end\n", "\n", - "function out1 = eta0(A1, A2, B1, B2, C2, kappa, t, x, y)\n", + "function out1 = eta0(A_2, B_2, kappa, x, y)\n", "\n", - " out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5;\n", + " out1 = tanh(sqrt(2)*(4*A_2.*sin(B_2.*x) - 4*y + 1)./(8*sqrt(kappa)))/2 + 1/2;\n", "\n", "end\n", "\n", - "function out1 = S(S)\n", + "function out1 = S(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)\n", "\n", - " out1 = S;\n", + " out1 = -(2*sqrt(kappa).*(A_1.*B_1.*t.*cos(B_1.*x) + A_2.*B_2.*cos(B_2.*x + C_2.*t)).^2.*tanh(sqrt(2)*(-A_1.*t.*sin(B_1.*x) - A_2.*sin(B_2.*x + C_2.*t) + y - 1/4)./(2*sqrt(kappa))) + sqrt(2)*kappa.*(-A_1.*B_1.^2.*t.*sin(B_1.*x) - A_2.*B_2.^2.*sin(B_2.*x + C_2.*t)) - sqrt(2)*(A_1.*sin(B_1.*x) + A_2.*C_2.*cos(B_2.*x + C_2.*t))).*sech(sqrt(2)*(-A_1.*t.*sin(B_1.*x) - A_2.*sin(B_2.*x + C_2.*t) + y - 1/4)./(2*sqrt(kappa))).^2./(4*sqrt(kappa));\n", "\n", "end\n", "\n" @@ -862,8 +1137,8 @@ "code = \\\n", "codegen([(\"alpha\", alpha),\n", " (\"eta\", eta),\n", - " (\"eta0\", eta),\n", - " (\"S\", S)],\n", + " (\"eta0\", eta0),\n", + " (\"S\", source)],\n", " language=\"octave\",\n", " project=\"PFHub\")\n", "\n", @@ -876,7 +1151,7 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -912,5 +1187,5 @@ } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/benchmarks/benchmark7.ipynb.raw.html b/benchmarks/benchmark7.ipynb.raw.html index 5e638ea69..7271011f2 100644 --- a/benchmarks/benchmark7.ipynb.raw.html +++ b/benchmarks/benchmark7.ipynb.raw.html @@ -26,13 +26,14 @@ -
+
@@ -158,7 +159,7 @@

Benchmark Problem 7: MMS Allen-Cahn
-
In [1]:
+
In [4]:
from IPython.display import HTML
@@ -176,7 +177,7 @@ 

Benchmark Problem 7: MMS Allen-Cahn
-
Out[1]:
+
Out[4]:
@@ -243,7 +244,7 @@

Governing equation and man \alpha(x,t) = \frac{1}{4} + A_1 t \sin\left(B_1 x \right) + A_2 \sin \left(B_2 x + C_2 t \right) \end{equation}$$

where $A_1$, $B_1$, $A_2$, $B_2$, and $C_2$ are constant parameters.

-

This manufactured solution is an equilbrium solution of the governing equation, when $S(x,y,t)=0$ and $\alpha(x,t)$ is constant. The closeness of this manufactured solution to a solution of the nominal governing equation increases the likihood that the behavior of simulation codes when solving this benchmark problem is representive of the solution of the regular Allen-Cahn equation (i.e. without the source term). The form of $\alpha(x,t)$ was chosen to yield complex behavior while still retaining a (somewhat) simple functional form. The two spatial sinusoidal terms introduce two controllable length scales to the interfacial shape. Summing them gives a "beat" pattern with a period longer than the period of either individual term, permitting a domain size that is larger than the wavelength of the sinusoids without a repeating pattern. The temporal sinusoidal term introduces a controllable time scale to the interfacial shape in addition to the phase transformation time scale, while the linear temporal dependence of the other term ensures that the sinusoidal term can go through multiple periods without $\eta_{sol}$ repeating itself.

+

This manufactured solution is an equilbrium solution of the governing equation, when $S(x,y,t)=0$ and $\alpha(x,t)$ is constant. The closeness of this manufactured solution to a solution of the nominal governing equation increases the likihood that the behavior of simulation codes when solving this benchmark problem is representive of the solution of the regular Allen-Cahn equation (i.e. without the source term). The form of $\alpha(x,t)$ was chosen to yield complex behavior while still retaining a (somewhat) simple functional form. The two spatial sinusoidal terms introduce two controllable length scales to the interfacial shape. Summing them gives a "beat" pattern with a period longer than the period of either individual term, permitting a domain size that is larger than the wavelength of the sinusoids without a repeating pattern. The temporal sinusoidal term introduces a controllable time scale to the interfacial shape in addition to the phase transformation time scale, while the linear temporal dependence of the other term ensures that the sinusoidal term can go through multiple periods without $\eta_{\mathrm{sol}}$ repeating itself.

Inserting the manufactured solution into the governing equation and solving for $S(x,y,t)$ yields:

$$\begin{equation} S(x,y,t) = \frac{\text{sech}^2 \left[ \frac{y-\alpha(x,t)}{\sqrt{2 \kappa}} \right]}{4 \sqrt{\kappa}} \left[-2\sqrt{\kappa} \tanh \left[\frac{y-\alpha(x,t)}{\sqrt{2 \kappa}} \right] \left(\frac{\partial \alpha(x,t)}{\partial x} \right)^2+\sqrt{2} \left[ \frac{\partial \alpha(x,t)}{\partial t}-\kappa \frac{\partial^2 \alpha(x,t)}{\partial x^2} \right] \right] @@ -258,7 +259,8 @@

Governing equation and man

$$\begin{equation} \frac{\partial \alpha(x,t)}{\partial t} = A_1 \sin\left(B_1 x\right) + A_2 C_2 \cos \left(B_2 x + C_2 t \right) \end{equation}$$

-

N.B.: Don't transcribe these equations. Please download the appropriate files from the Appendix .

+

N.B.: Don't transcribe these equations. Please download the appropriate files from the Appendix.

+

@@ -267,13 +269,13 @@

Governing equation and man

-

Domain geometry, boundary conditions, initial conditions, and stopping condition

The domain geometry is a rectangle that spans [0, 1] in $x$ and [0, 0.5] in $y$. This elongated domain was chosen to allow multiple peaks and valleys in $\eta_{sol}$ without stretching the interface too much in the $y$ direction (which causes the thickness of the interface to change) or having large regions where $\eta_{sol}$ never deviates from 0 or 1. Periodic boundary conditions are applied along the $x = 0$ and the $x = 1$ boundaries to accomodate the periodicity of $\alpha(x,t)$. Dirichlet boundary conditions of $\eta$ = 1 and $\eta$ = 0 are applied along the $y = 0$ and the $y = 0.5$ boundaries, respectively. These boundary conditions are chosen to be consistent with $\eta_{sol}(x,y,t)$. The initial condition is the manufactured solution at $t = 0$:

+

Domain geometry, boundary conditions, initial conditions, and stopping condition

The domain geometry is a rectangle that spans [0, 1] in $x$ and [0, 0.5] in $y$. This elongated domain was chosen to allow multiple peaks and valleys in $\eta_{\mathrm{sol}}$ without stretching the interface too much in the $y$ direction (which causes the thickness of the interface to change) or having large regions where $\eta_{\mathrm{sol}}$ never deviates from 0 or 1. Periodic boundary conditions are applied along the $x = 0$ and the $x = 1$ boundaries to accomodate the periodicity of $\alpha(x,t)$. Dirichlet boundary conditions of $\eta$ = 1 and $\eta$ = 0 are applied along the $y = 0$ and the $y = 0.5$ boundaries, respectively. These boundary conditions are chosen to be consistent with $\eta_{\mathrm{sol}}(x,y,t)$. The initial condition is the manufactured solution at $t = 0$:

$$ \begin{equation} -\eta_{sol}(x,y,0) = \frac{1}{2}\left[ 1 - \tanh\left( \frac{y-\left(\frac{1}{4}+A_2 \sin(B_2 x) \right)}{\sqrt{2 \kappa}} \right) \right] +\eta_{\mathrm{sol}}(x,y,0) = \frac{1}{2}\left[ 1 - \tanh\left( \frac{y-\left(\frac{1}{4}+A_2 \sin(B_2 x) \right)}{\sqrt{2 \kappa}} \right) \right] \end{equation} $$

-

The stopping condition for all calculations is when t = 8 time units, which was chosen to let $\alpha(x,t)$ evolve substantially, while still being slower than the characteristic time for the phase evolution (determined by the CFL condition for a uniform mesh with a reasonable level of resolution of $\eta_{sol}$).

+

The stopping condition for all calculations is when t = 8 time units, which was chosen to let $\alpha(x,t)$ evolve substantially, while still being slower than the characteristic time for the phase evolution (determined by the CFL condition for a uniform mesh with a reasonable level of resolution of $\eta_{\mathrm{sol}}$).

@@ -336,9 +338,9 @@

Benchmark simulation instructionsPart (a)

The objective of this test is to verify the accuracy of your simulation code in both time and space. Here, we make use of convergence tests, where either the mesh size (or grid point spacing) or the time step size is systematically changed to determine the response of the error to these quantities. Once a convergence test is completed the order of accuracy can be calculated from the result. The order of accuracy can be compared to the theoretical order of accuracy for the numerical method employed in the simulation. If the two match (to a reasonable degree), then one can be confident that the simulation code is working as expected. The remainder of this subsection will give instructions for convergence tests for this MMS problem.

Implement the MMS problem specified above using the simulation code of your choice. Perform a spatial convergence test by running the simulation for a variety of mesh sizes. For each simulation, determine the discrete $L_2$ norm of the error at $t=8$:

$$\begin{equation} - L_2 = \sqrt{\sum\limits_{x,y}\left(\eta^{t=8}_{x,y} - \eta_{sol}(x,y,8)\right)^2 \Delta x \Delta y} + L_2 = \sqrt{\sum\limits_{x,y}\left(\eta^{t=8}_{x,y} - \eta_{\mathrm{sol}}(x,y,8)\right)^2 \Delta x \Delta y} \end{equation}$$

-

For all of these simulations, verify that the time step is small enough that any temporal error is much smaller that the total error. This can be accomplished by decreasing the time step until it has minimal effect on the error. Ensure that at least three simulation results have $L_2$ errors in the range $[5\times10^{-3}, 1\times10^{-4}]$, attempting to cover as much of that range as possible/practical. This maximum and minimum errors in the range roughly represent a poorly resolved simulation and a very well-resolved simulation.

+

For all of these simulations, verify that the time step is small enough that any temporal error is much smaller that the total error. This can be accomplished by decreasing the time step until it has minimal effect on the error. Ensure that at least three simulation results have $L_2$ errors in the range $[1 \times 10^{-4}, 5 \times 10^{-3}]$, attempting to cover as much of that range as possible/practical. This maximum and minimum errors in the range roughly represent a poorly resolved simulation and a very well-resolved simulation.

Save the effective element size, $h$, and the $L_2$ error for each simulation. Archive this data in a CSV or JSON file, using one column (or key) each for $h$ and $L_2$. @@ -346,13 +348,13 @@

Part (a)

submit your results on the PFHub website as a 2D data set with the effective mesh size as the x-axis column and the $L_2$ error as the y-axis column.

+5% of the elements. Then submit your results on the PFHub website as a 2D data set with the effective mesh size as the $x$-axis column and the $L_2$ error as the $y$-axis column.

Next, confirm that the observed order of accuracy is approximately equal to the expected value. Calculate the order of accuracy, $p$, with a least squares fit of the following function:

$$\begin{equation} \log(E)=p \log(R) + b \end{equation}$$

-

where $E$ is the $L_2$ error, $R$ is the effective element size, and b is an intercept. Deviations of ±0.2 or more from the theoretical value are to be expected (depending on the range of errors considered and other factors).

-

Finally, perform a similar convergence test, but for the time step, systematically changing the time step and recording the $L_2$ error. Use a time step that does not vary over the course of any single simulation. Verify that the spatial discretization error is small enough that it does not substantially contribute to the total error. Once again, ensure that at least three simulations have $L_2$ errors in the range $[5\times10^{-3}, 1\times10^{-4}]$, attempting to cover as much of that range as possible/practical. Archive the effective mesh size and $L_2$ error for each individual simulation in a CSV or JSON file. Submit your results to the PFHub website as a 2D data set with the time step size as the x-axis column and the $L_2$ error as the y-axis column. Confirm that the observed order of accuracy is approximately equal to the expected value.

+

where $E$ is the $L_2$ error, $R$ is the effective element size, and b is an intercept. Deviations of $\pm 0.2$ or more from the theoretical value are to be expected (depending on the range of errors considered and other factors).

+

Finally, perform a similar convergence test, but for the time step, systematically changing the time step and recording the $L_2$ error. Use a time step that does not vary over the course of any single simulation. Verify that the spatial discretization error is small enough that it does not substantially contribute to the total error. Once again, ensure that at least three simulations have $L_2$ errors in the range $[1\times10^{-4}, 5\times10^{-3}]$, attempting to cover as much of that range as possible/practical. Archive the effective mesh size and $L_2$ error for each individual simulation in a CSV or JSON file. Submit your results to the PFHub website as a 2D data set with the time step size as the $x$-axis column and the $L_2$ error as the $y$-axis column. Confirm that the observed order of accuracy is approximately equal to the expected value.

@@ -361,9 +363,9 @@

Part (a)

-

Part (b)

Now that your code has been verified in (a), the objective of this part is to determine the computational performance of your code at various levels of error. These results can then be used to objectively compare the performance between codes or settings within the same code. To make the problem more computationally demanding and stress solvers more than in (a), decrease $\kappa$ by a factor of $256$ to $1.5625\times10^{-6}$. This change will reduce the interfacial thickness by a factor of $16$.

-

Run a series of simulations, attempting to optimize solver parameters (mesh, time step, tolerances, etc.) to minimize the required computational resources for at least three levels of $L_2$ error in range $[5\times10^{-3}, 1\times10^{-5}]$. Use the same CPU and processor type for all simulations. For the best of these simulations, save the wall time (in seconds), number of computing cores, normalized computing cost (wall time in seconds $\times$ number of cores $\times$ nominal core speed $/$ 2 GHz), maximum memory usage, and $L_2$ error at $t=8$ for each individual simulation. Archive this data in a -CSV or JSON file with one column (or key) for each of the quantities mentioned above. Submit your results to the PFHub website as two 2D data sets. For the first data set use the $L_2$ error as the x-axis column and the normalized computational cost as the y-axis column. For the second data set, use the $L_2$ error as the x-axis column and the wall time as the y-axis column.

+

Part (b)

Now that your code has been verified in (a), the objective of this part is to determine the computational performance of your code at various levels of error. These results can then be used to objectively compare the performance between codes or settings within the same code. To make the problem more computationally demanding and stress solvers more than in (a), decrease $\kappa$ by a factor of $256$ to $1.5625 \times 10^{-6}$. This change will reduce the interfacial thickness by a factor of $16$.

+

Run a series of simulations, attempting to optimize solver parameters (mesh, time step, tolerances, etc.) to minimize the required computational resources for at least three levels of $L_2$ error in range $[1 \times 10^{-5}, 5 \times 10^{-3}]$. Use the same CPU and processor type for all simulations. For the best of these simulations, save the wall time (in seconds), number of computing cores, normalized computing cost (wall time in seconds $\times$ number of cores $\times$ nominal core speed $/$ 2 GHz), maximum memory usage, and $L_2$ error at $t=8$ for each individual simulation. Archive this data in a +CSV or JSON file with one column (or key) for each of the quantities mentioned above. Submit your results to the PFHub website as two 2D data sets. For the first data set use the $L_2$ error as the $x$-axis column and the normalized computational cost as the $y$-axis column. For the second data set, use the $L_2$ error as the $x$-axis column and the wall time as the $y$-axis column.

@@ -382,7 +384,7 @@

Part (c)

-

Submission Guidelines

Part (a) Guidelines

Two data items are required in the "Data Files" section of the upload form. The data items should be labeled as spatial and temporal in the Short name of data box. The 2D radio button should be checked and the columns corresponding to the x-axis (either $\Delta t$ or $\Delta x$) and the y-axis ($e_{L2}$) should be labeled correctly for each CSV file. The CSV file for the spatial data should have the form

+

Submission Guidelines

Part (a) Guidelines

Two data items are required in the "Data Files" section of the upload form. The data items should be labeled as spatial and temporal in the Short name of data box. The 2D radio button should be checked and the columns corresponding to the $x$-axis (either $\Delta t$ or $\Delta x$) and the $y$-axis ($e_{L2}$) should be labeled correctly for each CSV file. The CSV file for the spatial data should have the form

mesh_size,L2_error
 0.002604167,2.55E-06
@@ -394,7 +396,7 @@ 

Submission Guidelines

-

Parts (b) and (c) Guidelines

Two data items are required in the "Data Files" section of the upload form. The data items should be labeled as cost and time in the Short name of data box. The 2D radio button should be checked and the columns corresponding to the x-axis ($e_{L2}$) and the y-axis (either $F_{\text{cost}}$ or $t_{\text{wall}}$) should be labeled correctly for each CSV file. The CSV file for the cost data should have the form

+

Parts (b) and (c) Guidelines

Two data items are required in the "Data Files" section of the upload form. The data items should be labeled as cost and time in the Short name of data box. The 2D radio button should be checked and the columns corresponding to the $x$-axis ($e_{L2}$) and the $y$-axis (either $F_{\text{cost}}$ or $t_{\text{wall}}$) should be labeled correctly for each CSV file. The CSV file for the cost data should have the form

cores,wall_time,memory,error,cost
 1,1.35,25800,0.024275131,1.755
@@ -427,7 +429,7 @@ 

Feedback

-

Appendix

Computer algebra systems

Rigorous verification of software frameworks using MMS requires posing the equation and manufacturing the solution with as much complexity as possible. This can be straight-forward, but interesting equations produce complicated source terms. To streamline the MMS workflow, it is strongly recommended that you use a CAS such as SymPy, Maple, or Mathematica to generate source equations and turn it into executable code automatically. For accessibility, we will use SymPy, but so long as vector calculus is supported, CAS will do.

+

Appendix

Computer algebra systems

Rigorous verification of software frameworks using MMS requires posing the equation and manufacturing the solution with as much complexity as possible. This can be straight-forward, but interesting equations produce complicated source terms. To streamline the MMS workflow, it is strongly recommended that you use a CAS such as SymPy, Maple, or Mathematica to generate source equations and turn it into executable code automatically. For accessibility, we will use SymPy, but so long as vector calculus is supported, any CAS will do.

@@ -447,42 +449,65 @@

Source term
# Sympy code to generate expressions for PFHub Problem 7 (MMS)
 
-from sympy import symbols, simplify
-from sympy import sin, cos, cosh, tanh, sqrt
-from sympy.physics.vector import divergence, gradient, ReferenceFrame, time_derivative
+from sympy import sin, cos, cosh, sech, tanh, sqrt, symbols
+from sympy import Rational, diff, expand, simplify
+from sympy import Eq, Function, init_printing
+from sympy.abc import x, y, t
+from sympy.physics.vector import ReferenceFrame, divergence, gradient, time_derivative
 from sympy.utilities.codegen import codegen
-from sympy.abc import kappa, S, x, y, t
-
-# Spatial coordinates: x=R[0], y=R[1], z=R[2]
-R = ReferenceFrame('R')
-
-# sinusoid amplitudes
-A1, A2 = symbols('A1 A2')
-B1, B2 = symbols('B1 B2')
-C2 = symbols('C2')
-
-# Define interface offset (alpha)
-alpha = 0.25 + A1 * t * sin(B1 * R[0]) \
-             + A2     * sin(B2 * R[0] + C2 * t)
-
-# Define the solution equation (eta)
-eta = 0.5 * (1 - tanh((R[1] - alpha) / sqrt(2*kappa)))
-
-# Compute the source term from the equation of motion
-source = simplify(time_derivative(eta, R)
-             + 4 * eta * (eta - 1) * (eta - 1/2)
-             - kappa * divergence(gradient(eta, R), R))
-
-# Replace R[i] with (x, y)
-alpha = alpha.subs({R[0]: x, R[1]: y})
-eta = eta.subs({R[0]: x, R[1]: y})
-eta0 = eta.subs(t, 0)
-source = source.subs({R[0]: x, R[1]: y})
-
-print("alpha =", alpha, "\n")
-print("eta =", eta,     "\n")
-print("eta0 =", eta0,  "\n")
-print("S =", source)
+
+init_printing()
+
+R = ReferenceFrame("R")  # spatial coords
+X = R[0]
+Y = R[1]
+
+A1, A2 = symbols("A_1 A_2",   real=True)
+B1, B2 = symbols("B_1 B_2",   real=True)
+C2, κ  = symbols("C_2 kappa", real=True)
+
+# Define α symbolically to simplify the expressions for visual comparison
+
+α = Function("alpha", real=True)(X, t)
+ψ = (Y - α) / sqrt(2 * κ)
+η = (1 - tanh(ψ)) / 2
+
+source = time_derivative(η, R) \
+       + 4 * η * (η - 1) * (η - Rational(1, 2)) \
+       - divergence(κ * gradient(η, R), R)
+
+# Nested `simplify` calls to incorporate the hyperbolic trig
+# identity, which is not implemented in SymPy
+        
+S = simplify(
+        expand(
+            simplify(
+                expand(source)
+            ).subs({cosh(ψ)**2: 1 / sech(ψ)**2})
+        )
+)
+
+ +
+

+
+ +
+
+
+
+
+

Compare the generated expressions for $S(x, y, \alpha)$, $\alpha$, and the derivatives of $\alpha$:

+ +
+
+
+
+ +
+
+
In [7]:
+
+
+
alpha = Rational(1, 4) + A1 * t * sin(B1 * X) + A2 * sin(B2 * X + C2 * t)
+Eq(symbols("alpha"), alpha.subs({X: x, Y: y}))
+
+ +
+
+
+ +
+
+ + +
+ +
Out[7]:
+ + + + +
+$\displaystyle \alpha = A_{1} t \sin{\left(B_{1} x \right)} + A_{2} \sin{\left(B_{2} x + C_{2} t \right)} + \frac{1}{4}$ +
+ +
+ +
+
+ +
+
+
+
In [8]:
+
+
+
alpha_t  = simplify(expand(diff(alpha, t)))
+
+Eq(diff(α, t).subs({X: x, Y: y}), alpha_t.subs({X: x, Y: y}))
+
-S = -(tanh(sqrt(2)*(A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) - y + 0.25)/(2*sqrt(kappa)))**2 - 1)*(0.5*sqrt(kappa)*((A1*B1*t*cos(B1*x) + A2*B2*cos(B2*x + C2*t))**2 + 1)*tanh(sqrt(2)*(A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) - y + 0.25)/(2*sqrt(kappa))) - 0.5*sqrt(kappa)*tanh(sqrt(2)*(A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) - y + 0.25)/(2*sqrt(kappa))) + 0.25*sqrt(2)*kappa*(A1*B1**2*t*sin(B1*x) + A2*B2**2*sin(B2*x + C2*t)) + 0.25*sqrt(2)*(A1*sin(B1*x) + A2*C2*cos(B2*x + C2*t)))/sqrt(kappa) -
+
+
+ +
+
+ + +
+ +
Out[8]:
+ + + + +
+$\displaystyle \frac{\partial}{\partial t} \alpha{\left(x,t \right)} = A_{1} \sin{\left(B_{1} x \right)} + A_{2} C_{2} \cos{\left(B_{2} x + C_{2} t \right)}$ +
+
+
+
+
+
In [9]:
+
+
+
alpha_x  = simplify(expand(diff(alpha, X)))
+
+Eq(diff(α, X).subs({X: x, Y: y}), alpha_x.subs({X: x, Y: y}))
+
+ +
+
+
+ +
+
+ + +
+ +
Out[9]:
+ + + + +
+$\displaystyle \frac{\partial}{\partial x} \alpha{\left(x,t \right)} = A_{1} B_{1} t \cos{\left(B_{1} x \right)} + A_{2} B_{2} \cos{\left(B_{2} x + C_{2} t \right)}$ +
+ +
+ +
+
+ +
+
+
+
In [10]:
+
+
+
alpha_xx = simplify(expand(diff(alpha, X, 2)))
+
+Eq(diff(α, X, X).subs({X: x, Y: y}), alpha_xx.subs({X: x, Y: y}))
+
+ +
+
+
+ +
+
+ + +
+ +
Out[10]:
+ + + + +
+$\displaystyle \frac{\partial^{2}}{\partial x^{2}} \alpha{\left(x,t \right)} = - A_{1} B_{1}^{2} t \sin{\left(B_{1} x \right)} - A_{2} B_{2}^{2} \sin{\left(B_{2} x + C_{2} t \right)}$ +
+ +
+ +
+
+ +
+
+
+
In [11]:
+
+
+
eta = simplify(η.subs({R[0]: x, R[1]: y, α: alpha.subs({R[0]: x, R[1]: y})}))
+
+ +
+
+
+ +
+
+
+
In [12]:
+
+
+
eta0 = simplify(eta.subs({t: 0, α: alpha.subs({R[0]: x, R[1]: y, t: 0})}))
+
+ +
+
+
+ +
+
+
+
In [13]:
+
+
+
source = S.subs(
+    {
+        α: alpha,
+        diff(α, t):    alpha_t,
+        diff(α, X):    alpha_x,
+        diff(α, X, 2): alpha_xx
+    }
+).subs({X: x, Y: y})
+
+alpha = alpha.subs({X: x, Y: y})
+eta = eta.subs({X: x, Y: y})
+eta0 = eta0.subs({X: x, Y: y})
+
+ +
+
+
+
-

Python

Copy the first cell under Source Term directly into your program. -For a performance boost, convert the expressions into lambda functions:

-
from sympy.utilities.lambdify import lambdify
-
-apy = lambdify([x, y], alpha, modules='sympy')
-epy = lambdify([x, y], eta,   modules='sympy')
-ipy = lambdify([x, y], eta0,  modules='sympy')
-Spy = lambdify([x, y], S,     modules='sympy')
+

Python

Substituting the expression for $\alpha$ into $S(x, y, \alpha)$, the Python code for the full source term $S(x, y, t)$ is

+ +
+
+
+
+
+
In [14]:
+
+
+
print("S =", source)
 
-

Note: Click "Code Toggle" at the top of the page to see the Python expressions.

-
+
+ +
+
+ + +
+ +
+ + +
+
S = -(2*sqrt(kappa)*(A_1*B_1*t*cos(B_1*x) + A_2*B_2*cos(B_2*x + C_2*t))**2*tanh(sqrt(2)*(-A_1*t*sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 1/4)/(2*sqrt(kappa))) + sqrt(2)*kappa*(-A_1*B_1**2*t*sin(B_1*x) - A_2*B_2**2*sin(B_2*x + C_2*t)) - sqrt(2)*(A_1*sin(B_1*x) + A_2*C_2*cos(B_2*x + C_2*t)))*sech(sqrt(2)*(-A_1*t*sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 1/4)/(2*sqrt(kappa)))**2/(4*sqrt(kappa))
+
+
+
+ +
+
+ +
+
+
+
In [15]:
+
+
+
print("α =", alpha)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
α = A_1*t*sin(B_1*x) + A_2*sin(B_2*x + C_2*t) + 1/4
+
+
+
+ +
+
+ +
+
+
+
In [16]:
+
+
+
print("η =", eta)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
η = tanh(sqrt(2)*(4*A_1*t*sin(B_1*x) + 4*A_2*sin(B_2*x + C_2*t) - 4*y + 1)/(8*sqrt(kappa)))/2 + 1/2
+
+
+
+ +
+
+ +
+
+
+
In [17]:
+
+
+
print("η₀ =", eta0)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
η₀ = tanh(sqrt(2)*(4*A_2*sin(B_2*x) - 4*y + 1)/(8*sqrt(kappa)))/2 + 1/2
+
+
+
+ +
+
+
@@ -551,14 +875,14 @@

C

-
In [6]:
+
In [18]:
[(c_name, code), (h_name, header)] = \
 codegen([("alpha", alpha),
          ("eta",   eta),
-         ("eta0",  eta),
-         ("S",     S)],
+         ("eta0",  eta0),
+         ("S",     source)],
          language="C",
          prefix="manufactured",
          project="PFHub")
@@ -585,7 +909,7 @@ 

C

manufactured.h:
 
 /******************************************************************************
- *                       Code generated with sympy 1.2                        *
+ *                      Code generated with SymPy 1.11.1                      *
  *                                                                            *
  *              See http://www.sympy.org/ for more information.               *
  *                                                                            *
@@ -596,10 +920,10 @@ 

C

#ifndef PFHUB__MANUFACTURED__H #define PFHUB__MANUFACTURED__H -double alpha(double A1, double A2, double B1, double B2, double C2, double t, double x); -double eta(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y); -double eta0(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y); -double S(double S); +double alpha(double A_1, double A_2, double B_1, double B_2, double C_2, double t, double x); +double eta(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y); +double eta0(double A_2, double B_2, double kappa, double x, double y); +double S(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y); #endif @@ -608,7 +932,7 @@

C

manufactured.c: /****************************************************************************** - * Code generated with sympy 1.2 * + * Code generated with SymPy 1.11.1 * * * * See http://www.sympy.org/ for more information. * * * @@ -617,34 +941,34 @@

C

#include "manufactured.h" #include <math.h> -double alpha(double A1, double A2, double B1, double B2, double C2, double t, double x) { +double alpha(double A_1, double A_2, double B_1, double B_2, double C_2, double t, double x) { double alpha_result; - alpha_result = A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) + 0.25; + alpha_result = A_1*t*sin(B_1*x) + A_2*sin(B_2*x + C_2*t) + 1.0/4.0; return alpha_result; } -double eta(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y) { +double eta(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y) { double eta_result; - eta_result = -0.5*tanh((1.0/2.0)*M_SQRT2*(-A1*t*sin(B1*x) - A2*sin(B2*x + C2*t) + y - 0.25)/sqrt(kappa)) + 0.5; + eta_result = (1.0/2.0)*tanh((1.0/8.0)*M_SQRT2*(4*A_1*t*sin(B_1*x) + 4*A_2*sin(B_2*x + C_2*t) - 4*y + 1)/sqrt(kappa)) + 1.0/2.0; return eta_result; } -double eta0(double A1, double A2, double B1, double B2, double C2, double kappa, double t, double x, double y) { +double eta0(double A_2, double B_2, double kappa, double x, double y) { double eta0_result; - eta0_result = -0.5*tanh((1.0/2.0)*M_SQRT2*(-A1*t*sin(B1*x) - A2*sin(B2*x + C2*t) + y - 0.25)/sqrt(kappa)) + 0.5; + eta0_result = (1.0/2.0)*tanh((1.0/8.0)*M_SQRT2*(4*A_2*sin(B_2*x) - 4*y + 1)/sqrt(kappa)) + 1.0/2.0; return eta0_result; } -double S(double S) { +double S(double A_1, double A_2, double B_1, double B_2, double C_2, double kappa, double t, double x, double y) { double S_result; - S_result = S; + S_result = -1.0/4.0*(2*sqrt(kappa)*pow(A_1*B_1*t*cos(B_1*x) + A_2*B_2*cos(B_2*x + C_2*t), 2)*tanh((1.0/2.0)*M_SQRT2*(-A_1*t*sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 1.0/4.0)/sqrt(kappa)) + M_SQRT2*kappa*(-A_1*pow(B_1, 2)*t*sin(B_1*x) - A_2*pow(B_2, 2)*sin(B_2*x + C_2*t)) - M_SQRT2*(A_1*sin(B_1*x) + A_2*C_2*cos(B_2*x + C_2*t)))*pow(1.0/((1.0/2.0)*exp((1.0/2.0)*M_SQRT2*((1.0/2.0)*I*A_1*t*(exp(I*B_1*x) - exp(-I*B_1*x)) + (1.0/2.0)*I*A_2*(-exp(I*(-B_2*x - C_2*t)) + exp(I*(B_2*x + C_2*t))) + y - 1.0/4.0)/sqrt(kappa)) + (1.0/2.0)*exp(-1.0/2.0*M_SQRT2*((1.0/2.0)*I*A_1*t*(exp(I*B_1*x) - exp(-I*B_1*x)) + (1.0/2.0)*I*A_2*(-exp(I*(-B_2*x - C_2*t)) + exp(I*(B_2*x + C_2*t))) + y - 1.0/4.0)/sqrt(kappa))), 2)/sqrt(kappa); return S_result; } @@ -667,14 +991,14 @@

Fortran

-
In [7]:
+
In [19]:
[(f_name, code), (f_name, header)] = \
 codegen([("alpha", alpha),
          ("eta",   eta),
-         ("eta0",  eta),
-         ("S",     S)],
+         ("eta0",  eta0),
+         ("S",     source)],
          language="f95",
          prefix="manufactured",
          project="PFHub")
@@ -700,66 +1024,83 @@ 

Fortran

manufactured.f:
 
 !******************************************************************************
-!*                       Code generated with sympy 1.2                        *
+!*                      Code generated with SymPy 1.11.1                      *
 !*                                                                            *
 !*              See http://www.sympy.org/ for more information.               *
 !*                                                                            *
 !*                        This file is part of 'PFHub'                        *
 !******************************************************************************
 
-REAL*8 function alpha(A1, A2, B1, B2, C2, t, x)
+REAL*8 function alpha(A_1, A_2, B_1, B_2, C_2, t, x)
 implicit none
-REAL*8, intent(in) :: A1
-REAL*8, intent(in) :: A2
-REAL*8, intent(in) :: B1
-REAL*8, intent(in) :: B2
-REAL*8, intent(in) :: C2
+REAL*8, intent(in) :: A_1
+REAL*8, intent(in) :: A_2
+REAL*8, intent(in) :: B_1
+REAL*8, intent(in) :: B_2
+REAL*8, intent(in) :: C_2
 REAL*8, intent(in) :: t
 REAL*8, intent(in) :: x
 
-alpha = A1*t*sin(B1*x) + A2*sin(B2*x + C2*t) + 0.25d0
+alpha = A_1*t*sin(B_1*x) + A_2*sin(B_2*x + C_2*t) + 1.0d0/4.0d0
 
 end function
 
-REAL*8 function eta(A1, A2, B1, B2, C2, kappa, t, x, y)
+REAL*8 function eta(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)
 implicit none
-REAL*8, intent(in) :: A1
-REAL*8, intent(in) :: A2
-REAL*8, intent(in) :: B1
-REAL*8, intent(in) :: B2
-REAL*8, intent(in) :: C2
+REAL*8, intent(in) :: A_1
+REAL*8, intent(in) :: A_2
+REAL*8, intent(in) :: B_1
+REAL*8, intent(in) :: B_2
+REAL*8, intent(in) :: C_2
 REAL*8, intent(in) :: kappa
 REAL*8, intent(in) :: t
 REAL*8, intent(in) :: x
 REAL*8, intent(in) :: y
 
-eta = -0.5d0*tanh(0.70710678118654752d0*kappa**(-0.5d0)*(-A1*t*sin(B1*x &
-      ) - A2*sin(B2*x + C2*t) + y - 0.25d0)) + 0.5d0
+eta = (1.0d0/2.0d0)*tanh(0.17677669529663688d0*kappa**(-0.5d0)*(4.0d0* &
+      A_1*t*sin(B_1*x) + 4.0d0*A_2*sin(B_2*x + C_2*t) - 4.0d0*y + 1.0d0 &
+      )) + 1.0d0/2.0d0
 
 end function
 
-REAL*8 function eta0(A1, A2, B1, B2, C2, kappa, t, x, y)
+REAL*8 function eta0(A_2, B_2, kappa, x, y)
 implicit none
-REAL*8, intent(in) :: A1
-REAL*8, intent(in) :: A2
-REAL*8, intent(in) :: B1
-REAL*8, intent(in) :: B2
-REAL*8, intent(in) :: C2
+REAL*8, intent(in) :: A_2
+REAL*8, intent(in) :: B_2
 REAL*8, intent(in) :: kappa
-REAL*8, intent(in) :: t
 REAL*8, intent(in) :: x
 REAL*8, intent(in) :: y
 
-eta0 = -0.5d0*tanh(0.70710678118654752d0*kappa**(-0.5d0)*(-A1*t*sin(B1*x &
-      ) - A2*sin(B2*x + C2*t) + y - 0.25d0)) + 0.5d0
+eta0 = (1.0d0/2.0d0)*tanh(0.17677669529663688d0*kappa**(-0.5d0)*(4.0d0* &
+      A_2*sin(B_2*x) - 4.0d0*y + 1.0d0)) + 1.0d0/2.0d0
 
 end function
 
-REAL*8 function S(S)
+REAL*8 function S(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)
 implicit none
-REAL*8, intent(in) :: S
+REAL*8, intent(in) :: A_1
+REAL*8, intent(in) :: A_2
+REAL*8, intent(in) :: B_1
+REAL*8, intent(in) :: B_2
+REAL*8, intent(in) :: C_2
+REAL*8, intent(in) :: kappa
+REAL*8, intent(in) :: t
+REAL*8, intent(in) :: x
+REAL*8, intent(in) :: y
 
-S = S
+S = -1.0d0/4.0d0*(2*sqrt(kappa)*(A_1*B_1*t*cos(B_1*x) + A_2*B_2*cos(B_2* &
+      x + C_2*t))**2*tanh(0.70710678118654752d0*kappa**(-0.5d0)*(-A_1*t &
+      *sin(B_1*x) - A_2*sin(B_2*x + C_2*t) + y - 0.25d0)) + sqrt(2.0d0) &
+      *kappa*(-A_1*B_1**2*t*sin(B_1*x) - A_2*B_2**2*sin(B_2*x + C_2*t &
+      )) - sqrt(2.0d0)*(A_1*sin(B_1*x) + A_2*C_2*cos(B_2*x + C_2*t)))* &
+      1d0/((1.0d0/2.0d0)*exp(0.70710678118654752d0*kappa**(-0.5d0)*( &
+      0.5d0*cmplx(0,1)*A_1*t*(exp(cmplx(0,1)*B_1*x) - exp(-cmplx(0,1)* &
+      B_1*x)) + 0.5d0*cmplx(0,1)*A_2*(-exp(cmplx(0,1)*(-B_2*x - C_2*t &
+      )) + exp(cmplx(0,1)*(B_2*x + C_2*t))) + y - 0.25d0)) + (1.0d0/ &
+      2.0d0)*exp(-0.70710678118654752d0*kappa**(-0.5d0)*(0.5d0*cmplx(0, &
+      1)*A_1*t*(exp(cmplx(0,1)*B_1*x) - exp(-cmplx(0,1)*B_1*x)) + 0.5d0 &
+      *cmplx(0,1)*A_2*(-exp(cmplx(0,1)*(-B_2*x - C_2*t)) + exp(cmplx(0, &
+      1)*(B_2*x + C_2*t))) + y - 0.25d0)))**2/sqrt(kappa)
 
 end function
 
@@ -781,14 +1122,14 @@ 

Julia

-
In [8]:
+
In [20]:
[(f_name, code)] = \
 codegen([("alpha", alpha),
          ("eta",   eta),
-         ("eta0",  eta),
-         ("S",     S)],
+         ("eta0",  eta0),
+         ("S",     source)],
          language="julia",
          prefix="manufactured",
          project="PFHub")
@@ -813,36 +1154,36 @@ 

Julia

manufactured.jl:
 
-#   Code generated with sympy 1.2
+#   Code generated with SymPy 1.11.1
 #
 #   See http://www.sympy.org/ for more information.
 #
 #   This file is part of 'PFHub'
 
-function alpha(A1, A2, B1, B2, C2, t, x)
+function alpha(A_1, A_2, B_1, B_2, C_2, t, x)
 
-    out1 = A1.*t.*sin(B1.*x) + A2.*sin(B2.*x + C2.*t) + 0.25
+    out1 = A_1 .* t .* sin(B_1 .* x) + A_2 .* sin(B_2 .* x + C_2 .* t) + 1 // 4
 
     return out1
 end
 
-function eta(A1, A2, B1, B2, C2, kappa, t, x, y)
+function eta(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)
 
-    out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5
+    out1 = tanh(sqrt(2) * (4 * A_1 .* t .* sin(B_1 .* x) + 4 * A_2 .* sin(B_2 .* x + C_2 .* t) - 4 * y + 1) ./ (8 * sqrt(kappa))) / 2 + 1 // 2
 
     return out1
 end
 
-function eta0(A1, A2, B1, B2, C2, kappa, t, x, y)
+function eta0(A_2, B_2, kappa, x, y)
 
-    out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5
+    out1 = tanh(sqrt(2) * (4 * A_2 .* sin(B_2 .* x) - 4 * y + 1) ./ (8 * sqrt(kappa))) / 2 + 1 // 2
 
     return out1
 end
 
-function S(S)
+function S(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)
 
-    out1 = S
+    out1 = -(2 * sqrt(kappa) .* (A_1 .* B_1 .* t .* cos(B_1 .* x) + A_2 .* B_2 .* cos(B_2 .* x + C_2 .* t)) .^ 2 .* tanh(sqrt(2) * (-A_1 .* t .* sin(B_1 .* x) - A_2 .* sin(B_2 .* x + C_2 .* t) + y - 1 // 4) ./ (2 * sqrt(kappa))) + sqrt(2) * kappa .* (-A_1 .* B_1 .^ 2 .* t .* sin(B_1 .* x) - A_2 .* B_2 .^ 2 .* sin(B_2 .* x + C_2 .* t)) - sqrt(2) * (A_1 .* sin(B_1 .* x) + A_2 .* C_2 .* cos(B_2 .* x + C_2 .* t))) .* sech(sqrt(2) * (-A_1 .* t .* sin(B_1 .* x) - A_2 .* sin(B_2 .* x + C_2 .* t) + y - 1 // 4) ./ (2 * sqrt(kappa))) .^ 2 ./ (4 * sqrt(kappa))
 
     return out1
 end
@@ -865,7 +1206,7 @@ 

Mathematica

-
In [9]:
+
In [21]:
-
In [10]:
+
In [22]:
code = \
 codegen([("alpha", alpha),
          ("eta",   eta),
-         ("eta0",  eta),
-         ("S",     S)],
+         ("eta0",  eta0),
+         ("S",     source)],
          language="octave",
          project="PFHub")
 
@@ -949,33 +1290,33 @@ 

Matlab

manufactured.nb:
 
 alpha.m
-function out1 = alpha(A1, A2, B1, B2, C2, t, x)
-  %ALPHA  Autogenerated by sympy
-  %   Code generated with sympy 1.2
+function out1 = alpha(A_1, A_2, B_1, B_2, C_2, t, x)
+  %ALPHA  Autogenerated by SymPy
+  %   Code generated with SymPy 1.11.1
   %
   %   See http://www.sympy.org/ for more information.
   %
   %   This file is part of 'PFHub'
 
-  out1 = A1.*t.*sin(B1.*x) + A2.*sin(B2.*x + C2.*t) + 0.25;
+  out1 = A_1.*t.*sin(B_1.*x) + A_2.*sin(B_2.*x + C_2.*t) + 1/4;
 
 end
 
-function out1 = eta(A1, A2, B1, B2, C2, kappa, t, x, y)
+function out1 = eta(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)
 
-  out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5;
+  out1 = tanh(sqrt(2)*(4*A_1.*t.*sin(B_1.*x) + 4*A_2.*sin(B_2.*x + C_2.*t) - 4*y + 1)./(8*sqrt(kappa)))/2 + 1/2;
 
 end
 
-function out1 = eta0(A1, A2, B1, B2, C2, kappa, t, x, y)
+function out1 = eta0(A_2, B_2, kappa, x, y)
 
-  out1 = -0.5*tanh(sqrt(2)*(-A1.*t.*sin(B1.*x) - A2.*sin(B2.*x + C2.*t) + y - 0.25)./(2*sqrt(kappa))) + 0.5;
+  out1 = tanh(sqrt(2)*(4*A_2.*sin(B_2.*x) - 4*y + 1)./(8*sqrt(kappa)))/2 + 1/2;
 
 end
 
-function out1 = S(S)
+function out1 = S(A_1, A_2, B_1, B_2, C_2, kappa, t, x, y)
 
-  out1 = S;
+  out1 = -(2*sqrt(kappa).*(A_1.*B_1.*t.*cos(B_1.*x) + A_2.*B_2.*cos(B_2.*x + C_2.*t)).^2.*tanh(sqrt(2)*(-A_1.*t.*sin(B_1.*x) - A_2.*sin(B_2.*x + C_2.*t) + y - 1/4)./(2*sqrt(kappa))) + sqrt(2)*kappa.*(-A_1.*B_1.^2.*t.*sin(B_1.*x) - A_2.*B_2.^2.*sin(B_2.*x + C_2.*t)) - sqrt(2)*(A_1.*sin(B_1.*x) + A_2.*C_2.*cos(B_2.*x + C_2.*t))).*sech(sqrt(2)*(-A_1.*t.*sin(B_1.*x) - A_2.*sin(B_2.*x + C_2.*t) + y - 1/4)./(2*sqrt(kappa))).^2./(4*sqrt(kappa));
 
 end