Scientific Computing I Module 10: Algorithms and Data Storage for - - PowerPoint PPT Presentation

scientific computing i
SMART_READER_LITE
LIVE PREVIEW

Scientific Computing I Module 10: Algorithms and Data Storage for - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

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

slide-3
SLIDE 3

Lehrstuhl Informatik V

What’s Missing?

Scenario Model: ut = ∆u − f Spatial discreti- sation: 1 h2   1 1 −4 1 1   Time discretization: un+1 = un + ∂t 1

h2 [∆] un − f

  • .

Grid: What else do we need?

Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 3

slide-4
SLIDE 4

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

slide-5
SLIDE 5

Lehrstuhl Informatik V

Grid Traversal – Two Examples

line-/row-wise space-filling curves (also applicable to un- structured grids)

Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 5

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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

slide-8
SLIDE 8

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

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

slide-11
SLIDE 11

Lehrstuhl Informatik V

Storage of the Computational Grid

  • regular grid:

→ nothing to store except Nx, Ny, and Nz

  • tree-structured grid:

linearized storage: 1

  • ref.root

1

  • ref. cell l1

000000000

  • unref. cells l2

1

  • ref. cell l1

000000000

  • unref. cells l2

0000000

  • unref. cells l1

Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 11

slide-12
SLIDE 12

Lehrstuhl Informatik V

Storage of the Computational Grid (2)

  • unstructured grid:

linked lists of grid components:      elem1 elem2 . . . elemM      ց . . . ր . . .      face1 face2 . . . faceN      → ց . . . →      edge1 edge2 . . . edgeQ      ց → . . . . . .      node1 node2 . . . nodeP     

Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 12

slide-13
SLIDE 13

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

slide-14
SLIDE 14

Lehrstuhl Informatik V

Storage of the Unknowns (2)

Storage in streams and stacks in Peano:

  • utput stream

input stream temporary stacks input stream

  • utput stream

u, v, res, crit ref, crit p., res Miriam Mehl: Scientific Computing I Module 10: Algorithms and Data Storage for PDE Solvers, Winter 2011/2012 14

slide-15
SLIDE 15

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