Compute the total volume betwen the two surfaces

Assignment Help Computer Engineering
Reference no: EM131458469

Introduction

Bézier surfaces are a way of sculpting shapes. Because they are analytically defined, they can be computed (and rendered) to any precision you want. In this project, we are going to take these two Bézier surfaces:

and use numerical techniques to find the volume between the bottom surface (red) and the top surface (yellow). Using some number of subdivisions in both X and Y, NUMNODESxNUMNODES, take NUMNODES2 height samples.

We will think of each height sample as sitting on a 2D tile. That really makes that height sample act as a volume where the tile is extruded
vertically from the bottom to the top.

The tiles in the middle of the floor are full-sized tiles. Tiles along the edges are half-sized. Tiles in the corners are quarter-sized. The volume contribution of each extruded height tile needs to be weighted accordingly. The logic of this is for you to figure out.

Requirements

- Using OpenMP, compute the total volume betwen the two surfaces.

- Use a variety of number of subdivisions (NUMNODES). Pick at least 8 different ones.

- Use a variety of number of threads (NUMT). You must use at least 1, 2, and 4.

- Record the data in units of something that gets larger as speed increases. Joe Parallel used "MegaHeights Computed Per Second", but you can use anything that makes sense.

- From the speed-up that you are seeing, use the "Inverse Amdahl's Law" to determine the Parallel Fraction for this application.

- From the Parallel Fraction, determine what maximum speed-up you could ever get, even with a million cores.

- Your commentary write-up (turned in as a PDF file) should include:

1. Tell what machine you ran this on

2. What do you think the actual volume is?

3. Show the performances you achieved in tables and graphs as a function of NUMNODES and NUMT

4. What patterns are you seeing in the speeds?

5. Why do you think it is behaving this way?

6. What is the Parallel Fraction for this application, using the Inverse Amdahl equation?

7. Given that Parallel Fraction, what is the maximum speed-up you could ever get?

The Height-Evaluation Code

In this code sample, NUMNODES is the number of nodes, or dots, subdividing the floor area. So, for example, NUMNODES=4 means that there are 4 dots on each side edge.

Each node has some amount of tile space surrounding it.

I recommend a single for-loop over all the nodes that looks like this:

#pragma omp parallel for
for( int i = 0; i < NUMNODES*NUMNODES; i++ )
{
int iu = i % NUMNODES; int iv = i / NUMNODES;

. . .
}

Depending on what version of OpenMP you are using, you can also say:


#pragma omp parallel for collapse(2) for( int iv = 0; iv < NUMNODES; iv++ )
{
for( int iu = 0; iu < NUMNODES; iu++ )
{
. . .
}
}

Note! The above pragma lines are not complete. You need to add more to them! The code to evaluate the height at a given iu and iv is:

#define XMIN 0.
#define XMAX 3.
#define YMIN 0.
#define YMAX 3.
#define TOPZ00 0.
#define TOPZ10 1.
#define TOPZ20 0.
#define TOPZ30 0.
#define TOPZ01 1.
#define TOPZ11 6.
#define TOPZ21 1.
#define TOPZ31 0.
#define TOPZ02 0.
#define TOPZ12 1.
#define TOPZ22 0.
#define TOPZ32 4.
#define TOPZ03 3.
#define TOPZ13 2.
#define TOPZ23 3.
#define TOPZ33 3.
#define BOTZ00 0.
#define BOTZ10 -3.
#define BOTZ20 0.

#define BOTZ30 0.
#define BOTZ01 -2.
#define BOTZ11 10.
#define BOTZ21 -2.
#define BOTZ31 0.
#define BOTZ02 0.
#define BOTZ12 -5.
#define BOTZ22 0.
#define BOTZ32 -6.
#define BOTZ03 -3.
#define BOTZ13 2.
#define BOTZ23 -8.
#define BOTZ33 -3.

float Height(
{
int iu, float u

int iv ) // iu,iv = 0 .. NUMNODES-1

= (float)iu / (float)(NUMNODES-1);
float v = (float)iv / (float)(NUMNODES-1);
// the basis functions:

float bu0 = (1.-u) * (1.-u) * (1.-u);
float bu1 = 3. * u * (1.-u) * (1.-u); float bu2 = 3. * u * u * (1.-u); float bu3 = u * u * u;

float bv0 = (1.-v) * (1.-v) * (1.-v);
float bv1 = 3. * v * (1.-v) * (1.-v); float bv2 = 3. * v * v * (1.-v); float bv3 = v * v * v;

// finally, we get to compute something:


float top = bu0 * ( bv0*TOPZ00 + bv1*TOPZ01 + bv2*TOPZ02 + bv3*TOPZ03 )
+ bu1 * ( bv0*TOPZ10 + bv1*TOPZ11 + bv2*TOPZ12 + bv3*TOPZ13 )
+ bu2 * ( bv0*TOPZ20 + bv1*TOPZ21 + bv2*TOPZ22 + bv3*TOPZ23 )
+ bu3 * ( bv0*TOPZ30 + bv1*TOPZ31 + bv2*TOPZ32 + bv3*TOPZ33 );

float bot = bu0 * ( bv0*BOTZ00 + bv1*BOTZ01 + bv2*BOTZ02 + bv3*BOTZ03 )
+ bu1 * ( bv0*BOTZ10 + bv1*BOTZ11 + bv2*BOTZ12 + bv3*BOTZ13 )
+ bu2 * ( bv0*BOTZ20 + bv1*BOTZ21 + bv2*BOTZ22 + bv3*BOTZ23 )
+ bu3 * ( bv0*BOTZ30 + bv1*BOTZ31 + bv2*BOTZ32 + bv3*BOTZ33 );

return top - bot; // if the bottom surface sticks out above the top surface
// then that contribution to the overall volume is negative
}

The main Program

Your main program would then look something like this:


float Height( int, int );

int main( int argc, char *argv[ ] )
{
. . .

// the area of a single full-sized tile:

float fullTileArea = ( ( (XMAX-XMIN)/(float)(NUMNODES-1) ) * ( ( YMAX - YMIN )/(float)(NUMNODES-1) ) );

// sum up the weighted heights into the variable "volume"
// using an OpenMP for loop and a reduction:

?????
}

Verified Expert

This Project is implemented in C++ language. In this project, I have parallelized the code of computing the volume bounded by Bezier surfaces. To parallelize the code I have used openmp library which provides the API for setting the number of threads on which the code needs to be run.In this program I have parallelized using 1,2,4 and 8 threads. Further, I have 10 different subdivisions to compute the volume of Bezier surface. For each subdivision, I have calculated the speed of execution. I have compared speed. Further, I have plotted the graph showing variation in speed estimated vs the number of subdivisions and number of threads.

Reference no: EM131458469

Questions Cloud

Prepare a table of future taxable and deductible amounts : prepared a reconciliation between pretax financial income and taxable income as follows. Prepare a table of future taxable and deductible amounts.
What features would you want to incorporate into web site : Assume your team is assigned to develop the Web site for a large online clothing retailer that also has traditional retail stores. Research the characteristics.
Analyze the terms of the western digital offering : Analyze the terms of the Western Digital offering. How can it be that arbitrage opportunities persist in deep and liquid markets such as the US Treasuries one
Determining the voice of the customer : In the "Understanding the Voice of the Customer at LaRosa's Pizzerias" case study found in your textbook
Compute the total volume betwen the two surfaces : compute the total volume betwen the two surfaces - Show the performances you achieved in tables and graphs as a function of NUMNODES and NUMT
What is the job of oxygen and how is water produced : What is the job of oxygen? How is water produced? In the electron transport system, H+ ions are pumped across the mitochondrial membrane.
How would you classify the crimes of each of the individuals : What crimes, if any, should Joe, Larry and Bob be charged with as a result of their conduct? Be sure to include a discussion of actus reus.
Sketch out what the firms web site should look like : Working with a small group, assume your group designs e-business Web sites. Identify a local company that operates with little or no online presence.
Identify and visit ten different e-business web sites : Working with a partner, identify and visit ten different e-business Web sites. These can be either B2C or B2B sites. Which of these sites, in your opinion.

Reviews

inf1458469

4/26/2017 5:27:50 AM

Exceptionally proficient, made a stunning solution with regards to on the paper. He comprehended the task and completed paper before due date allocated. I will utilize his administrations once more. Best administration yet!

len1458469

4/11/2017 5:11:28 AM

Grading: Feature Results for a variety of NUMNODES values 30 Results for a variety of NUMT values 30 Commentary, including tables, graphs, correct volume, Parallel Fraction, and ultimate speedup 40 Potential Total 100

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd