CMP 161 -- Programming Assignment 1

Due date:
Midnight, Wed, 2/15/2017

Objectives:

Learn about sparse data interpolation, scalar and vector field visualization using pseudo-coloring, contouring, and streamlines. There are two components to this assignment. The first involves writing code, while the second involves using a visualization package.

Part 1: Sparse Data Interpolation

For this part of your assignment, write a program that reads in a data file with the following information:

d			// Spatial dimension: 2 or 3. This one is a 3d example.
n m			// Number of data points, number of components per data point
V11 .. V1m x1 y1 z1	// Values and xyz coordinate of 1st data point
...
Vn1 .. Vnm xn yn zn	// Values and xyz coordinate of nth data point
xres yres zres		// Desired resolution of the resampled field

Note that for 2D fields, d=2, no z-components are specified for the data points, and zres is not specified.

Using inverse square distance Shepard's interpolation, your program should then use these points to obtain a regularly resampled (a) scalar field, if m = 1, or (b) vector field, if m > 1. The spatial extents of the resampling grid should have at least a 10 distance-units border around the bounds of the given data points. The spatial resolution of the resampled field is specified by xres, yres, and zres. Your program should output this resampled field into an output file that is readable by paraview. Link to data format here.

If m = 1, output two scalar fields. The first scalar field is the resampled value field. The second output is also a scalar field where each point in the field contains the Euclidean distance to the closest data point in the input file. Both files have the same spatial extents and resolution.

If m > 1, output a vector field. You can assume that m can be either 2 or 3. Note that you can have a 2D vector field in 3D space -- this just means that the z-component of the vector is 0. Likewise, you can have a 3D vector field in 2D space -- this just means that every vector on the plane has 3 components.

Part 2A: Scalar Field Visualization with Paraview

Here, you will have to visualize a pair of 2D scalar fields or a pair of 3D scalar fields. For the case of 2D scalar fields, at a minimum, create a heatmap image of the value field, and a contour image of the distance field. Overlay the contour image on the heatmap. Play with different heatmaps and contour levels.

For the case of 3D scalar fields, at a minimum, create an isosurfaces based on the value field, and color the isosurfaces using the distance field. Play with different heatmaps and isosurface threshold levels. Explore other ways of visualizing these scalar fields.

Part 2B: Vector Field Visualization with Paraview

Here, you will have to visualize a pair of 2D vector fields or a pair of 3D vector fields. Note that for each case, the vectors may have 2 or 3 vector components. We will treat the vector field as a velocity field. For all four combinations, calculate the velocity magnitude field using paraview utility.

For the case of 2D vector fields, create 2 types of visualizations: (1) arrow plots. Scale the arrow according to the velocity magnitude. Also encode the magnitude as arrow color. (2) streamlines. Color the streamlines using velocity magnitude. Next, color the streamlines using integration time.

For the case of 3D vector fields, also create 2 types of visualizations: (1) arrow plots, and (2) streamlines. Play with the same visual mappings as with the 2D vector fields.

Documentation

Each and every assignment should have proper documentation. Documentation includes: (i) code documentation, (ii) user documentation, (iii) technical writeup of the assignment. The 1st two items are self-explanatory and you should have experience with these from previous classes.

The 3rd item is a short technical paper, about 4-6 pages long, that describes the problem, your approach, and results. In this case, you want to talk about Shepard's interpolation, limitations/constraints and/or features of your implementation, specifications/formats of output, how the output where visualized with paraview, any combinations/customizations you used/designed, etc. Be sure to include a picture of each of the visualizations specified above. Make sure the captions are clear. Add relevant discussions about visualization choices that you've made, advantages/disadvantages of different methods, etc.

The technical paper should be a pdf file. Single spaced. You can use a single column or a double column format. Font size should be 8 or 10 points. If using single column, you can conserve space by laying out your images in a row (i.e. a row of images across the page).

Items To Submit:

Grading:

This program nominally accounts for 10% of your final grade. Programs turned in at least a full day early will earn 1% bonus credit. Late programs will not be accepted. Bonus credits may be accumulated up to a total of 50% toward program and final project credits. This program is graded 70% for functionality and correctness, 30% for experimentation, readability, documentation/writeup. Additional points may also be earned for extra features.

Submission:

Submission must be done using the submit utility from CATS (e.g. unix.ic.ucsc.edu).

Last modified Sunday, 02-Jun-2019 10:34:56 PDT.