1 data structures for scientific computing orion sky lawlor charm.cs.uiuc.edu 2003/12/17
TRANSCRIPT
![Page 1: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/1.jpg)
1
Data Structures for Scientific Computing
Orion Sky Lawlorcharm.cs.uiuc.edu
2003/12/17
![Page 2: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/2.jpg)
2
Overview Introduction and Motivation Structured Grids
Adaptive structured grids Unstructured Grids
Adaptive unstructured grids Particles and Spatial Search
Regular grids Trees
![Page 3: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/3.jpg)
3
Introduction / Motivation There are only a few ways to
represent the problem domain: Structured Grids Unstructured Grids Particles
This set covers all our grants! Knowing the basic terms helps
you talk to application folks, and understand their stuff
![Page 4: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/4.jpg)
4
Grids in General
![Page 5: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/5.jpg)
5
So you’re trying to represent some physical situation, like heat flow
You decide to divide up space into a bunch of little pieces:
Grids: Introduction
Element,Cell,
Volume
Node,Vertex,Point
![Page 6: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/6.jpg)
6
Element Centered Data Fluid Dynamics, most PDEs
Grids: Location of Data
Node Centered DataStructural dynamics/FEM
“Shape function” interpolates between nodes
Data values constant (or simple) in a cell
![Page 7: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/7.jpg)
7
Eulerian: non-moving grid E.g., pressure waves move
through the grid in CFD
Grids: Motion of Grid and Data
Lagrangian: moving grid E.g., grid deformation follows the
structure deformation in FEM
![Page 8: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/8.jpg)
8
Structured Grids
![Page 9: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/9.jpg)
9
AKA “Regular Grid”, since grid cells lie in regular rows and columns
Cells are stored in a 3D array Cells can lie along axes (“rectilinear
grid”); or curve through space
Structured Grids: Introduction
XY
![Page 10: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/10.jpg)
10
“Stencil” of source cells to compute a destination cell Common in fluid dynamics Also found in PDE solvers
Structured Grids: Terminology
ij
i
j x
Read-only “Ghost” or “Dummy” cells around boundary
![Page 11: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/11.jpg)
11
Fluid Dynamics CSAR’s Rocflo (Jiri Blazek)
Jacobi and other PDE solvers “Finite Difference” formulation
Level set methods CPSD (Danzig)
Image processing Just a 2D pixel array!
Charm++ Multiblock Framework
Structured Grids: Applications
![Page 12: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/12.jpg)
12
Adaptive Structured Grids
![Page 13: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/13.jpg)
13
“Adaptive Mesh Refinement”/AMR Cells are stored in small 3D arrays,
linked together with pointers For regular refinement, use
quadtree (2D) or octree (3D); can be irregular “block structured AMR”
Adaptive Structured Grids: Intro
from LLNL SC98 SAMRAI flier
![Page 14: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/14.jpg)
14
“Refinement” and “Coarsening” criteria control evolution of mesh Basically simulation error estimates
“Hanging Node Constraint” Neighbors must have similar (±1) refinement level
Adaptive Structured Grids: Terms
bad!
![Page 15: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/15.jpg)
15
Adaptive physics solvers CPSD Dendritic Growth (Danzig)
•Octree-based 3D fluids code
LLNL SAMRAI C++ Framework NASA GSFC PARAMESH AMRITA (James Quirk) Charm++ AMR Framework
(Narula, Jyothi)
Adaptive Structured Grids: Apps
![Page 16: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/16.jpg)
16
Unstructured Grids
![Page 17: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/17.jpg)
17
Unstructured Grids: Introduction
AKA “Mesh” Cells are stored in 1D array Vertices (“nodes”) of cells
(“elements”) listed explicitly Mesh consists of triangles
and/or quadrilaterals (2D); tetrahedra, cubes/hexahedra, prisms, pyramids (3D)
![Page 18: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/18.jpg)
18
“Ghosts”, like structured grids “Shared nodes” along partition boundaries--
see FEM manual
“Conformality” Nodes never land in middle of element
Unstructured Grids: Terms
bad!
![Page 19: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/19.jpg)
19
Structural Mechanics CSAR’s Fractography (Geubelle)
Fluid Dynamics CSAR’s Rocflu (Haselbacher)
Even Adaptive Meshes! CPSD Dendritic Growth (Danzig)
Charm++ FEM Framework (Lawlor)
Unstructured Grids: Applications
![Page 20: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/20.jpg)
20
Adaptive Unstructured Grids
![Page 21: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/21.jpg)
21
Adaptive Unstructured Grids: Intro
AKA “Mesh Refinement”, shades into from-scratch “Mesh Generation”
Cells still stored in 1D arrays, but the cells can now change
Must respect conformality Must ensure element “quality” Must work in parallel
![Page 22: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/22.jpg)
22
“Delaunay” mesh and “flip”
“Edge bisection”: cut edge in middle
Adaptive Meshes: Terminology
![Page 23: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/23.jpg)
23
Every unstructured mesh program wants to be adaptive CSAR, CPSD, etc...
Charm++ Triangle Mesh Refinement (Wilmarth)
Charm++ PMAF3D (Wilmarth) Charm++ Tet Data Transfer
Library (Lawlor)
Adaptive Meshes: Applications
![Page 24: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/24.jpg)
24
Particle Methods and Spatial Search
![Page 25: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/25.jpg)
25
Particles and Spatial Search
To work on a particle, you need nearby particles E.g., all particles within cutoff r
•Used by NAMD or, all k nearest particles
•Used by SPH methods
Search for neighboring particles is spatial, so need a spatial search structure Can use: structured grid, adaptive
search tree, unstructured grid, ...
![Page 26: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/26.jpg)
26
... using Structured Grids E.g., NAMD molecular dynamics
Particles are Atoms Search structure is based on
“Patches” of space in regular, rectilinear grid
E.g., Charm++ Collision Library Search structure is based on
regular rectilinear voxel grid
atoms over here...
...never talk to atoms over here
![Page 27: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/27.jpg)
27
... using Search Trees E.g., Cosmology simulations
Particles are stars, galaxies Search structure is a spatial octree
SPH: “Smoothed particle hydrodynamics”
Barnes-Hut gravity “Tree walk”
![Page 28: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/28.jpg)
28
Conclusions
![Page 29: 1 Data Structures for Scientific Computing Orion Sky Lawlor charm.cs.uiuc.edu 2003/12/17](https://reader036.vdocuments.us/reader036/viewer/2022070408/56649e595503460f94b52851/html5/thumbnails/29.jpg)
29
Conclusions There are only a few ways to
represent the problem domain: Structured Grids Unstructured Grids Particles
There are a lot of specialized terms, but very few concepts