Lehrstuhl Informatik V Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers Miriam Mehl Winter 2011/2012 Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 1
Lehrstuhl Informatik V Part I: Algorithms for PDE Solvers Model + Discretization + Grid: What’s Missing? Grid Traversal Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 2
Lehrstuhl Informatik V What’s Missing? Scenario Spatial discreti- sation: Model: 1 1 u t = ∆ u − f 1 − 4 1 h 2 1 Grid: Time discretization: � 1 � u n + 1 = u n + ∂ t h 2 [∆] u n − f . What else do we need? Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 3
Lehrstuhl Informatik V What’s Missing (2)? • How to travers the grid? • How to store and access data? • How to assemble and store the system matrix? • How to evaluate stencils? • How to solve the (non-)linear system of equations? Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 4
Lehrstuhl Informatik V Grid Traversal – Two Examples space-filling curves (also applicable to un- structured grids) line-/row-wise Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 5
Lehrstuhl Informatik V Space-Filling Curve Grid Traversal • broad applicability (regular, adaptive, structures, unstructured grids) • efficient recursive construction • locality properties • quasi-optimal grid partitioning • locality of data-access (cache!) Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 6
Lehrstuhl Informatik V Iterator Grid Traversal • travers lists of elements, faces, edges, nodes, boundary elements,... • possible for all kinds of grids • very flexible • traverses a single grid level → extra work for restrictions/interpolations • widely used in frameworks allowing for the usage of different grid types (DUNE, Sundance,...) Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 7
Lehrstuhl Informatik V Recursive Grid Traversal • follow the tree-structure of a grid (usually depth-first) • applicable for tree-structured grids • traverses all grid-levels → allows for inter-level operations (restriction, interpolation) Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 8
Lehrstuhl Informatik V Part II: Data Storage for PDE Solvers Data Storage and Access Storage of the Computational Grid Storage of the Unknowns Storage of the System Matrix Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 9
Lehrstuhl Informatik V Data Storage and Access What do we have to store? • the computational grid • values of unknowns and auxiliary variables (residuals,...) • system matrices Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 10
Lehrstuhl Informatik V Storage of the Computational Grid • regular grid: → nothing to store except N x , N y , and N z • tree-structured grid: linearized storage: 1 1 000000000 1 000000000 0000000 ���� ���� � �� � ���� � �� � � �� � ref.root ref. cell l1 unref. cells l2 ref. cell l1 unref. cells l2 unref. cells l1 Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 11
Lehrstuhl Informatik V Storage of the Computational Grid (2) • unstructured grid: linked lists of grid components: ց ց elem 1 face 1 → edge 1 node 1 . → . elem 2 face 2 ց edge 2 node 2 . . . . . . . . . . . . . ր . . . . . . . . elem M . face N edge Q . node P → . . Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 12
Lehrstuhl Informatik V Storage of the Unknowns ... and auxiliary values such as residuals, old time step values,... • arrays/vectors → regular structured grids • hashtable → unstructured / (dynamically) adaptive grids • streams / stacks → optimal data locality (cache!) → possible in special cases Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 13
Lehrstuhl Informatik V Storage of the Unknowns (2) Storage in streams and stacks in Peano: input stream output stream temporary stacks u, v, res, crit p., res ref, crit input stream output stream Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 14
Lehrstuhl Informatik V Storage of the System Matrix • dense matrix format • sparse matrix format • matrix-free Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 15
Recommend
More recommend