<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    All I'm saying is that one element is a pentagon and GeometryGrid
    does <br>
    not change the type of the element. So that the situation will not<br>
    be correctly resolved by GeometryGrid since it uses the element
    geometry<br>
    types of the hostgrid. For example element.geometry().volume() would<br>
    be wrong. You would need a grid that can handle this pentagon.<br>
    So the underlying codim zero elements do not conform to the dune
    structure if you use GeometryGrid. <br>
    <br>
    One could still get the intersection correctly I guess. But not the
    way it is implemented as you can see in
    dune/grid/geometrygrid/intersection.hh, As you can see it uses the
    geometry of <br>
    the inside element and as discussed above that is not correct.<br>
    Andreas<br>
          FieldVector< ctype, dimensionworld ><br>
          outerNormal ( const FieldVector< ctype, dimension-1 >
    &local ) const<br>
          {<br>
            const ReferenceElement< ctype, dimension >
    &refElement<br>
              = ReferenceElements< ctype, dimension>::general(
    insideGeo_.type() );<br>
    <br>
            FieldVector< ctype, dimension > x(
    geometryInInside().global( local ) );<br>
            const typename
    ElementGeometryImpl::JacobianInverseTransposed <br>
                   &jit = insideGeo_.jacobianInverseTransposed( x );<br>
            const FieldVector< ctype, dimension > &refNormal =
    <br>
                   refElement.integrationOuterNormal( indexInInside() );<br>
            FieldVector< ctype, dimensionworld > normal;<br>
            jit.mv( refNormal, normal );<br>
            return normal;<br>
          }<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 24/02/15 17:17, Marco Cisternino
      wrote:<br>
    </div>
    <blockquote
      cite="mid:201693386.4528595.1424798244826.JavaMail.root@optimad.it"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style type="text/css">p { margin: 0; }</style>
      <div style="font-family: arial,helvetica,sans-serif; font-size:
        12pt; color: #000000">This is exactly what I mean, but I was
        talking about 3D.<br>
        Anyway, from what you're saying I cannot understand the use of
        GeometryGrid.<br>
        If I can move nodes using a deformation function and I can
        refine locally (in Dune style), the "moved" situation is quite
        common.<br>
        Moreover, in this case I'd sum over the 5 intersections of the
        right element asking for normals and intersections length, what
        is the relevance of being a cube for the element? Intersections
        are "cube".<br>
        I can agree if you speak about the volume of the right element.<br>
        Who's Z?? You meant Y?<br>
        Thanks,<br>
        <br>
        Marco<br>
        <br>
        <br>
        <div><span name="x"></span>--<br>
          -----------------------------------------------<br>
          Marco Cisternino, PhD<br>
          Software Developer<br>
          OPTIMAD Engineering s.r.l.<br>
          Via Giacinto Collegno 18<br>
          10143 Torino - Italy<br>
          <a class="moz-txt-link-abbreviated" href="http://www.optimad.it">www.optimad.it</a><br>
          <a class="moz-txt-link-abbreviated" href="mailto:marco.cisternino@optimad.it">marco.cisternino@optimad.it</a><br>
          +39 011 19719782<br>
          -----------------------------------------------<span name="x"></span><br>
        </div>
        <br>
        <hr id="zwchr">
        <div
style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>Da:
          </b>"Andreas Dedner" <a class="moz-txt-link-rfc2396E" href="mailto:a.s.dedner@warwick.ac.uk"><a.s.dedner@warwick.ac.uk></a><br>
          <b>A: </b>"Marco Cisternino"
          <a class="moz-txt-link-rfc2396E" href="mailto:marco.cisternino@optimad.it"><marco.cisternino@optimad.it></a><br>
          <b>Cc: </b><a class="moz-txt-link-abbreviated" href="mailto:dune@dune-project.org">dune@dune-project.org</a><br>
          <b>Inviato: </b>Martedì, 24 febbraio 2015 18:00:30<br>
          <b>Oggetto: </b>Re: [Dune] parametrized AMR and cell
          divergence<br>
          <br>
          So you have the following situation<br>
            Original                                           Moved<br>
             X-----------A----------------X                
          X--------A------------------X           <br>
             |              |                    |                 
          |           \                      |<br>
             |              |                    |                 
          |            \                     |<br>
             |------------Y                    |                 
          |-----------Y                   |<br>
             |              |                    |                 
          |            /                     |<br>
             |              |                    |                 
          |          /                       |<br>
             X-----------B----------------X                
          X-------B-------------------X<br>
          Perhaps somebody else can add his thoughts but the right
          element after<br>
          movement is not a cube any more so it still will have the
          straight edge<br>
          between AB and your grid elements would not be non
          overlapping. That<br>
          is not allowed in DUNE. <br>
          <br>
          The right element does have 5 intersections and I guess two of
          those could be between AZ and ZB... But the main problem is
          the non DUNE style grid.<br>
          <br>
          Andreas<br>
          <br>
          <div class="moz-cite-prefix">On 24/02/15 16:35, Marco
            Cisternino wrote:<br>
          </div>
          <blockquote
            cite="mid:1998062480.4520831.1424795707773.JavaMail.root@optimad.it">
            <style>p { margin: 0; }</style>
            <div style="font-family: arial,helvetica,sans-serif;
              font-size: 12pt; color: #000000">Absolutely non
              conforming.<br>
              I know I have a hanging node, but I cannot understand what
              you say: why do you talk about coarse and fine
              intersections??<br>
              If I move a hanging node I'm moving 4 intersections, isn't
              it? And my coarse element has 9 intersections, right?<br>
              Through its intersections the coarse element knows about
              the hanging node or not?<br>
              If not I cannot imagine the use of intersections.<br>
              <br>
              Thanks again.<br>
              Marco<br>
              <br>
              <hr id="zwchr">
              <div
style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>Da:

                </b>"Andreas Dedner" <a moz-do-not-send="true"
                  class="moz-txt-link-rfc2396E"
                  href="mailto:a.s.dedner@warwick.ac.uk" target="_blank"><a.s.dedner@warwick.ac.uk></a><br>
                <b>A: </b>"Marco Cisternino" <a moz-do-not-send="true"
                  class="moz-txt-link-rfc2396E"
                  href="mailto:marco.cisternino@optimad.it"
                  target="_blank"><marco.cisternino@optimad.it></a>,
                <a moz-do-not-send="true"
                  class="moz-txt-link-abbreviated"
                  href="mailto:dune@dune-project.org" target="_blank">dune@dune-project.org</a><br>
                <b>Inviato: </b>Martedì, 24 febbraio 2015 16:55:38<br>
                <b>Oggetto: </b>Re: [Dune] parametrized AMR and cell
                divergence<br>
                <br>
                Hi.<br>
                Conforming or non conforming? If non conforming you have
                a hanging<br>
                node and if you move coarse and fine intersections will
                not match (the<br>
                coarse grid element does not know about the hanging nor
                where it<br>
                is). Could that be your problem?<br>
                Best<br>
                Andreas<br>
                <br>
                <br>
                <div class="moz-cite-prefix">On 24/02/15 15:39, Marco
                  Cisternino wrote:<br>
                </div>
                <blockquote
                  cite="mid:1005665574.4510952.1424792351225.JavaMail.root@optimad.it">
                  <style>p { margin: 0; }</style>
                  <div style="font-family: arial,helvetica,sans-serif;
                    font-size: 12pt; color: #000000">Hi Andreas, thank
                    you for your reply.<br>
                    I'm using GeometryGrid and ALU together. I provide
                    ALU with a DiscreteDeformationFunction (my coarse
                    element parametrization). Any time a new point
                    appears in the mesh after a refinement I move that
                    point using the DiscreteDeformationFunction.<br>
                    The problem appears for local refinement. On the
                    other hand, if I globally refine the mesh I have no
                    problem about the divergence of the cells: it is
                    zero everywhere.<br>
                    However, if I refine only a bunch of cells, then the
                    coarse ones, sharing intersection with the fine
                    ones, have non-zero divergence.<br>
                    I'm doing all this using the following methods:<br>
                    intersection centerOuterUnitNormal<br>
                    and codimension 1 volume method (choosing the
                    element face corresponding to the intersection)<br>
                    I hope it is clearer.<br>
                    Thanks,<br>
                    <br>
                    Marco<br>
                    <br>
                    <br>
                    <hr id="zwchr">
                    <div
style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>Da:


                      </b>"Andreas Dedner" <a moz-do-not-send="true"
                        class="moz-txt-link-rfc2396E"
                        href="mailto:a.s.dedner@warwick.ac.uk"
                        target="_blank"><a.s.dedner@warwick.ac.uk></a><br>
                      <b>A: </b><a moz-do-not-send="true"
                        class="moz-txt-link-abbreviated"
                        href="mailto:dune@dune-project.org"
                        target="_blank">dune@dune-project.org</a><br>
                      <b>Inviato: </b>Martedì, 24 febbraio 2015
                      12:14:33<br>
                      <b>Oggetto: </b>Re: [Dune] parametrized AMR and
                      cell divergence<br>
                      <br>
                      I'm not quite sure I understand the question. Are
                      you seeing problems<br>
                      when refining the grid using ALU's standard
                      globalRefine method or do the problems<br>
                      only appear when you use your local
                      parametrization and after moving nodes around<br>
                      (I'm not quite clear how you do that with
                      ALU....).<br>
                      Andreas<br>
                      <br>
                      <br>
                      <div class="moz-cite-prefix">On 24/02/15 11:00,
                        Marco Cisternino wrote:<br>
                      </div>
                      <blockquote
                        cite="mid:637362868.4442210.1424775619676.JavaMail.root@optimad.it">
                        <style>p { margin: 0; }</style>
                        <div style="font-family:
                          arial,helvetica,sans-serif; font-size: 12pt;
                          color: #000000">Good morning,<br>
                          I would like to ask duners about deformed AMR.<br>
                          I'm working with body fitted mesh and ALUGrid.<br>
                        </div>
                      </blockquote>
                      <blockquote
                        cite="mid:637362868.4442210.1424775619676.JavaMail.root@optimad.it">
                        <div style="font-family:
                          arial,helvetica,sans-serif; font-size: 12pt;
                          color: #000000">In order to refine my mesh I
                          compute a local parametrization for every
                          coarse element, then I refine the mesh moving
                          new nodes using my parametrization.<br>
                          Therefore I compute the cell divergence
                          summing over the cell intersection<br>
                          normal . flux * area<br>
                          where intersection normals and areas are
                          computed by Dune methods centerUnitNormal and
                          volume(this for a face), while flux is (1,1,1)
                          everywhere.<br>
                          I expect 0 over the entire mesh and this is
                          true on the coarse grid, but for a refined
                          grid this is not true for coarse cells sharing
                          intersections with finer cells.<br>
                          Does anyone see something like this? And is
                          there a cure? Am I doing something wrong?<br>
                          <br>
                          Thanks for any hint.<br>
                          Bests,<br>
                          <br>
                          Marco<br>
                          <br>
                        </div>
                        <br>
                        <fieldset class="mimeAttachmentHeader"></fieldset>
                        <br>
                        <pre>_______________________________________________
Dune mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Dune@dune-project.org" target="_blank">Dune@dune-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.dune-project.org/mailman/listinfo/dune" target="_blank">http://lists.dune-project.org/mailman/listinfo/dune</a>
</pre>
                      </blockquote>
                      <br>
                    </div>
                    <br>
                  </div>
                </blockquote>
                <br>
              </div>
              <br>
            </div>
          </blockquote>
          <br>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>