Human-in-the-loop Data Management - Assignment 3 | CS 598, Assignments of Computer Science

Material Type: Assignment; Class: Human-in-the-loop Data Mgnt; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Fall 2005;

Typology: Assignments

Pre 2010

Uploaded on 03/16/2009

koofers-user-p34
koofers-user-p34 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 598 ANH - Calculus on Meshes
Department of Computer Science, University of Illinois at Urbana-Champaign
Fall 2005, Instructor : Anil N. Hirani
Homework 3
Posted: Saturday, Oct 29, 2005; Due : Tuesday, November 8, 2005 by end of class time.
Introduction
This is first in a series of 3 programming assignments in which we will compare traditional vertex based
finite elements with Whitney 1-forms. We will do this comparison by using the two methods to solve a
resonant cavity problem in electromagnetism. We will find the eigenvalues and eigenfunctions in a resonant
cavity. The physical setting (i.e the meaning of “resonant cavity”) will be explained in the next programming
assignment. In the next 2 programming assignments you will do the actual finite elements work. This present
homework is a preparatory step for the next 2 homeworks. In this present homework you will write Matlab
functions to (1) construct and display simplicial complexes in R2(i.e flat triangle-meshes); (2) do barycentric
subdivision of simplicial complexes; and (3) interpolate and display vector fields. The tasks are stated more
precisely below in Details.
Description of data provided by me
The data I am providing is a triangle mesh (simplicial complex of dimension 2). The mesh that the data
describes is shown in Figure 1. The data is provided on the class webpage in standard Matlab binary format
as the file mesh spec.mat. If you have trouble loading this file please let me know and I will make the ASCII
version available as well. Copy the data file mesh spec.mat to where Matlab can see it. Then you can load
the data into your Matlab “workspace” by typing, at Matlab prompt, the following :
load mesh_spec
This will cause the variables v,eand tto appear in your Matlab workspace. In the vertex matrix v, the
first and second rows contain x- and y-coordinates of the points in the mesh. In the edge matrix e, the first
and second rows contain indices of the starting and ending vertex. In the triangle matrix t, the first three
rows contain indices to the vertices, given in counter clockwise order.
Details
Problem 1: Write a Matlab function show complex(v,e,t) for displaying a simplicial complex. The
arguments of this function are as described above in the data section. Your function should produce
an output similar to Figure 1. (Hint: You may find the Matlab builtin function triplot useful.)
Problem 2: Write a Matlab function [new v, new e, new t] = bc subdivision(v,e,t) to find
the first barycentric subdivision of the mesh provided. The input arguments are the vertex, edge and
triangle matrices as specified in problem 1. The output arguments are the new vertices, edges and
faces, for the subdivided complex. For barycentric subdivision use the barycenters, i.e the point that
is the mean of the vertex locations of the simplex. Draw the subdivided complexes using the function
you wrote in Problem 1, by calling it with new v,new e and new t.
1
pf3

Partial preview of the text

Download Human-in-the-loop Data Management - Assignment 3 | CS 598 and more Assignments Computer Science in PDF only on Docsity!

CS 598 ANH - Calculus on Meshes

Department of Computer Science, University of Illinois at Urbana-Champaign

Fall 2005, Instructor : Anil N. Hirani

Homework 3

Posted: Saturday, Oct 29, 2005; Due : Tuesday, November 8, 2005 by end of class time.

Introduction

This is first in a series of 3 programming assignments in which we will compare traditional vertex based finite elements with Whitney 1-forms. We will do this comparison by using the two methods to solve a resonant cavity problem in electromagnetism. We will find the eigenvalues and eigenfunctions in a resonant cavity. The physical setting (i.e the meaning of “resonant cavity”) will be explained in the next programming assignment. In the next 2 programming assignments you will do the actual finite elements work. This present homework is a preparatory step for the next 2 homeworks. In this present homework you will write Matlab functions to (1) construct and display simplicial complexes in R^2 (i.e flat triangle-meshes); (2) do barycentric subdivision of simplicial complexes; and (3) interpolate and display vector fields. The tasks are stated more precisely below in Details.

Description of data provided by me

The data I am providing is a triangle mesh (simplicial complex of dimension 2). The mesh that the data describes is shown in Figure 1. The data is provided on the class webpage in standard Matlab binary format as the file mesh spec.mat. If you have trouble loading this file please let me know and I will make the ASCII version available as well. Copy the data file mesh spec.mat to where Matlab can see it. Then you can load the data into your Matlab “workspace” by typing, at Matlab prompt, the following :

load mesh_spec

This will cause the variables v, e and t to appear in your Matlab workspace. In the vertex matrix v, the first and second rows contain x- and y-coordinates of the points in the mesh. In the edge matrix e, the first and second rows contain indices of the starting and ending vertex. In the triangle matrix t, the first three rows contain indices to the vertices, given in counter clockwise order.

Details

  • Problem 1: Write a Matlab function show complex(v,e,t) for displaying a simplicial complex. The arguments of this function are as described above in the data section. Your function should produce an output similar to Figure 1. (Hint: You may find the Matlab builtin function triplot useful.)
  • Problem 2: Write a Matlab function [new v, new e, new t] = bc subdivision(v,e,t) to find the first barycentric subdivision of the mesh provided. The input arguments are the vertex, edge and triangle matrices as specified in problem 1. The output arguments are the new vertices, edges and faces, for the subdivided complex. For barycentric subdivision use the barycenters, i.e the point that is the mean of the vertex locations of the simplex. Draw the subdivided complexes using the function you wrote in Problem 1, by calling it with new v,new e and new t.

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2

−1.

−0.

0

1

2

Figure 1: The data specifying this mesh is provided on the class web page. It consists of matrices containing the vertex locations and the connectivity information. The boundary of the mesh is a square approximately of size π on each side with center at the origin.

  • Problem 3: Consider the vector field E : R^2 → R^2 defined as E(x, y) := (sin(x), sin(y)). Sample this vector field at the barycenters of the triangles in the original (as given in supplied data) mesh. Draw this sampled vector field as a bunch of arrows with their tails at the barycenters of the triangles. Play with scaling the lengths of the arrows so that the arrows don’t look too large or small. (Hint: You may find the Matlab function quiver to be useful for this problem.)

What to submit

There is an electronic submission AND a paper submission required. Submit the following :

  1. Send me via e-mail Matlab main program that calls the various functions and functions that you write.These functions are : show complex, bc subdivision and any supporting functions that you write.
  2. Submit a printout of the code of the above programs.