Introduction – Computational Technologies

Introduction

The C language is a procedural general-purpose programming language with modern data structures management mechanisms and a rich set of operators. The language is not oriented to a particular hardware or operating system. It allows to write easily programs, which can be transferred to other platforms without any changes. At the beginning, a brief introduction to C is given with emphasis on its easy use in scientific and engineering computations. The essentials of the language, such as variables, data types, executable statements, functions, arrays, pointers, dynamic memory, and file management, are described.

Then we present some observations on the C++ programming language, which is derived from C. Most of C elements are not modified in C++, and therefore programs in C are usually translated by C++ compilers without any problem. The principal moment is that C is based on the concept of structured programming, whereas C++ is a fully object-oriented language. The C++ language provides flexible and efficient tools for defining custom types (classes). Classes provide encapsulation, dynamic assignment of types, memory management possibilities, and operator overloading.

The GNU Compiler Collection (GCC) compiler suite is used for translating a program from C/C++ to machine code. GCC is an open-source software distributed by Free Software Foundation (FSF). These compilers are standard not only for open source Unix-like operating systems, but also for some proprietary operating systems. Below, for these compilers, we discuss the issues of program compiling, linking, and debugging.

As a rule, software development is conducted using an integrated development environment (IDE). One of the most popular open-source IDES is Eclipse. A quick guide to Eclipse is presented in this volume. The main features for editing, compiling, debugging, and application assembling are considered.

The GNU Scientific Library (GSL) is widely employed for scientific and engineering computations. The library is written in C. Using GSL, we can solve the standard problems of computational mathematics: operations with vectors and matrices, linear algebra problems, solution of nonlinear equations, numerical differentiation and integration, interpolation, initial value problems for ODEs, and so on. That is why the use of GSL in applications is also presented here.

In the numerical solution of applied problems, special attention is given to performing data analysis and graphics. In particular, special tools are employed for visualization of calculated data. To construct plots for one- and two-dimensional functions, gnuplot is commonly used. We also employ gnuplot in our computational technologies. This software is based on its own system of commands. In addition, interactive work in command lines and implementation of scripts from files are supported. The resulting plots can be displayed on a screen or saved in files written in widely used formats (PNG and EPS). All these issues are discussed in a special chapter.

Finally, the basic features of computational technologies under discussion are illustrated with model problems. Their numerical solution begins with the formulation of the problem. Then an appropriate computational algorithm is selected. All programs are implemented in C/C++, using the GSL library. Gnuplot is employed to visualize the results of computations.