<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 12pt; color: #000000'>Thanks Carsten and Andreas,<br>I understand the situation but I cannot understand the cure Carsten proposed.<br>Could you be more specific, Carsten, please?<br>Thanks again,<br><br>Marco<br><br><br><br><b>Da: </b>"Carsten Gräser" <graeser@mi.fu-berlin.de><br><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>A: </b>"Marco Cisternino" <marco.cisternino@optimad.it>, dune@dune-project.org<br><b>Inviato: </b>Mercoledì, 25 febbraio 2015 0:28:11<br><b>Oggetto: </b>Re: [Dune] parametrized AMR and cell divergence<br><br>Hi Marco,<br>with hanging node you will have precisely the situation mentioned<br>by Andreas. This does not change in 3d.<br><br>The problem is that GeometryGrid moves individual vertices, i.e,<br>the grid is deformed by a P1-function living on the host grid.<br>Unfortunately a P1-function with arbitrary values for each vertex<br>is not continuous in general. Hence you get holes or overlapping<br>elements as described by Andreas.<br><br>However you can cure this by using conforming P1-functions<br>leading to continuous deformations. This can be achieved by<br>interpolating the values at hanging nodes by their non-hanging<br>neighbors.<br><br>Best,<br>Carsten<br><br>Am 24.02.2015 um 19:17 schrieb Andreas Dedner:<br>> 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<br>> structure if you use GeometryGrid.<br>> <br>> One could still get the intersection correctly I guess. But not the way<br>> it is implemented as you can see in<br>> dune/grid/geometrygrid/intersection.hh, As you can see it uses the<br>> 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(<br>> insideGeo_.type() );<br>> <br>>         FieldVector< ctype, dimension > x( geometryInInside().global(<br>> 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>> On 24/02/15 17:17, Marco Cisternino wrote:<br>>> 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<br>>> GeometryGrid.<br>>> If I can move nodes using a deformation function and I can refine<br>>> 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<br>>> element asking for normals and intersections length, what is the<br>>> 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>>> -- <br>>> -----------------------------------------------<br>>> Marco Cisternino, PhD<br>>> Software Developer<br>>> OPTIMAD Engineering s.r.l.<br>>> Via Giacinto Collegno 18<br>>> 10143 Torino - Italy<br>>> www.optimad.it<br>>> marco.cisternino@optimad.it<br>>> +39 011 19719782<br>>> -----------------------------------------------<br>>><br>>> ------------------------------------------------------------------------<br>>> *Da: *"Andreas Dedner" <a.s.dedner@warwick.ac.uk><br>>> *A: *"Marco Cisternino" <marco.cisternino@optimad.it><br>>> *Cc: *dune@dune-project.org<br>>> *Inviato: *Martedì, 24 febbraio 2015 18:00:30<br>>> *Oggetto: *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>>>    |              |                    | |           <br>>> \                     |<br>>>    |------------Y                    | |-----------Y                   |<br>>>    |              |                    | |           <br>>> /                     |<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<br>>> could be between AZ and ZB... But the main problem is the non DUNE<br>>> style grid.<br>>><br>>> Andreas<br>>><br>>> On 24/02/15 16:35, Marco Cisternino wrote:<br>>><br>>>     Absolutely non conforming.<br>>>     I know I have a hanging node, but I cannot understand what you<br>>>     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<br>>>     my coarse element has 9 intersections, right?<br>>>     Through its intersections the coarse element knows about the<br>>>     hanging node or not?<br>>>     If not I cannot imagine the use of intersections.<br>>><br>>>     Thanks again.<br>>>     Marco<br>>><br>>>    <br>>> ------------------------------------------------------------------------<br>>>     *Da: *"Andreas Dedner" <a.s.dedner@warwick.ac.uk><br>>>     *A: *"Marco Cisternino" <marco.cisternino@optimad.it>,<br>>>     dune@dune-project.org<br>>>     *Inviato: *Martedì, 24 febbraio 2015 16:55:38<br>>>     *Oggetto: *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<br>>> (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>>>     On 24/02/15 15:39, Marco Cisternino wrote:<br>>><br>>>         Hi Andreas, thank you for your reply.<br>>>         I'm using GeometryGrid and ALU together. I provide ALU with a<br>>>         DiscreteDeformationFunction (my coarse element<br>>>         parametrization). Any time a new point appears in the mesh<br>>>         after a refinement I move that point using the<br>>>         DiscreteDeformationFunction.<br>>>         The problem appears for local refinement. On the other hand,<br>>>         if I globally refine the mesh I have no problem about the<br>>>         divergence of the cells: it is zero everywhere.<br>>>         However, if I refine only a bunch of cells, then the coarse<br>>>         ones, sharing intersection with the fine ones, have non-zero<br>>>         divergence.<br>>>         I'm doing all this using the following methods:<br>>>         intersection centerOuterUnitNormal<br>>>         and codimension 1 volume method (choosing the element face<br>>>         corresponding to the intersection)<br>>>         I hope it is clearer.<br>>>         Thanks,<br>>><br>>>         Marco<br>>><br>>><br>>>        <br>>> ------------------------------------------------------------------------<br>>>         *Da: *"Andreas Dedner" <a.s.dedner@warwick.ac.uk><br>>>         *A: *dune@dune-project.org<br>>>         *Inviato: *Martedì, 24 febbraio 2015 12:14:33<br>>>         *Oggetto: *Re: [Dune] parametrized AMR and cell divergence<br>>><br>>>         I'm not quite sure I understand the question. Are you seeing<br>>>         problems<br>>>         when refining the grid using ALU's standard globalRefine<br>>>         method or do the problems<br>>>         only appear when you use your local parametrization and after<br>>>         moving nodes around<br>>>         (I'm not quite clear how you do that with ALU....).<br>>>         Andreas<br>>><br>>><br>>>         On 24/02/15 11:00, Marco Cisternino wrote:<br>>><br>>>             Good morning,<br>>>             I would like to ask duners about deformed AMR.<br>>>             I'm working with body fitted mesh and ALUGrid.<br>>><br>>>             In order to refine my mesh I compute a local<br>>>             parametrization for every coarse element, then I refine<br>>>             the mesh moving new nodes using my parametrization.<br>>>             Therefore I compute the cell divergence summing over the<br>>>             cell intersection<br>>>             normal . flux * area<br>>>             where intersection normals and areas are computed by Dune<br>>>             methods centerUnitNormal and volume(this for a face),<br>>>             while flux is (1,1,1) everywhere.<br>>>             I expect 0 over the entire mesh and this is true on the<br>>>             coarse grid, but for a refined grid this is not true for<br>>>             coarse cells sharing intersections with finer cells.<br>>>             Does anyone see something like this? And is there a cure?<br>>>             Am I doing something wrong?<br>>><br>>>             Thanks for any hint.<br>>>             Bests,<br>>><br>>>             Marco<br></div><br></div></body></html>