Parallel Scientific Computing in C++ and MPI

Chapter 3 Overview


Book Chapter Introduction

Two of the most common tasks in scientific computing are interpolation of discrete data and approximation by known functions of the numerical solution, the source terms, and the boundary or initial conditions.  Therefore, we need to perform these tasks both accurately and efficiently.  The data are not always nicely distributed on a uniform lattice or grid, and thus we must learn how to manage these situations as well. We often use polynomials to represent discrete data as they are easy to "manipulate,'' i.e., differentiate and integrate.  However, sines and cosines as well as special functions, called wavelets, are very effective means to perform interpolation and approximation, and they have very interesting properties.

In this section, we will study different such representations and their corresponding C++ implementations.  We consider cases where the data are just sufficient to determine exactly the representation (deterministic case) as well as cases where the data are more than the information needed (overdetermined case).

Finally, we will present a more detailed discussion of MPI_Send and MPI_Recv, the two fundamental building blocks of MPI.

SCchapter3 Introduction and Chapter 3 Driver Programs

    Within the text, there are several places where the software suite is referenced.  In some cases the code is explicitly placed within the text, and at other times within the text we merely alert you that the software is available on this CD.  As you read through Chapter 3, you will find that the following function/classes were discussed.

   The declarations and definitions of these functions/classes can be found in the following files:

Go to the file SCchapter3.h for function/class declarations
Go to the file SCchapter3.cpp for function/class definitions
    In the case that an entire program (meaning that a main() function is provided) is presented in the text, we classify this as a driver program.  Unlike the functions/classes above, driver programs are complete C++ programs which can be compiled and executed.  As you read through the book, you will see that driver programs are often times created by using functions/classes which are in the SCchapter files.  We denote driver programs which are explicitly given in the text of the book in red.  In some chapters, we present very few driver programs explicitly in the text, however we provide some example driver programs which demonstrate how to use the functions/classes with in SCchapter files.  Such driver programs are denoted in black.

 
Section 3.1.2: Static array allocation, initialization, and printing chapter3c0.cpp
Section 3.1.2: Dynamic array allocation, initialization, and printing chapter3c1.cpp
Section 3.1.2: Dynamic array allocation with initialization accomplished by a library function (CreateGrid_EvenlySpaced) chapter3c2.cpp
Section 3.1.2: Program accomplishing Newton interpolation chapter3c3.cpp
Section 3.1.3: Program accomplishing Lagrange interpolation chapter3c4.cpp
Section 3.1.7: Program accomplishing Least Squares approximation (using functions) chapter3c5.cpp
Section 3.1.8: Program accomplishing Least Squares approximation (using classes) chapter3c6.cpp
Section 3.4: MPI - Program using MPI_Send and MPI_Recv chapter3c7P.cpp