Commit 03cd6c07 authored by Oliver Sander's avatar Oliver Sander

[cleanup] Remove very old hack around an IntersectionIterator deficiency

Apparently there used to be a time where the LeafIntersectionIterator
didn't work properly.  The finitevolume.cc example hacked around it,
and the how-to text contained a lengthy paragraph & illustration to explain
that hack.

Both hack and explanation are obsolete, and this patch removes them.
parent ed039ce2
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Creator: fig2dev Version 3.2 Patchlevel 5d -->
<!-- CreationDate: Sun Dec 2 19:17:23 2012 -->
<!-- Magnification: 1.050 -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="6.6in"
height="1.5in"
viewBox="1645 3504 7954 1794"
id="svg3004"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="islocalref.svg">
<metadata
id="metadata3060">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3058" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1527"
inkscape:window-height="921"
id="namedview3056"
showgrid="false"
inkscape:zoom="1.7626263"
inkscape:cx="297"
inkscape:cy="67.5"
inkscape:window-x="44"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg3004" />
<circle
sodipodi:ry="94"
sodipodi:rx="94"
sodipodi:cy="4677"
sodipodi:cx="5007"
id="circle3008"
style="fill:#000000;stroke:#000000;stroke-width:8"
r="94"
cy="4677"
cx="5007" />
<circle
sodipodi:ry="94"
sodipodi:rx="94"
sodipodi:cy="4677"
sodipodi:cx="8220"
id="circle3010"
style="fill:#000000;stroke:#000000;stroke-width:8"
r="94"
cy="4677"
cx="8220" />
<circle
sodipodi:ry="94"
sodipodi:rx="94"
sodipodi:cy="4677"
sodipodi:cx="1748"
id="circle3012"
style="fill:#000000;stroke:#000000;stroke-width:8"
r="94"
cy="4677"
cx="1748" />
<circle
sodipodi:ry="94"
sodipodi:rx="94"
sodipodi:cy="4062"
sodipodi:cx="5007"
id="circle3014"
style="fill:#000000;stroke:#000000;stroke-width:8"
r="94"
cy="4062"
cx="5007" />
<circle
sodipodi:ry="94"
sodipodi:rx="94"
sodipodi:cy="4062"
sodipodi:cx="6661"
id="circle3016"
style="fill:#000000;stroke:#000000;stroke-width:8"
r="94"
cy="4062"
cx="6661" />
<circle
sodipodi:ry="94"
sodipodi:rx="94"
sodipodi:cy="4062"
sodipodi:cx="8220"
id="circle3018"
style="fill:#000000;stroke:#000000;stroke-width:8"
r="94"
cy="4062"
cx="8220" />
<rect
id="rect3020"
style="fill:#000000;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter"
rx="0"
height="47"
width="2834"
y="4629"
x="1937" />
<rect
id="rect3022"
style="fill:#000000;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter"
rx="0"
height="47"
width="2834"
y="4629"
x="5196" />
<rect
id="rect3024"
style="fill:#000000;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter"
rx="0"
height="47"
width="1133"
y="4062"
x="5244" />
<rect
id="rect3026"
style="fill:#000000;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter"
rx="0"
height="47"
width="1133"
y="4062"
x="6897" />
<polyline
id="polyline3028"
style="fill:none;stroke:#ff0000;stroke-width:16;stroke-linecap:butt;stroke-linejoin:bevel"
points="4677,4771 4677,4773 4676,4780 4676,4788 4676,4801 4675,4816 4676,4834 4677,4854 4679,4875 4682,4898 4688,4922 4697,4949 4708,4977 4724,5007 4742,5037 4759,5062 4771,5082 4782,5097 4788,5107 4792,5116 4795,5122 4798,5127 4804,5134 4813,5143 4828,5153 4849,5167 4878,5182 4913,5196 4945,5207 4977,5214 5003,5219 5025,5224 5042,5226 5055,5227 5065,5228 5075,5228 5083,5228 5093,5227 5107,5226 5125,5224 5147,5219 5175,5214 5208,5207 5244,5196 5277,5184 5308,5170 5331,5158 5349,5147 5361,5138 5369,5130 5374,5124 5378,5118 5381,5111 5385,5104 5392,5096 5402,5084 5416,5069 5434,5051 5456,5030 5480,5007 5505,4981 5528,4956 5546,4934 5562,4915 5574,4897 5586,4880 5595,4866 5603,4852 5610,4840 5505,5041 " />
<polygon
id="polygon3030"
style="fill:#ff0000;stroke:#ff0000;stroke-width:16;stroke-miterlimit:8"
points="5451,5017 5564,5074 5564,5074 5620,4820 " />
<polyline
id="polyline3032"
style="fill:none;stroke:#ff0000;stroke-width:16;stroke-linecap:butt;stroke-linejoin:bevel"
points="5291,4818 5291,4820 5292,4827 5292,4835 5292,4848 5293,4864 5292,4881 5291,4901 5289,4922 5286,4945 5279,4970 5271,4996 5259,5024 5244,5055 5228,5081 5213,5103 5201,5122 5191,5138 5184,5148 5179,5156 5175,5164 5173,5169 5170,5174 5166,5180 5159,5186 5148,5194 5132,5205 5111,5217 5085,5231 5055,5244 5022,5254 4991,5261 4964,5267 4942,5271 4925,5273 4913,5274 4902,5275 4893,5275 4885,5275 4874,5274 4860,5273 4843,5271 4820,5267 4792,5261 4760,5254 4724,5244 4690,5231 4660,5217 4637,5205 4619,5194 4606,5185 4599,5177 4594,5171 4591,5165 4586,5159 4582,5151 4576,5143 4565,5131 4552,5117 4534,5099 4512,5078 4488,5055 4462,5028 4439,5003 4422,4981 4406,4962 4393,4944 4382,4928 4372,4913 4365,4899 4358,4888 4461,5088 " />
<polygon
id="polygon3034"
style="fill:#ff0000;stroke:#ff0000;stroke-width:16;stroke-miterlimit:8"
points="4407,5120 4519,5062 4519,5062 4347,4868 " />
<polyline
id="polyline3036"
style="fill:none;stroke:#ff0000;stroke-width:16;stroke-linecap:butt;stroke-linejoin:bevel"
points="5291,3921 5292,3920 5292,3919 5293,3917 5294,3913 5295,3910 5296,3906 5297,3902 5297,3897 5296,3891 5294,3885 5291,3878 5286,3869 5279,3861 5270,3850 5258,3839 5244,3826 5225,3812 5207,3797 5190,3784 5176,3774 5166,3764 5158,3757 5151,3750 5145,3743 5139,3737 5131,3732 5122,3724 5108,3717 5090,3709 5067,3700 5039,3692 5007,3685 4975,3680 4946,3678 4922,3677 4903,3678 4890,3679 4881,3680 4874,3682 4870,3685 4865,3687 4858,3690 4849,3694 4834,3698 4815,3704 4790,3712 4759,3721 4724,3732 4689,3744 4658,3755 4633,3764 4614,3772 4599,3776 4590,3778 4583,3779 4578,3779 4574,3780 4566,3781 4558,3786 4544,3794 4525,3805 4501,3823 4473,3846 4440,3874 4412,3901 4387,3926 4366,3950 4349,3970 4337,3986 4328,3998 4322,4008 4318,4016 4314,4024 4311,4030 4307,4039 4302,4050 4295,4064 4283,4082 4268,4106 4249,4135 4227,4169 4204,4204 4181,4241 4160,4275 4140,4307 4123,4337 4108,4363 4094,4387 4080,4410 4069,4432 4058,4452 4048,4471 4039,4488 4032,4502 4026,4515 4132,4312 " />
<polygon
id="polygon3038"
style="fill:#ff0000;stroke:#ff0000;stroke-width:16;stroke-miterlimit:8"
points="4190,4339 4079,4280 4079,4280 4016,4532 " />
<polyline
id="polyline3040"
style="fill:none;stroke:#ff0000;stroke-width:16;stroke-linecap:butt;stroke-linejoin:bevel"
points="6236,3921 6237,3918 6239,3910 6243,3899 6247,3885 6253,3869 6259,3851 6266,3830 6274,3806 6283,3779 6291,3752 6298,3731 6299,3717 6298,3710 6295,3704 6292,3699 6292,3692 6298,3679 6310,3660 6330,3637 6348,3622 6365,3608 6381,3597 6392,3590 6403,3585 6410,3581 6417,3579 6424,3575 6432,3573 6443,3569 6456,3564 6474,3558 6496,3550 6519,3543 6550,3535 6572,3530 6582,3528 6586,3527 6591,3528 6603,3530 6626,3535 6661,3543 6688,3550 6713,3558 6733,3564 6750,3568 6762,3571 6771,3573 6780,3574 6787,3576 6796,3579 6808,3584 6825,3591 6845,3603 6870,3618 6897,3637 6922,3658 6943,3677 6959,3693 6969,3706 6975,3715 6978,3722 6980,3728 6981,3734 6983,3741 6988,3751 6996,3764 7007,3781 7022,3803 7039,3826 7058,3853 7074,3876 7086,3895 7098,3910 7106,3925 7114,3937 7121,3948 6999,3755 " />
<polygon
id="polygon3042"
style="fill:#ff0000;stroke:#ff0000;stroke-width:16;stroke-miterlimit:8"
points="7049,3719 6943,3786 6943,3786 7132,3966 " />
<text
style="font-size:227px;font-style:normal;font-weight:normal;text-anchor:start;fill:#000000;stroke-width:0.025in;font-family:Times"
id="text3044"
font-size="227"
font-weight="normal"
font-style="normal"
y="4157"
x="8551"
xml:space="preserve">level l+1</text>
<text
style="font-size:227px;font-style:normal;font-weight:normal;text-anchor:start;fill:#000000;stroke-width:0.025in;font-family:Times"
id="text3046"
font-size="227"
font-weight="normal"
font-style="normal"
y="4771"
x="8551"
xml:space="preserve">level l</text>
</svg>
......@@ -1836,21 +1836,15 @@ numberstyle=\tiny, numbersep=5pt]{../evolve.hh}
\end{lst}
\begin{figure}
\begin{center}
\begin{overpic}[width=0.48\textwidth]{EPS/intersection}
\put(60,38){$\omega_i$}
\put(22,55){$\omega_j$}
\put(43,46){$\gamma_{ij}$}
\put(82,52){$\gamma_{ik}$}
\end{overpic}
\hfill
\begin{overpic}[width=0.48\textwidth]{EPS/islocalref}
\put(18,3){$\omega_i$}
\put(52,19){$\omega_j$}
\put(60,3){$\omega_k$}
\put(74,19){$\omega_m$}
\end{overpic}
\caption{Left: intersection with other elements and the boundary,
right: intersections in the case of locally refined grids.}
\end{center}
\caption{Intersection with other elements and the boundary}
\label{Fig:IsIt}
\end{figure}
......@@ -1870,7 +1864,7 @@ An Intersection is with another element $\omega_j$ if the
\lstinline!neighbor()! method of the iterator returns true (line
\ref{evh:neighbor}) or with the external boundary if
\lstinline!boundary()! returns true (line \ref{evh:bndry}), see also
left part of Figure \ref{Fig:IsIt}. An intersection $\gamma_{ij}$ is
Figure~\ref{Fig:IsIt}. An intersection $\gamma_{ij}$ is
described by several mappings: (i) from a reference element of the
intersection (with a dimension equal to the grid's dimension minus 1)
to the reference elements of the two elements $\omega_i$ and
......@@ -1880,32 +1874,6 @@ intersection is with another element then the \lstinline!outside()!
method returns an \lstinline!EntityPointer! to an entity of
codimension 0.
In the case of a locally refined grid special care has to be taken in
the flux evaluation because the intersection iterator is not
symmetric. This is illustrated for a one-dimensional situation in
the right part of Figure \ref{Fig:IsIt}. Element
$\omega_j$ is a leaf element on level $l+1$. The intersection iterator
on $\omega_j$ delivers two intersections, one with $\omega_i$ which is
on level $l$ and one with $\omega_m$ which is also on level
$l+1$. However, the intersection iterator started on $\omega_i$ will
deliver an intersection with $\omega_k$ and one with the external
boundary (which is not shown). This means that the correct flux for
the intersection $\partial\omega_i\cap\partial\omega_j$ can only be
evaluated from the intersection $\gamma_{ji}$ visited by the
intersection iterator started on $\omega_j$, because only there the
two concentration values $C_j$ and $C_i$ are both accessibly. Note
also that the outside element delivered by an intersection
iterator need not be a leaf element (such as $\omega_k$).
Therefore, in the code it is first checked that the outside element is
actually a leaf element (line 89). Then the flux can be evaluated if
the level of the outside element is smaller than that of the element
where the intersection iterator was started (this corresponds the the
situation of $\omega_j$ referring to $\omega_i$ in the right part of Figure
\ref{Fig:IsIt}) or when the levels are equal and the index of
the outside element is larger. The latter condition with the indices
just ensures that the flux is only computed once.
The $\Delta t^n$ calculation is done in line \ref{evh:dt} where the
minimum over all cells is taken. Then, line \ref{evh:.99} multiplies
the optimum $\Delta t^n$ with a safety factor to avoid any instability
......
......@@ -91,9 +91,7 @@ void evolve (const G& grid, const M& mapper, V& c, double t, double& dt)
int indexj = mapper.map(*outside);
// compute flux from one side only
// this should become easier with the new IntersectionIterator functionality!
if ( it->level()>outside->level() ||
(it->level()==outside->level() && indexi<indexj) )
if (indexi<indexj)
{
// compute factor in neighbor
const LeafGeometry nbgeo = outside->geometry();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment