[Dune] Can I move the grid in the mesh?

段俊明 duanjm at pku.edu.cn
Sun Sep 2 05:01:31 CEST 2018


Dear  Christian,




Thanks, I am glad to recieve your reply!




I am going to realize a ALE (Arbitrary Lagrangian Eulerian) finite volume method for conservation laws,

e.g. Euler equations, and in ALE method the motion of the grid is arbitrary.

In the beginning of a time step t^n, the solution U and the mesh TR are known.

I can use U and TR to find a new mesh, denoted by TR_new, then I suppose the mesh grid is a  linear function of time, i.e.,

x(t) = x(t^n) + (x_new-x(t^n))*(t-t^n)/dt,  

where x(t^n) is the initial position, x_new the new position of x(t^n), dt the time step.

The speed of the grid (x_new-x(t^n))/dt is embedded in my equation, next, I can evolve U to the next time step

in a space-time control volume. Finally, the solution and the mesh are both updated.




I have several difficulties now.

1. In one-dimensional problem,  I need to perform a fifth WENO reconstruction, i.e. I need to get a new polynomial in cell i

    from the information of cell i-2, i-1, i, i+1, i+2. How can I obtain the information from these five cells if the index i is given?

    The answer in FAQ tells me that I can use a vector to save the "EntitySeeds", so I write the following code,

 20     typedef Dune::OneDGrid GridType;
 22     typedef typename GridType :: LeafGridView GridView;
 23     typedef typename GridView::template Codim<0>::Iterator ElementLeafIterator;
 25     int Nx(10);
 26     GridType grid(Nx, 0, 1);
 27     GridView leafView = grid.leafGridView();
 28     std::vector<ElementLeafIterator::Entity> ListElements(Nx);
 30 
 31     int count = 0;
 32     for(auto && it : elements(leafView)) {
 33       ListElements[count] = it;
 34       count++;                                                                                                                                                   
 35     }

    Are the elements in the vector ListElements in the sequence from left to right (from x=0 to x=1)? 







2. As I described above, how can I move vertices in the grid to a new position if I know their velocities?

     I cannot modify the information of the entities if I use above code. The last email tells me that I can use UG-grid implementation,

     but I don't find any functions to do that. Could you give me more details?




Thank you again!



--
Best Regards,
Junming Duan
-----原始邮件-----
发件人:"Christian Engwer" <christian.engwer at uni-muenster.de>
发送时间:2018-08-30 20:03:27 (星期四)
收件人: dune at lists.dune-project.org, "段俊明" <duanjm at pku.edu.cn>
抄送:
主题: Re: [Dune] Can I move the grid in the mesh?

Dear Junming Duan,

in principal it is possible to achieve what you want to do. Actually there are different ways. Which one is better will depend on your particular setup.

A) DUNE offers a range of different good implementations. The UG-grid implementation offers support for moving vertices directly in the mesh.

B) There is also the "geometrygrid", which is a meta grid, allowing to replace the geometry information of an existing DUNE grid.

C) As you can write your own discretion (i.e. the local operator), you can incorporate the transformation of the mesh into the model and use the deformation as model parameters to your bi-linear form.

Feel free to ask further details. To decide which option is best, it would be nice to learn more about your application.

Best Christian


Am 30. August 2018 13:23:13 MESZ schrieb "段俊明" <duanjm at pku.edu.cn>:

Dear developers of DUNE,




I am interested in DUNE and want to do my research based on DUNE.

Now I want to realize a moving mesh method by DUNE, so are there any functions in DUNE which allow me to change the position of the grid?

I wish to control the position of each grid point varing with the time.


--
Best Regards,
Junming Duan



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20180902/9f7eacbc/attachment.htm>


More information about the Dune mailing list