Hank Childs, University of Oregon Lecture #4 Fields, Meshes, and Interpolation (Part 3)

Slides:



Advertisements
Similar presentations
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Advertisements

Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
Hank Childs, University of Oregon November 6 th, 2013 Spatial-Based and Variable-Based Selections.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Hank Childs, University of Oregon November 15 th, 2013 Volume Rendering, Part 2.
Hank Childs, University of Oregon December 6 th, 2013 Meshes, Fields, and Interpolation, Part 2.
A Bezier Based Approach to Unstructured Moving Meshes ALADDIN and Sangria Gary Miller David Cardoze Todd Phillips Noel Walkington Mark Olah Miklos Bergou.
ICS 6N Computational Linear Algebra
CS 410 Applied Algorithms Applied Algorithms Lecture #3 Data Structures.
1 Algorithms for Large Data Sets Ziv Bar-Yossef Lecture 8 May 4, 2005
CSE351/ IT351 Modeling And Simulation Choosing a Mesh Model Dr. Jim Holten.
Scientific Visualization Data Modelling for Scientific Visualization CS 5630 / 6630 August 28, 2007.
1 CS 201 Passing Function as Parameter & Array Debzani Deb.
Drawing Parametric Curves Jean-Paul Mueller. Curves - The parametric form of a curve expresses the value of each spatial variable for points on the curve.
CS 206 Introduction to Computer Science II 02 / 11 / 2009 Instructor: Michael Eckmann.
September 23, 2010Neural Networks Lecture 6: Perceptron Learning 1 Refresher: Perceptron Training Algorithm Algorithm Perceptron; Start with a randomly.
Introducing Hashing Chapter 21 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
CSC 2300 Data Structures & Algorithms March 30, 2007 Chapter 9. Graph Algorithms.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
Please open your laptops, log in to the MyMathLab course web site, and open Daily Quiz 18. You will have 10 minutes for today’s quiz. The second problem.
Scientific Data Representation and Mapping
1 Finite-Volume Formulation. 2 Review of the Integral Equation The integral equation for the conservation statement is: Equation applies for a control.
CS Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a.
1.Definition of a function 2.Finding function values 3.Using the vertical line test.
lecture 2 : Visualization Basics
Hank Childs, University of Oregon October 3, 2014 CIS 441/541: Intro to Computer Graphics Lecture 2: The Scanline Algorithm.
Hank Childs, University of Oregon Oct. 10, 2014 CIS 441/541: Introduction to Computer Graphics Lecture 4: Interpolating Colors and the Z-buffer.
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Hank Childs, University of Oregon Lecture #6 CIS 410/510: Advection (Part 1)
Physics Honors Lecture A & B Days 08/31/15 & 09/1/15 Motion in 1D.
Hank Childs, University of Oregon Lecture #3 Fields, Meshes, and Interpolation (Part 2)
Quadrature rules 1Michael Sokolov / Numerical Methods for Chemical Engineers / Numerical Quadrature Michael Sokolov ETH Zurich, Institut für Chemie- und.
1 CS 177 Week 12 Recitation Slides Running Time and Performance.
Hank Childs, University of Oregon Lecture #10 CIS 410/510: Isosurfacing.
Hank Childs, University of Oregon Lecture #2 Fields, Meshes, and Interpolation (Part 1)
Hank Childs, University of Oregon Lecture #9 CIS 410/510: Advection (Part 4!)
Hank Childs, University of Oregon Isosurfacing (Part 3)
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 9, 2005 Lecture Number: 6.
Hank Childs, University of Oregon Unstructured Grids.
Hank Childs, University of Oregon Volume Rendering, Part 3.
Project18’s Communication Drawing Design By: Camilo A. Silva BIOinformatics Summer 2008.
Hank Childs, University of Oregon Volume Rendering, pt 1.
CS 206 Introduction to Computer Science II 10 / 02 / 2009 Instructor: Michael Eckmann.
CSC 212 Sequences & Iterators. Announcements Midterm in one week  Will cover through chapter 5 of book  Midterm will be open book, open note (but, closed.
4 Numerical Methods Root Finding Secant Method Modified Secant
CS 173, Lecture B Tandy Warnow. Topics for today Reminder about Examlet on Tuesday My office hours next week: –Tuesday 2-3 PM and Thursday 3-4 PM Office.
Advanced Visualization Overview. Course Structure Syllabus Reading / Discussions Tests Minor Projects Major Projects For.
Handle Graphics and 1D Primitives Some Handel graphics.
LECTURE 02: EVALUATING MODELS January 27, 2016 SDS 293 Machine Learning.
Copyright © 2015, 2011, 2007 Pearson Education, Inc. 1 1 Chapter 3 Equations and Inequalities in Two Variables; Functions.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
Department of Computer Science Undergraduate Events More
Adiabatic Quantum Computing Josh Ball with advisor Professor Harsh Mathur Problems which are classically difficult to solve may be solved much more quickly.
Principles of Imperative Computation Lecture 1 January 15 th, 2012.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Wednesday, Feb. 4, 2004PHYS , Spring 2004 Dr. Jaehoon Yu 1 PHYS 1441 – Section 004 Lecture #5 Wednesday, Feb. 4, 2004 Dr. Jaehoon Yu Chapter two:
Model Optimization Wed Nov 16th 2016 Garrett Morrison.
Algorithms and Problem Solving
Hank Childs, University of Oregon
Welcome to the course! Meetings and communication: AC meetings
CIS 410/510: Isosurfacing (pt 2)
Hank Childs, University of Oregon
Hank Childs, University of Oregon
Hank Childs, University of Oregon
Hank Childs, University of Oregon
Searching CLRS, Sections 9.1 – 9.3.
Searching, Sorting, and Asymptotic Complexity
Hank Childs, University of Oregon
Hank Childs, University of Oregon
Presentation transcript:

Hank Childs, University of Oregon Lecture #4 Fields, Meshes, and Interpolation (Part 3)

Outline Projects & OH Review The Data We Will Study (pt 2) – Interpolation Cell Location Project 2

Outline Projects & OH Review The Data We Will Study (pt 2) – Meshes – Interpolation Cell Location Project 2

Office Hours 1pm (today) 11:30am (tomorrow) Pls, pls come in if you are having Proj. 1 issues

& Piazza Piazza is going I have sent three s: – OH Doodle – OH announcement – Piazza – (let me know if you didn’t get any of these)

Outline Projects & OH Review The Data We Will Study (pt 2) – Meshes – Interpolation Cell Location Project 2

SciVis vs InfoVis “it’s infovis when the spatial representation is chosen, and it’s scivis when the spatial representation is given” (A) (B) (E) (C) (D)

Mesh What we want

An example mesh

Where is the data on this mesh? (for today, it is at the vertices of the triangles)

An example mesh Why do you think the triangles change size?

Anatomy of a computational mesh Meshes contain: – Cells – Points This mesh contains 3 cells and 13 vertices Pseudonyms: Cell == Element == Zone Point == Vertex == Node

Types of Meshes Curvilinear Adaptive Mesh Refinement Unstructured We will discuss all of these mesh types more later in the course.

Rectilinear meshes Rectilinear meshes are easy and compact to specify: – Locations of X positions – Locations of Y positions – 3D: locations of Z positions Then: mesh vertices are at the cross product. Example: – X={0,1,2,3} – Y={2,3,5,6} Y=6 Y=5 Y=3 Y=2 X=1X=0X=2X=3

Rectilinear meshes aren’t just the easiest to deal with … they are also very common

Quiz Time A 3D rectilinear mesh has: – X = {1, 3, 5, 7, 9} – Y = {2, 3, 5, 7, 11, 13, 17} – Z = {1, 2, 3, 5, 8, 13, 21, 34, 55} How many points? How many cells? = 5*7*9 = 315 = 4*6*8 = 192 Y=6 Y=5 Y=3 Y=2 X=1X=0X=2X=3

Definition: dimensions A 3D rectilinear mesh has: – X = {1, 3, 5, 7, 9} – Y = {2, 3, 5, 7, 11, 13, 17} – Z = {1, 2, 3, 5, 8, 13, 21, 34, 55} Then its dimensions are 5x7x9

How to Index Points Motivation: many algorithms need to iterate over points. for (int i = 0 ; i < numPoints ; i++) { double *pt = GetPoint(i); AnalyzePoint(pt); }

Schemes for indexing points Logical point indices Point indices What would these indices be good for?

How to Index Points Problem description: define a bijective function, F, between two sets: – Set 1: {(i,j,k): 0<=i<nX, 0<=j<nY, 0<=k<nZ} – Set 2: {0, 1, …, nPoints-1} Set 1 is called “logical indices” Set 2 is called “point indices” Note: for the rest of this presentation, we will focus on 2D rectilinear meshes.

How to Index Points Many possible conventions for indexing points and cells. Most common variants: – X-axis varies most quickly – X-axis varies most slowly F

Bijective function for rectilinear meshes for this course int GetPoint(int i, int j, int nX, int nY) { return j*nX + i; } F

Quiz Time #3 A vector field is defined on a mesh with dimensions 100x100 The vector field is defined with double precision data. How many bytes to store this data? = 100x100x2x8 = 160,000

Outline Projects & OH Review The Data We Will Study (pt 2) – Interpolation Cell Location Project 2

Linear Interpolation for Scalar Field F Goal: have data at some points & want to interpolate data to any location

Linear Interpolation for Scalar Field F A B F(B) F(A) X F(X)

Linear Interpolation for Scalar Field F General equation to interpolate: – F(X) = F(A) + t*(F(B)-F(A)) t is proportion of X between A and B – t = (X-A)/(B-A) A B F(B) X F(X) F(A)

Quiz Time #4 General equation to interpolate: – F(X) = F(A) + t*(F(B)-F(A)) t is proportion of X between A and B – t = (X-A)/(B-A) F(3) = 5, F(6) = 11 What is F(4)? = 5 + (4-3)/(6-3)*(11-5) = 7

Bilinear interpolation for Scalar Field F F(0,0) = 10 F(1,0) = 5 F(1,1) = 6 F(0,1) = 1 What is value of F(0.3, 0.4)? F(0.3, 0) = 8.5 F(0.3, 1) = 2.5 = 6.1 General equation to interpolate: F(X) = F(A) + t*(F(B)-F(A)) Idea: we know how to interpolate along lines. Let’s keep doing that and work our way to the middle.

Outline Projects & OH Review The Data We Will Study (pt 2) – Meshes – Interpolation Cell Location Project 2

Cell location Problem definition: you have a physical location (P). You want to identify which cell contains P. Solution: multiple approaches that incorporate spatial data structures. – Best data structure depends on nature of input data. More on this later in the quarter.

Cell location for project 2 Traverse X and Y arrays and find the logical cell index. – X={0, 0.05, 0.1, 0.15, 0.2, 0.25} – Y={0, 0.05, 0.1, 0.15, 0.2, 0.25} (Quiz) what cell contains (0.17,0.08)? = (3,1)

Facts about cell (3,1) Its cell index is 8. It contains points (3,1), (4,1), (3,2), and (4,2). Facts about point (3,1): – Its location is (X[3], Y[1]) – Its point index is 9. – Its scalar value is F[9]. Similar facts for other points.  we have enough info to do bilinear interpolation

Outline Projects & OH Review The Data We Will Study (pt 2) – Meshes – Interpolation Cell Location Project 2

Project 2: Field evaluation Goal: for point P, find F(P) Strategy in a nut shell: – Find cell C that contains P – Find C’s 4 vertices, V0, V1, V2, and V3 – Find F(V0), F(V1), F(V2), and F(V3) – Find locations of V0, V1, V2, and V3 – Perform bilinear interpolation to location P

Project 2 Assigned today, prompt online Due October 10 th, midnight (  October 11 th, 6am) Worth 7% of your grade I provide: – Code skeleton online – Correct answers provided You upload to Canvas: – source code – output from running your program

What’s in the code skeleton Implementations for: – GetNumberOfPoints – GetNumberOfCells – GetPointIndex – GetCellIndex – GetLogicalPointIndex – GetLogicalCellIndex – “main”: set up mesh, call functions, create output Our bijective function }

What’s not in the code skeleton … and a few other functions you need to implement

Interpolation for triangle meshes Two issues: – (1) how to locate triangle that contains point (discuss later) – (2) how to interpolate to value within triangle

Idea #1 More bilinear interpolation X X X

Idea #1 (cont’d) Different triangle, similar idea…

Idea #2: Barycentric Coordinates V(P) = V(A1)*t1+V(A2)*t2+V(A3)*t3) / (t1+t2+t3)

Cell-centered data

Rayleigh Taylor Instability