Moving Mesh

Most interface driven-problems have time-dependent interfaces \(\Gamma = \Gamma(t)\). Therefore, Dune-MMesh features capabilities of moving and remeshing in spatial dimension two.

Note

The remeshing feature is not (yet) supported in spatial dimension three because the removal of a vertex is not offered by the underlying CGAL Triangulation_3 class. In fact, it could appear that the region formed by its adjacent tetrahedrons is an instance of the untetrahedralizable Schönhardt’s polyhedron. In this case, the removal of the vertex might be impossible without rebuilding the whole triangulation.

Moving Vertices

Dune-MMesh allows the movement of interface vertices (or all grid vertices) by a predescribed movement.

For this, we assume that movement is given by the shift of vertices. This movement can be performed by simply changing the coordinates of the vertices. Dune-MMesh provides the method moveInterface(shifts) that takes a vector of shift coordinates indexed by interface vertex indices.

Figure made with TikZ

Moving the interface.

A second method moveVertices(shifts) is available for moving all vertices of the triangulation that is indexed by bulk vertex indices.

Remark that moving vertices might lead to degeneration of the triangulation, i.e. cells can have non-positive volume. To prevent that, Dune-MMesh is equipped with remeshing routines we describe in the following.

Adaptation

Adaption in DUNE is hierarchical by definition. Whenever a grid element is supposed to be refined, it is split into smaller cells belonging to a higher level of the grid hierarchy. If all children in the highest refinement level of a grid element are supposed to be coarsened, the children cells are put together to form a parent cell one level lower.

Hereby, the adaptation procedure is performed in two stages:
  1. Mark: Grid elements are marked for coarsening or refinement.

  2. Adapt: The elements are adapted due to their markers and discrete functions are restricted or prolongated.

In Dune-MMesh, due to the moving mesh, non-hierarchic adaptation is inavoidable. However, we will try to follow the general DUNE approach of adaptation as good as possible. For this reason, we similarily separate the adaptation into two stages.

1. Mark

In advance of moving, two methods are provided for marking elements in a convenient way.

Figure made with TikZ

Marking elements. Green: refine. Red: coarsen.

First, the method ensureInterfaceMovement(shifts) (respectively ensureVertexMovement(shifts)) can be called to prepare Dune-MMesh for moving the vertices. The routine takes the vertex shifts as argument and marks presumbly degenerate cells for coarsening. Hence, they will be somehow removed during adaptation.

The second method available for marking elements is markElements(). This method uses a default indicator that marks elements depending on their current geometrical properties.

This indicator considers primarily maximal and minimal edge length and aims at an objective edge length between \(h_{max}\) and \(h_{min}\).

  • If an edge is longer than the maximum edge length \(h_{max}\), the cell will be marked for refine.

  • If an edge is shorter than the minimum edge length \(h_{min}\), the cell will be marked for coarsening.

Additionally, if the ratio of longest to shortest edge is larger than 4, the cell is marked for coarsening. The number 4 occurs from the fact that we we will use bisection and a triangle where two edges are longer then \(h_{max}\) should not be splitted into smaller triangles where an edge is shorter than \(h_{min}\).

Finally, a maximal radius ratio is taken into account to remove very ugly cells. Always coarsening has priority before refinement because refinement would not remove ugly cells.

The minimal and maximal edge lengths \(h_{max}\) and \(h_{min}\) are initialized automatically when constructing a mesh by determining the range of edge lengths occuring the grid.

Remark that markElements() also checks the elements of the interface grid. Therefore, the interface will be refined and coarsened as well if edges of the interface get too long or too short.

Note

The methods ensureInterfaceMovement(shifts) and markElements() are just convenience methods. Instead, one can also use a proprietary procedure marking elements manually, or one can insert and remove vertices directly using removeVertex(vertex) and refineEdge(element, edgeIndex).

2. Adapt

After marking elements the adapt() routine performs the actual adaptation process. The adaptation is performed by insertion and removal of points.

Figure made with TikZ

Inserting and removing points.

  • In each element that is marked for refinement the center of the longest edge is interserted, i.e. refinement is done via bisection.

  • In all elements marked for coarsening, one vertex is removed. Here, the vertex incident to the shortest edges of the cell is chosen, but we give priority on non-interface and non-boundary vertices.

Figure made with TikZ

Connected components.

When a vertex is removed, the resulting star-shaped hole is re-triangulated with respect to the interface. Here, for the purpose of projection, we introduce connected components. These are the minimal sets of cells from the triangulation before adaptation that cover the same area as a set of cells in the triangulation afterwards. The easiest representatives of these connected components are the incident cells when bisecting an edge and the incident cells to a vertex that is removed. Though, we have to combine overlapping sets of these representatives.

Figure made with TikZ

Non-hierarchic projection with cut-set triangulation.

For a conservative projection of discrete functions we compute a cut-set triangulation which enables evalutation with agglomerated quadrature rules on triangles. Here, we prolong from an old cell onto such a cut triangle and prolong onto the new cell. This whole projection is performed under the hood and just assumes that you use the callback adaptation in dune-fem. We use a similar concept on the interface grid that enables projection of discrete functions on the interface.