Data Structures for Scientific Computing Orion Sky Lawlor

  • Slides: 29
Download presentation
Data Structures for Scientific Computing Orion Sky Lawlor charm. cs. uiuc. edu 2003/12/17 1

Data Structures for Scientific Computing Orion Sky Lawlor charm. cs. uiuc. edu 2003/12/17 1

Overview Introduction and Motivation n Structured Grids n n n Unstructured Grids n n

Overview Introduction and Motivation n Structured Grids n n n Unstructured Grids n n Adaptive structured grids Adaptive unstructured grids Particles and Spatial Search Regular grids n Trees n 2

Introduction / Motivation n There are only a few ways to represent the problem

Introduction / Motivation n There are only a few ways to represent the problem domain: Structured Grids n Unstructured Grids n Particles n This set covers all our grants! n Knowing the basic terms helps you talk to application folks, and understand their stuff n 3

Grids in General 4

Grids in General 4

Grids: Introduction So you’re trying to represent some physical situation, like heat flow n

Grids: Introduction So you’re trying to represent some physical situation, like heat flow n You decide to divide up space into a bunch of little pieces: n Node, Vertex, Point Element, Cell, Volume 5

Grids: Location of Data n Element Centered Data n Fluid Dynamics, most PDEs Data

Grids: Location of Data n Element Centered Data n Fluid Dynamics, most PDEs Data values constant (or simple) in a cell n Node Centered Data n Structural dynamics/FEM “Shape function” interpolates between nodes 6

Grids: Motion of Grid and Data n Eulerian: non-moving grid n n E. g.

Grids: Motion of Grid and Data n Eulerian: non-moving grid n n E. g. , pressure waves move through the grid in CFD Lagrangian: moving grid n E. g. , grid deformation follows the structure deformation in FEM 7

Structured Grids 8

Structured Grids 8

Structured Grids: Introduction n AKA “Regular Grid”, since grid cells lie in regular rows

Structured Grids: Introduction n AKA “Regular Grid”, since grid cells lie in regular rows and columns Cells are stored in a 3 D array Cells can lie along axes (“rectilinear grid”); or curve through space Y X 9

Structured Grids: Terminology n “Stencil” of source cells to compute a destination cell Common

Structured Grids: Terminology n “Stencil” of source cells to compute a destination cell Common in fluid dynamics n Also found in PDE solvers n n j x i Read-only “Ghost” or “Dummy” cells around boundary j i 10

Structured Grids: Applications n Fluid Dynamics n n Jacobi and other PDE solvers n

Structured Grids: Applications n Fluid Dynamics n n Jacobi and other PDE solvers n n CPSD (Danzig) Image processing n n “Finite Difference” formulation Level set methods n n CSAR’s Rocflo (Jiri Blazek) Just a 2 D pixel array! Charm++ Multiblock Framework 11

Adaptive Structured Grids 12

Adaptive Structured Grids 12

Adaptive Structured Grids: Intro n n n “Adaptive Mesh Refinement”/AMR Cells are stored in

Adaptive Structured Grids: Intro n n n “Adaptive Mesh Refinement”/AMR Cells are stored in small 3 D arrays, linked together with pointers For regular refinement, use quadtree (2 D) or octree (3 D); can be irregular “block structured AMR” from LLNL SC 98 SAMRAI flier 13

Adaptive Structured Grids: Terms n “Refinement” and “Coarsening” criteria control evolution of mesh n

Adaptive Structured Grids: Terms n “Refinement” and “Coarsening” criteria control evolution of mesh n n Basically simulation error estimates “Hanging Node Constraint” n Neighbors must have similar (± 1) refinement level bad! 14

Adaptive Structured Grids: Apps n Adaptive physics solvers n CPSD Dendritic Growth (Danzig) •

Adaptive Structured Grids: Apps n Adaptive physics solvers n CPSD Dendritic Growth (Danzig) • Octree-based 3 D fluids code LLNL SAMRAI C++ Framework n NASA GSFC PARAMESH n AMRITA (James Quirk) n Charm++ AMR Framework (Narula, Jyothi) n 15

Unstructured Grids 16

Unstructured Grids 16

Unstructured Grids: Introduction n n AKA “Mesh” Cells are stored in 1 D array

Unstructured Grids: Introduction n n AKA “Mesh” Cells are stored in 1 D array Vertices (“nodes”) of cells (“elements”) listed explicitly Mesh consists of triangles and/or quadrilaterals (2 D); tetrahedra, cubes/hexahedra, prisms, pyramids (3 D) 17

Unstructured Grids: Terms n “Ghosts”, like structured grids “Shared nodes” along partition boundaries--see FEM

Unstructured Grids: Terms n “Ghosts”, like structured grids “Shared nodes” along partition boundaries--see FEM manual n “Conformality” n n Nodes never land in middle of element bad! 18

Unstructured Grids: Applications n Structural Mechanics n n Fluid Dynamics n n CSAR’s Rocflu

Unstructured Grids: Applications n Structural Mechanics n n Fluid Dynamics n n CSAR’s Rocflu (Haselbacher) Even Adaptive Meshes! n n CSAR’s Fractography (Geubelle) CPSD Dendritic Growth (Danzig) Charm++ FEM Framework (Lawlor) 19

Adaptive Unstructured Grids 20

Adaptive Unstructured Grids 20

Adaptive Unstructured Grids: Intro n n n AKA “Mesh Refinement”, shades into from-scratch “Mesh

Adaptive Unstructured Grids: Intro n n n AKA “Mesh Refinement”, shades into from-scratch “Mesh Generation” Cells still stored in 1 D arrays, but the cells can now change Must respect conformality Must ensure element “quality” Must work in parallel 21

Adaptive Meshes: Terminology n “Delaunay” mesh and “flip” n “Edge bisection”: cut edge in

Adaptive Meshes: Terminology n “Delaunay” mesh and “flip” n “Edge bisection”: cut edge in middle 22

Adaptive Meshes: Applications n Every unstructured mesh program wants to be adaptive n CSAR,

Adaptive Meshes: Applications n Every unstructured mesh program wants to be adaptive n CSAR, CPSD, etc. . . Charm++ Triangle Mesh Refinement (Wilmarth) n Charm++ PMAF 3 D (Wilmarth) n Charm++ Tet Data Transfer Library (Lawlor) n 23

Particle Methods and Spatial Search 24

Particle Methods and Spatial Search 24

Particles and Spatial Search n To work on a particle, you need nearby particles

Particles and Spatial Search n To work on a particle, you need nearby particles n E. g. , all particles within cutoff r • Used by NAMD n or, all k nearest particles • Used by SPH methods n Search for neighboring particles is spatial, so need a spatial search structure n Can use: structured grid, adaptive search tree, unstructured grid, . . . 25

. . . using Structured Grids n E. g. , NAMD molecular dynamics Particles

. . . using Structured Grids n E. g. , NAMD molecular dynamics Particles are Atoms n Search structure is based on “Patches” of space in regular, rectilinear grid n atoms over here. . . n . . . never talk to atoms over here E. g. , Charm++ Collision Library n Search structure is based on regular rectilinear voxel grid 26

. . . using Search Trees n E. g. , Cosmology simulations Particles are

. . . using Search Trees n E. g. , Cosmology simulations Particles are stars, galaxies n Search structure is a spatial octree n SPH: “Smoothed particle hydrodynamics” n Barnes-Hut gravity n “Tree walk” n 27

Conclusions 28

Conclusions 28

Conclusions n There are only a few ways to represent the problem domain: Structured

Conclusions n There are only a few ways to represent the problem domain: Structured Grids n Unstructured Grids n Particles n n There a lot of specialized terms, but very few concepts 29