<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
Hi.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
As Christian said this information is not retrievable. The only (possibly not so great) solution I could come up with was to rewrite the mapping on each element in a 'global' form. e.g. write it with respect to monomials relative to the center of the element
and scaled with some length scale given by the element which is again independent of the local numbering. For not too high order mapping (perhaps less then 5?) I think this will be quite accurate; for higher order or elements with very bad aspect ratios you
need to choose the axis orientation of your global coordinates quite carefully. You could use coordinates based o the 'minimum bounding box'</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
<a href="https://en.wikipedia.org/wiki/Minimum_bounding_box" id="LPlnk889794">https://en.wikipedia.org/wiki/Minimum_bounding_box</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
I use something similar to get numerically stable VEM basis function, but overall that approach is quite a lot of work and perhaps too numerically unstable to be useful.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt">
Andreas<br>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dune <dune-bounces@lists.dune-project.org> on behalf of Simon Praetorius <simon.praetorius@tu-dresden.de><br>
<b>Sent:</b> 13 April 2020 11:22<br>
<b>To:</b> Christian Engwer <christian.engwer@uni-muenster.de>; dune@lists.dune-project.org <dune@lists.dune-project.org><br>
<b>Subject:</b> Re: [Dune] Element transformation/renumbering in GridFactory</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Christian,<br>
<br>
The example is similar to what you already guessed:<br>
<br>
Let's assume, I have a VTU or GMsh file that stores higher-order cells, i.e. additional vertices inside the elements (plus implicitly an interpretation of these vertices, like coefficients of a lagrange parametrization). So, in the mesh file only those vertices
per element are visible. Now, when reading such a grid I want to<br>
<br>
1. read the "flat" elements and construct a corresponding "flat" grid<br>
2. read the additional vertices to provide either an element parametrization in the `insertElement()` method, or data for a discrete function that can be used later on to construct curved geometries.<br>
<br>
Note, in the `insertElement()` call, the entities are not yet constructed and thus I do not have access to any insertion-index of (sub-)entities.
<br>
<br>
My procedure is as follows: in step 1 I extract the corner vertices from the list of element vertices, in step 2 I simply store all vertices (or indices in a global vertex list) per element. In combination with a lagrange local basis (that is conforming to
the lagrange-vertex ordering in the mesh file) I can construct a simple elementParametrization function, by evaluating the local basis functions in the given local coordinate and linear-combining this with the stored vertices.<br>
<br>
Note, that this only works, if the local coordinate passed to the elementParametrization is w.r.t. the coordinate system of the element in the file. This elementParametrization must be created before the actual grid element is constructed. Thus, I cannot know
any reorientation of the final element in the construction of the parametrization. This means, that the grid must be responsible for passing transformed local coordinates to the element-parametrization on evaluation. (I'm not sure whether this is guaranteed)<br>
<br>
The second goal in step 2 is to create a discrete function for final grid parametrization. This discrete function should map a local coordinate in an element to the global coordinate of the element parametrization. Here, I have all the entities in a grid constructed
and have the insertion-indices of all elements and vertices. But not the local renumbering/reorientation of the entities.
<br>
<br>
Maybe I could create a mapping of the element corners to the original corners, by inspecting the insertion-index of the vertex sub-entities of an element and then comparing indices to construct a permutation of the local corner coordinates and with this a MultilinearGeometry
to map the local coordinates?? I'm not sure whether this works out. What is missing is something similar to the insertion-index, maybe an `insertion-permutation`:<br>
<br>
```c++<br>
/// Return the permutation vector that mapps corner indices in `entity` the vertices passed in \ref insertElement()<br>
virtual std::vector<unsigned int><br>
insertionPermutation ( const typename Codim< dimension >::Entity &entity ) const<br>
{<br>
// need to be implemented!<br>
}<br>
```<br>
<br>
If the grid does not permute the inserted vertices, this function could return an identity permtutation. Then, maybe the return type should be something else that can be implemented more efficiently.<br>
<br>
Best,<br>
Simon<br>
<br>
---<br>
Dr. Simon Praetorius<br>
Institut für Wissenschaftliches Rechnen<br>
Fakultät Mathematik<br>
Technische Universität Dresden<br>
Tel.: TUD-34432<br>
Mail: simon.praetorius@tu-dresden.de<br>
Web: <a href="http://www.math.tu-dresden.de/~spraetor">www.math.tu-dresden.de/~spraetor</a><br>
<br>
________________________________________<br>
Von: Christian Engwer <christian.engwer@uni-muenster.de><br>
Gesendet: Montag, 13. April 2020 11:50<br>
An: Praetorius, Simon; dune@lists.dune-project.org<br>
Betreff: Re: [Dune] Element transformation/renumbering in GridFactory<br>
<br>
Hi Simon,<br>
<br>
>Does this include the local numbering of ther vertices in an element?<br>
>Yes, I can get the insertion index of an element or a vertex index, but<br>
>how to extract from this the changed local numbering of an element. (Do<br>
>I mix something up here?)<br>
<br>
No, I don't think this is currently possible.<br>
<br>
Could you give an example of what you are trying to achieve in the end? Perhaps there is an alternative approach?!<br>
<br>
If you are storing a grid parameterization, you can store a P1/Q1 function. Surely this is not sufficient to store higher order mappings. You could work around this problem by storing an element local higher order representation. The second yields the parameterization
up to a local transformation. The transformation should be deducible from the two representations, as the linear part of the full representation has to match the very based representation. Not nice, but a start.<br>
<br>
Besides this I'm sure people would be glad about a good proposal for an improved factory interface :-)<br>
<br>
Christian<br>
<br>
_______________________________________________<br>
Dune mailing list<br>
Dune@lists.dune-project.org<br>
<a href="https://lists.dune-project.org/mailman/listinfo/dune">https://lists.dune-project.org/mailman/listinfo/dune</a></div>
</span></font></div>
</body>
</html>