The Distributed and Unified Numerics Environment ( Dune ) and Applications Albert-Ludwigs-Universität Freiburg Martin Nolte Sino-German Symposium on Modern Numerical Methods for Compressible Fluid Flows and Related Problems May 21 st –27 th , 2014
What is Dune ? “ Dune is a modular toolbox for solving PDEs with grid-based methods.” Web Page: www.dune-project.org Sino-German Symposium 2014 M. Nolte – Dune and Applications 2 / 29
Who is Dune ? Dune Developers Aachen (Germany) Heidelberg (Germany) Oliver Sander Peter Bastian Markus Blatt Bergen (Norway) Robert Klöfkorn Münster (Germany) Christian Engwer Berlin (Germany) Jorrit Fahlke Carsten Gräser Mario Ohlberger Freiburg (Germany) Stuttgart (Germany) Christoph Gersbacher Steffen Müthing Martin Nolte Warwick (U.K.) Andreas Dedner Sino-German Symposium 2014 M. Nolte – Dune and Applications 3 / 29
Dune Design Goals Flexibility: easily adapt the numerical code to (new) user problems, Efficiency: good performance of the compiled code, Modularity: independent pieces that can be plugged together. This is achieved in C++ through object orientation, abstract (mathematical) interfaces, static polymorphism, template meta programming. Sino-German Symposium 2014 M. Nolte – Dune and Applications 4 / 29
The Dune Grid Interface The Dune-Grid module defines a slim interface for (locally) adaptive, possibly non-conforming, parallel (based on domain decomposition), multi element type grids in arbitrary space dimensions. A (hierarchical) grid is seen as a parallel container of entities (points, lines, faces, elements, ...) endowed with a hierarchy. Sino-German Symposium 2014 M. Nolte – Dune and Applications 5 / 29
Implementations of the Dune Grid Interface AlbertaGrid 1d–3d simplex grid in R w ( w = 1 ,..., 9); bisection refinement ALUGrid parallel 3d grid; either hexahedra or tetrahedra; non-conforming “red” refinement; dynamic load balancing GeometryGrid Meta grid exchaning the geometric realization OneDGrid simple 1d grid; local refinement PrismGrid Meta grid taking product of host grid and a structured 1d grid SPGrid fast, parallel, Carteian grid in arbitrary dimension UGGrid parallel 2d and 3d grid; multiple geometry types; “red” refinement (also with “green” closure); dynamic load balancing Sino-German Symposium 2014 M. Nolte – Dune and Applications 6 / 29
Dune R eference Elements Dune provides a predefined set of reference elements R d for each dimension d ≥ 0. They are defined recursively over d : (0,1,1) (1,1,1) 6 7 5 (0,0,1) top (1,0,1) 4 5 d = 0: We set R 0 := { P } . 3 rear 0 1 (0,0,1) h t 3 e t f g l 2 i r d �→ d + 1 : For R ∈ R d we define: 2 front 3 (0,1,0) (1,1,0) 4 0 bottom 0 1 1 2 right (0,0,0) t 2 (1,0,0) e f R ◦ : the pyramid over R , l (0,1,0) front 3 0 bottom 1 (0,0,1) 4 (0,1,1) (0,0,0) (1,0,0) 5 R | : the prism over R . 4 (0,0,1) top (1,0,1) 3 3 4 4 rear 3 2 t 2 2 e f 1 3 l right We set (0,1,0) (1,1,0) right front 0 t e f l 1 bottom 0 1 2 front R d + 1 := { R ◦ , R | | R ∈ R d } . (0,0,0) (1,0,0) (0,1,0) 0 bottom 0 1 (0,0,0) (1,0,0) Notice: P ◦ = P | . Set of 3d reference elements Sino-German Symposium 2014 M. Nolte – Dune and Applications 7 / 29
Dune-Fem: Discretization of PDEs Design Goals: map mathematical concepts one-to-one to C++ objects “seamless” parallelization hide unnecessary technical details (e.g., DoF numbering) high serial and parallel performance (HPC) Interfaces (and implementations) for grid functions (element-wise representation) discrete function spaces (finite basis + DoF mapper) discrete functions discrete (spatial) operators inverse operators (based, e.g., on Krylov methods) ODE solvers (e.g., SSP-RK) Sino-German Symposium 2014 M. Nolte – Dune and Applications 8 / 29
P arallel Efficiency of Dune-Fem Strong Scaling for a DG-Navier-Stokes solver Strong Scaling auf JUGENE (Jülich): ¯ P | G | / P N / P η S 512 → P E 512 → P 512 474.6 296 . 6 k 46 . 22 s — — 4 096 59.3 37 . 3 k 6 . 29 s 7 . 34 91 % 32 768 7.4 4 . 6 k 0 . 95 s 48 . 71 76 % 65 536 3.7 2 . 3 k 0 . 50 s 91 . 70 72 % P 4 ansatz functions, expl. time discretization, SPGrid P number of processor cores N global degrees of freedom η average run time per time step ¯ S 512 → P performance gain ( ¯ η 512 η P ) ¯ E 512 → P parallel efficiency ( 512 P S 512 → P ) results by R. Klöfkorn Sino-German Symposium 2014 M. Nolte – Dune and Applications 9 / 29
A T sunami-Wave Sino-German Symposium 2014 M. Nolte – Dune and Applications 10 / 29
Meta Grids Idea: Implement a Dune grid ( meta grid ) based on another Dune grid ( host grid ). With a meta grid we can ... ... easily extend the features of the host grid without changing it. ... speed up the host grid using structural assumptions. ... rapidly test interface changes or additions Sino-German Symposium 2014 M. Nolte – Dune and Applications 11 / 29
Meta Grids SphereGrid : Tailoring Towards a Very Special Domain Very Special Domain: S 2 Problem: Using piecewice linear grid, even high order FEM discretizations are only 2nd order accurate due to geometry approximation. Solution: Use a meta grid to replace the geometric realization by spherical triangles. Sino-German Symposium 2014 M. Nolte – Dune and Applications 12 / 29
Meta Grids SphereGrid : Tailoring Towards a Very Special Domain Example: Poisson’s equation on the Sphere on S 2 . − ∆ Γ u = f Convergence of P k -Lagrange finite elements on AlbertaGrid and SphereGrid< AlbertaGrid > : AlbertaGrid , P 2 SphereGrid , P 2 AlbertaGrid , P 3 SphereGrid , P 3 L 2 -error L 2 -error L 2 -error L 2 -error lvl EOC EOC EOC EOC 3 . 5 · 10 1 3 . 0 · 10 0 3 . 6 · 10 1 1 . 1 · 10 2 0 — — — — 1 . 7 · 10 1 1 . 8 · 10 1 1 . 4 · 10 0 6 . 3 · 10 0 1 1 . 08 − 2 . 57 4 . 66 4 . 07 8 . 1 · 10 − 1 7 . 1 · 10 − 1 5 . 1 · 10 − 1 2 . 3 · 10 − 1 2 4 . 37 4 . 63 1 . 48 4 . 80 1 . 4 · 10 − 1 1 . 4 · 10 − 1 9 . 2 · 10 − 2 3 . 0 · 10 − 2 3 2 . 56 2 . 41 2 . 48 2 . 89 2 . 9 · 10 − 2 1 . 9 · 10 − 2 2 . 4 · 10 − 2 2 . 3 · 10 − 3 4 2 . 23 2 . 80 1 . 92 3 . 75 6 . 5 · 10 − 3 2 . 8 · 10 − 3 6 . 1 · 10 − 3 1 . 4 · 10 − 4 5 2 . 16 2 . 81 2 . 00 4 . 06 1 . 6 · 10 − 3 3 . 6 · 10 − 4 1 . 5 · 10 − 3 8 . 3 · 10 − 6 6 2 . 07 2 . 93 2 . 00 4 . 03 3 . 8 · 10 − 4 4 . 6 · 10 − 5 3 . 8 · 10 − 4 5 . 1 · 10 − 7 7 2 . 02 2 . 98 2 . 00 4 . 01 Sino-German Symposium 2014 M. Nolte – Dune and Applications 13 / 29
Meta Grid Example: PrismGrid Idea: Meta grid formed by the tensor product of a host grid ( n d) with a 1d grid Advantages: efficient iterators for additional (structured) direction only entities for host grid be stored in memory Sino-German Symposium 2014 M. Nolte – Dune and Applications 14 / 29
Ex ample: Heat Flow on a Moving Surface Let Γ( t ) be a moving, closed surface (e.g., a deformation of S 2 ). Problem for Heat Equation: ˙ u + u ∇ Γ · w − ∇ Γ · ( D ∇ Γ u ) = 0 in Γ( · ) × ] 0 , T [ u ( · , 0 ) = u 0 in Γ( 0 ) w : domain velocity Galerkin Approximation: Find u ( t ) ∈ X G ( t ) ⊂ H 1 (Γ G ( t )) such that � � � ∂ t Γ G ( t ) u ( t ) ϕ ( t )+ Γ G ( t ) D ∇ Γ G u ( t ) · ∇ Γ G ϕ ( t ) = Γ G ( t ) u ( t ) ˙ ϕ ( t ) for all ϕ ( t ) ∈ X G ( t ) . Sino-German Symposium 2014 M. Nolte – Dune and Applications 15 / 29
Ex ample: Heat Flow on a Moving Surface Reference domain: ˆ Ω Moving domain: Ω( t ) = A (ˆ Ω , t ) Domain velocity: w ( · , t ) = A t ( A ( · , t ) − 1 , t ) Idea: Use any Dune grid to model ˆ Ω . Use a GeometryGrid and the mapping A ( · , t ) to model Ω( t ) . Advantages: No changes to the host grid (representing ˆ Ω ) No changes to our discretization Sino-German Symposium 2014 M. Nolte – Dune and Applications 16 / 29
Ex ample: Heat Flow on Moving Mesh Anisotropic heat equation on a moving domain Sino-German Symposium 2014 M. Nolte – Dune and Applications 17 / 29
Compression in a Two-Stroke Engine Sino-German Symposium 2014 M. Nolte – Dune and Applications 18 / 29
The Moving Piston SPGrid FilteredGrid<SPGrid> GeometryGrid<FilteredGrid<SPGrid» b ( t ) b ( t ) b ( t ) 1 Construct a stack of meta-grids on top of a structured grid implementation ( SPGrid ). 2 FilteredGrid enables us to filter out elements not intersection Ω t from the host grid. 3 Using GeometryGrid , we adapt the geometry of boundary elements to the exact boundary ∂ Ω t . 4 ALE formulation to treat boundary cells correctly Sino-German Symposium 2014 M. Nolte – Dune and Applications 19 / 29
The Moving Piston Solver properties: P 4 compact DG solver (CDG2) 3 rd order semi-implicit ODE solver limiter-based stabilition dimension-independent code Sino-German Symposium 2014 M. Nolte – Dune and Applications 20 / 29
Recommend
More recommend