Skip to content
Snippets Groups Projects
Commit d8889e8b authored by Michael Kohlhase's avatar Michael Kohlhase
Browse files

draining

parent 4812fb43
No related branches found
No related tags found
No related merge requests found
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- needed for the MathML to render properly -->
<meta charset="UTF-8"/>
<title> Annotation Mockup</title>
<!-- include jQuery and our script -->
<script src="./js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="./js/annot.js" type="text/javascript"></script>
</head>
<body>
<div>
<h1>The Diffusion Equation -- Extract</h1>
<p>The equation is usually written as:</p>
<dl>
<dd>
<table cellpadding="5" style="border:2px solid #0073CF;background: #F5FFFA; text-align: center;">
<tr>
<td>
<p>
<span class="mwe-math-element">
<math xmlns="http://www.w3.org/1998/Math/MathML"
alttext="{\displaystyle {\frac {\partial \phi (\mathbf {r} ,t)}{\partial t}}=\nabla \cdot {\big [}D(\phi ,\mathbf {r} )\ \nabla \phi (\mathbf {r} ,t){\big ]},}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mrow data-dref="phirt">
<mi data-dref="phi">&#x03D5;<!-- ϕ --></mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold" data-dref="r">r</mi>
</mrow>
<mo>,</mo>
<mi data-dref="t">t</mi>
<mo stretchy="false">)</mo>
</mrow>
</mrow>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mi>t</mi>
</mrow>
</mfrac>
</mrow>
<mo>=</mo>
<mi mathvariant="normal" data-dref="nabla">&#x2207;<!-- ∇ --></mi>
<mo>&#x22C5;<!-- ⋅ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo maxsize="1.2em" minsize="1.2em">[</mo>
</mrow>
</mrow>
<mrow data-dref="Dphir">
<mi data-dref="D">D</mi>
<mo stretchy="false">(</mo>
<mi>&#x03D5;<!-- ϕ --></mi>
<mo>,</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">r</mi>
</mrow>
<mo stretchy="false">)</mo>
</mrow>
<mtext>&#xA0;</mtext>
<mi mathvariant="normal" data-dref="nabla">&#x2207;<!-- ∇ --></mi>
<mrow data-dref="phirt">
<mi data-dref="phi">&#x03D5;<!-- ϕ --></mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold" data-dref="r">r</mi>
</mrow>
<mo>,</mo>
<mi data-dref="t">t</mi>
<mo stretchy="false">)</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mo maxsize="1.2em" minsize="1.2em">]</mo>
</mrow>
</mrow>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\frac {\partial \phi (\mathbf {r} ,t)}{\partial t}}=\nabla \cdot {\big [}D(\phi ,\mathbf {r} )\ \nabla \phi (\mathbf {r} ,t){\big ]},}</annotation>
</semantics>
</math></span></p>
</td>
</tr>
</table>
</dd>
</dl>
<p>where <span data-decl="phi"><i>ϕ</i>(<b>r</b>, <i>t</i>) is the <a href="/wiki/Density"
title="Density">density</a> of the diffusing material <span data-decl="r"> at location <b>r</b></span>
and <span data-decl="t"> time <i>t</i></span></span> and
<span data-decl="Dphir"><i>D</i>(<i>ϕ</i>, <b>r</b>) is the collective <a
href="/wiki/Diffusion_coefficient" class="mw-redirect" title="Diffusion
coefficient">diffusion coefficient</a> for density <i>ϕ</i> at location <b>r</b></span>;
and <span data-decl="nabla">∇ represents the vector <a href="/wiki/Differential_operator" title="Differential operator">differential operator</a> <a href="/wiki/Del" title="Del">del</a></span>. If the diffusion coefficient depends on the density then the equation is nonlinear, otherwise it is linear.</p>
<p>More generally, when <span data-decl="D"><i>D</i> is a symmetric <a href="/wiki/Positive_definite_matrix" class="mw-redirect" title="Positive definite matrix">positive definite matrix</a></span>, the equation describes <a href="/wiki/Anisotropy" title="Anisotropy">anisotropic</a> diffusion, which is written (for three dimensional diffusion) as:</p>
<dl>
<dd>
<table cellpadding="5" style="border:2px solid #50C878;background: #ECFCF4; text-align: center;">
<tr>
<td>
<p><span class="mwe-math-element">
<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\frac {\partial \phi (\mathbf {r} ,t)}{\partial t}}=\sum _{i=1}^{3}\sum _{j=1}^{3}{\frac {\partial }{\partial x_{i}}}\left[D_{ij}(\phi ,\mathbf {r} ){\frac {\partial \phi (\mathbf {r} ,t)}{\partial x_{j}}}\right]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mrow data-dref="phirt">
<mi data-dref="phi">&#x03D5;<!-- ϕ --></mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold" data-dref="r">r</mi>
</mrow>
<mo>,</mo>
<mi data-dref="t">t</mi>
<mo stretchy="false">)</mo>
</mrow>
</mrow>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mi>t</mi>
</mrow>
</mfrac>
</mrow>
<mo>=</mo>
<munderover>
<mo>&#x2211;<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</munderover>
<munderover>
<mo>&#x2211;<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</munderover>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<msub>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
</mrow>
</mfrac>
</mrow>
<mrow>
<mo>[</mo>
<mrow>
<msub data-dref="D">
<mi>D</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mi>j</mi>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi>&#x03D5;<!-- ϕ --></mi>
<mo>,</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">r</mi>
</mrow>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mrow data-dref="phirt">
<mi data-dref="phi">&#x03D5;<!-- ϕ --></mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold" data-dref="r">r</mi>
</mrow>
<mo>,</mo>
<mi data-dref="t">t</mi>
<mo stretchy="false">)</mo>
</mrow>
</mrow>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<msub>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>j</mi>
</mrow>
</msub>
</mrow>
</mfrac>
</mrow>
</mrow>
<mo>]</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\frac {\partial \phi (\mathbf {r} ,t)}{\partial t}}=\sum _{i=1}^{3}\sum _{j=1}^{3}{\frac {\partial }{\partial x_{i}}}\left[D_{ij}(\phi ,\mathbf {r} ){\frac {\partial \phi (\mathbf {r} ,t)}{\partial x_{j}}}\right]}</annotation>
</semantics>
</math>
</span></p>
</td>
</tr>
</table>
</dd>
</dl>
<p>If <i>D</i> is constant, then the equation reduces to the following <a href="/wiki/Linear_differential_equation" title="Linear differential equation">linear differential equation</a>:</p>
<dl>
<dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\frac {\partial \phi (\mathbf {r} ,t)}{\partial t}}=D\nabla ^{2}\phi (\mathbf {r} ,t),}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mi>&#x03D5;<!-- ϕ --></mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">r</mi>
</mrow>
<mo>,</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
</mrow>
<mrow>
<mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
<mi>t</mi>
</mrow>
</mfrac>
</mrow>
<mo>=</mo>
<mi>D</mi>
<msup>
<mi mathvariant="normal">&#x2207;<!-- ∇ --></mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mi>&#x03D5;<!-- ϕ --></mi>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">r</mi>
</mrow>
<mo>,</mo>
<mi>t</mi>
<mo stretchy="false">)</mo>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\frac {\partial \phi (\mathbf {r} ,t)}{\partial t}}=D\nabla ^{2}\phi (\mathbf {r} ,t),}</annotation>
</semantics>
</math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7c223846a05763066b3ecbcda30bf3282438f573" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.005ex; width:23.155ex; height:5.843ex;" alt="{\frac {\partial \phi (\mathbf {r} ,t)}{\partial t}}=D\nabla ^{2}\phi (\mathbf {r} ,t)," /></span></dd>
</dl>
<p>also called the <a href="/wiki/Heat_equation" title="Heat equation">heat equation</a>.</p>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!-- needed for the MathML to render properly -->
<meta charset="UTF-8">
<title>
Annotation Mockup
</title>
</head>
<body>
<div>
<h1>The Diffusion Equation -- Extract</h1>
<p>The equation is usually written as:</p>
<p>
<!-- Wikipedia does not seem to output MathML Proper anymore, so this has been rendered using LaTeXML -->
<!--\frac{\partial\phi(\mathbf{r},t)}{\partial t} = \nabla \cdot \big[ D(\phi,\mathbf{r}) \ \nabla\phi(\mathbf{r},t) \big], -->
<table xmlns="http://www.w3.org/1999/xhtml" id="S0.Ex1" style="border:2px solid #0073CF;background: #F5FFFA; text-align: center;">
<tr class="ltx_equation ltx_eqn_row ltx_align_baseline">
<td class="ltx_eqn_cell ltx_eqn_center_padleft"></td>
<td class="ltx_eqn_cell ltx_align_center">
<math xmlns="http://www.w3.org/1998/Math/MathML" id="S0.Ex1.m1.1" class="ltx_Math" alttext="\frac{\partial\phi(\mathbf{r},t)}{\partial t}=\nabla\cdot\big{[}D(\phi,\mathbf%
{r})\ \nabla\phi(\mathbf{r},t)\big{]}" display="block"><semantics id="S0.Ex1.m1.1a"><mrow id="S0.Ex1.m1.1.21" xref="S0.Ex1.m1.1.21.cmml"><mfrac id="S0.Ex1.m1.1.1" xref="S0.Ex1.m1.1.1.cmml"><mrow id="S0.Ex1.m1.1.1.2" xref="S0.Ex1.m1.1.1.2.cmml"><mrow id="S0.Ex1.m1.1.1.2.9" xref="S0.Ex1.m1.1.1.2.9.cmml"><mo id="S0.Ex1.m1.1.1.2.1" xref="S0.Ex1.m1.1.1.2.1.cmml"></mo><mo id="S0.Ex1.m1.1.1.2.9a" xref="S0.Ex1.m1.1.1.2.9.cmml"></mo><mi id="S0.Ex1.m1.1.1.2.2" xref="S0.Ex1.m1.1.1.2.2.cmml">ϕ</mi></mrow><mo id="S0.Ex1.m1.1.1.2.8" xref="S0.Ex1.m1.1.1.2.8.cmml"></mo><mrow id="S0.Ex1.m1.1.1.2.10" xref="S0.Ex1.m1.1.1.2.10.1.cmml"><mo stretchy="false" id="S0.Ex1.m1.1.1.2.3">(</mo><mi id="S0.Ex1.m1.1.1.2.4" xref="S0.Ex1.m1.1.1.2.4.cmml">𝐫</mi><mo id="S0.Ex1.m1.1.1.2.5">,</mo><mi id="S0.Ex1.m1.1.1.2.6" xref="S0.Ex1.m1.1.1.2.6.cmml">t</mi><mo stretchy="false" id="S0.Ex1.m1.1.1.2.7">)</mo></mrow></mrow><mrow id="S0.Ex1.m1.1.1.3" xref="S0.Ex1.m1.1.1.3.cmml"><mo id="S0.Ex1.m1.1.1.3.1" xref="S0.Ex1.m1.1.1.3.1.cmml"></mo><mo id="S0.Ex1.m1.1.1.3a" xref="S0.Ex1.m1.1.1.3.cmml"></mo><mi id="S0.Ex1.m1.1.1.3.2" xref="S0.Ex1.m1.1.1.3.2.cmml">t</mi></mrow></mfrac><mo id="S0.Ex1.m1.1.2" xref="S0.Ex1.m1.1.2.cmml">=</mo><mrow id="S0.Ex1.m1.1.21.1" xref="S0.Ex1.m1.1.21.1.cmml"><mo id="S0.Ex1.m1.1.3" xref="S0.Ex1.m1.1.3.cmml"></mo><mo id="S0.Ex1.m1.1.4" xref="S0.Ex1.m1.1.4.cmml"></mo><mrow id="S0.Ex1.m1.1.21.1.1" xref="S0.Ex1.m1.1.21.1.1.1.cmml"><mo maxsize="120%" minsize="120%" id="S0.Ex1.m1.1.5" xref="S0.Ex1.m1.1.21.1.1.1.1.cmml">[</mo><mrow id="S0.Ex1.m1.1.21.1.1.2" xref="S0.Ex1.m1.1.21.1.1.1.cmml"><mi id="S0.Ex1.m1.1.6" xref="S0.Ex1.m1.1.6.cmml">D</mi><mo id="S0.Ex1.m1.1.21.1.1.2.1" xref="S0.Ex1.m1.1.21.1.1.2.1.cmml"></mo><mrow id="S0.Ex1.m1.1.21.1.1.2.2" xref="S0.Ex1.m1.1.21.1.1.2.2.1.cmml"><mo stretchy="false" id="S0.Ex1.m1.1.7">(</mo><mi id="S0.Ex1.m1.1.8" xref="S0.Ex1.m1.1.8.cmml">ϕ</mi><mo id="S0.Ex1.m1.1.9">,</mo><mi id="S0.Ex1.m1.1.10" xref="S0.Ex1.m1.1.10.cmml">𝐫</mi><mo rspace="7.5pt" stretchy="false" id="S0.Ex1.m1.1.11">)</mo></mrow><mo id="S0.Ex1.m1.1.21.1.1.2.1a" xref="S0.Ex1.m1.1.21.1.1.2.1.cmml"></mo><mrow id="S0.Ex1.m1.1.21.1.1.2.3" xref="S0.Ex1.m1.1.21.1.1.1.cmml"><mo id="S0.Ex1.m1.1.13" xref="S0.Ex1.m1.1.13.cmml"></mo><mo id="S0.Ex1.m1.1.21.1.1.2.3a"></mo><mi id="S0.Ex1.m1.1.14" xref="S0.Ex1.m1.1.14.cmml">ϕ</mi></mrow><mo id="S0.Ex1.m1.1.21.1.1.2.1b" xref="S0.Ex1.m1.1.21.1.1.2.1.cmml"></mo><mrow id="S0.Ex1.m1.1.21.1.1.2.4" xref="S0.Ex1.m1.1.21.1.1.2.4.1.cmml"><mo stretchy="false" id="S0.Ex1.m1.1.15">(</mo><mi id="S0.Ex1.m1.1.16" xref="S0.Ex1.m1.1.16.cmml">𝐫</mi><mo id="S0.Ex1.m1.1.17">,</mo><mi id="S0.Ex1.m1.1.18" xref="S0.Ex1.m1.1.18.cmml">t</mi><mo stretchy="false" id="S0.Ex1.m1.1.19">)</mo></mrow></mrow><mo maxsize="120%" minsize="120%" id="S0.Ex1.m1.1.20" xref="S0.Ex1.m1.1.21.1.1.1.1.cmml">]</mo></mrow></mrow></mrow><annotation-xml encoding="MathML-Content" id="S0.Ex1.m1.1b"><apply id="S0.Ex1.m1.1.21.cmml" xref="S0.Ex1.m1.1.21"><eq id="S0.Ex1.m1.1.2.cmml" xref="S0.Ex1.m1.1.2"/><apply id="S0.Ex1.m1.1.1.cmml" xref="S0.Ex1.m1.1.1"><divide id="S0.Ex1.m1.1.1.1.cmml"/><apply id="S0.Ex1.m1.1.1.2.cmml" xref="S0.Ex1.m1.1.1.2"><times id="S0.Ex1.m1.1.1.2.8.cmml" xref="S0.Ex1.m1.1.1.2.8"/><apply id="S0.Ex1.m1.1.1.2.9.cmml" xref="S0.Ex1.m1.1.1.2.9"><partialdiff id="S0.Ex1.m1.1.1.2.1.cmml" xref="S0.Ex1.m1.1.1.2.1"/><ci id="S0.Ex1.m1.1.1.2.2.cmml" xref="S0.Ex1.m1.1.1.2.2">italic-ϕ</ci></apply><interval closure="open" id="S0.Ex1.m1.1.1.2.10.1.cmml" xref="S0.Ex1.m1.1.1.2.10"><ci id="S0.Ex1.m1.1.1.2.4.cmml" xref="S0.Ex1.m1.1.1.2.4">𝐫</ci><ci id="S0.Ex1.m1.1.1.2.6.cmml" xref="S0.Ex1.m1.1.1.2.6">𝑡</ci></interval></apply><apply id="S0.Ex1.m1.1.1.3.cmml" xref="S0.Ex1.m1.1.1.3"><partialdiff id="S0.Ex1.m1.1.1.3.1.cmml" xref="S0.Ex1.m1.1.1.3.1"/><ci id="S0.Ex1.m1.1.1.3.2.cmml" xref="S0.Ex1.m1.1.1.3.2">𝑡</ci></apply></apply><apply id="S0.Ex1.m1.1.21.1.cmml" xref="S0.Ex1.m1.1.21.1"><ci id="S0.Ex1.m1.1.4.cmml" xref="S0.Ex1.m1.1.4"></ci><ci id="S0.Ex1.m1.1.3.cmml" xref="S0.Ex1.m1.1.3"></ci><apply id="S0.Ex1.m1.1.21.1.1.1.cmml" xref="S0.Ex1.m1.1.21.1.1"><csymbol cd="latexml" id="S0.Ex1.m1.1.21.1.1.1.1.cmml" xref="S0.Ex1.m1.1.5">delimited-[]</csymbol><apply id="S0.Ex1.m1.1.21.1.1.2.cmml" xref="S0.Ex1.m1.1.21.1.1"><times id="S0.Ex1.m1.1.21.1.1.2.1.cmml" xref="S0.Ex1.m1.1.21.1.1.2.1"/><ci id="S0.Ex1.m1.1.6.cmml" xref="S0.Ex1.m1.1.6">𝐷</ci><interval closure="open" id="S0.Ex1.m1.1.21.1.1.2.2.1.cmml" xref="S0.Ex1.m1.1.21.1.1.2.2"><ci id="S0.Ex1.m1.1.8.cmml" xref="S0.Ex1.m1.1.8">italic-ϕ</ci><ci id="S0.Ex1.m1.1.10.cmml" xref="S0.Ex1.m1.1.10">𝐫</ci></interval><apply id="S0.Ex1.m1.1.21.1.1.2.3.cmml" xref="S0.Ex1.m1.1.21.1.1"><ci id="S0.Ex1.m1.1.13.cmml" xref="S0.Ex1.m1.1.13"></ci><ci id="S0.Ex1.m1.1.14.cmml" xref="S0.Ex1.m1.1.14">italic-ϕ</ci></apply><interval closure="open" id="S0.Ex1.m1.1.21.1.1.2.4.1.cmml" xref="S0.Ex1.m1.1.21.1.1.2.4"><ci id="S0.Ex1.m1.1.16.cmml" xref="S0.Ex1.m1.1.16">𝐫</ci><ci id="S0.Ex1.m1.1.18.cmml" xref="S0.Ex1.m1.1.18">𝑡</ci></interval></apply></apply></apply></apply></annotation-xml><annotation encoding="application/x-tex" id="S0.Ex1.m1.1c">\frac{\partial\phi(\mathbf{r},t)}{\partial t}=\nabla\cdot\big{[}D(\phi,\mathbf%
{r})\ \nabla\phi(\mathbf{r},t)\big{]}</annotation></semantics></math></td>
<td class="ltx_eqn_cell ltx_eqn_center_padright"></td></tr>
</table>
</p>
<p>where
<span data-defines="#S0.Ex1.m1.1.1.2">
<i>ϕ</i>(<b>r</b>, <i>t</i>) is the <a href="/wiki/Density" title="Density">density</a> of the diffusing material at location <b>r</b> and time <i>t</i>
</span> and
<span data-defines="#S0.Ex1.m1.1.21.1.1.2">
<i>D</i>(<i>ϕ</i>, <b>r</b>) is the collective <a href="/wiki/Diffusion_coefficient" class="mw-redirect" title="Diffusion coefficient">diffusion coefficient</a> for density <i>ϕ</i> at location <b>r</b>
</span>; and
<span data-defines="#S0.Ex1.m1.1.3">
∇ represents the vector <a href="/wiki/Differential_operator" title="Differential operator">differential operator</a> <a href="/wiki/Del" title="Del">del</a>
</span>. If the diffusion coefficient depends on the density then the equation is nonlinear, otherwise it is linear.</p>
</div>
<!-- include jQuery and our script -->
<script src="./js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="./js/annot.js" type="text/javascript"></script>
</body>
</html>
$(function(){
var declAttribute="data-decl"; // the attribute that we use for annotation of declarations
var drefAttribute="data-dref"; // the attribute that we use for annotation for declaration references
// given an element, find the element it defines
// has to be of the form #id
var getDeclElement = function(elem){
var value = $(elem).attr(drefAttribute);
var declElement="*["+declAttribute+"='"+ value + "']";
// console.log("DeclElement=" + declElement);
return $(declElement);
}
// find all elements that have the attribute
// and add hover(enterHandler, leaveHandler) handlers
$("*["+drefAttribute+"]").hover(
function(){getDeclElement(this).css("background-color", "orange");},
function(){getDeclElement(this).css("background-color", "");}
);
})
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment