George Mason University

Skip Navigation

CSI 501 - Fall 2012:
Introduction to Scientific Programming

Instructor

Fernando E. Camelli
Email: fcamelli@gmu.edu
Phone: 703-993-4073
Hours: Wednesdays from 3:00 pm to 4:00 pm, or by appointment

Prerequisites

  • Admission to an undergraduate/graduate program or permission of instructor

Description

This course focuses on elements of programming using C and Fortran languages. The main goal of this class is to familiarize students with basic concepts of programming in computational sciences. Students who complete this course should be able to develop their own code, program algorithms, manage the input and output of data, as well as compile and link codes with other libraries (i.e. LAPACK).

After taking this course, students should have an understanding of basic concepts for computational programming and basic/advanced programming skills to implement algorithms widely used in computational science problems.

The following topics will be covered: basics of programming, prototyping, and algorithm programming. The programming concepts will be applied to basic problems in computational sciences, including computational geometry and computational mathematics.

In order to take this class, students must be familiar with basic concepts of analytic geometry and calculus, matrix algebra, and elementary differential equations.

Syllabus

Programming Topics

  • Introduction to programming, pseudo code, basic logic for programming. Concept of variable and array in C and Fortran. Basics of compilation.
  • C and Fortran programming structures and styles.
  • Operators and expressions, variable names and constants in C Fortran.
  • First program “hello world” in C and Fortran.
  • Control of flow and logical expressions in C and Fortran. Statements and blocks, if-else, else-if, switch, loops - while and for, loops - do - while, break and continue (Taylor’s expansion of functions, numerical integration of functions, and calculation of series).
  • Functions in C and Fortran. Basic of functions, return variables, external variables, scope, static variables (trigonometry functions and computational geometry problems).
  • Pointers and arrays in C and Fortran. One-dimensional arrays vs. multidimensional arrays (vectors and matrices, spares matrix basics, conjugate-gradient methods).
  • Data structures and types in C and Fortran. Derived data structures (application to complex numbers, data structures: arrays, linked lists, binary trees, and heap data structure).
  • Input/output in ASCII and binary format in C and Fortran. File processing.
  • C and Fortran preprocessor. Linking with other libraries (LAPACK, basic MPI).
  • Debugging and profiling tools. Management of projects using make.
  • Calling Fortran subroutines from C. Calling C subroutine from Fortran. Linking C and Fortran modules.

Scientific Topics

  • Computational Geometry: polygon triangulation and partitioning, search and intersection, point location, geometric data structures (quadtrees, octrees, interval trees, segment trees, multi-level trees, kd-trees, range trees), distance fields, etc.
  • Computational Mathematics: system of equations (Gauss elimination, LU factorization, partial pivoting, sparse matrices), interpolation, numerical differentiation and integration (finite difference, trapezoid’s rule, Simpson’s rule), ordinary differential equations.

Recommended Bibliography

  • C Programming Language,
    by B. W. Kernighan, and D. M. Ritchie.
  • Fortran 95/2003 Explained,
    by M. Metcalf, J. Reid, and M Cohen.
  • The Fortran 2003 Handbook,
    by J. C. Adams, W. S. Brainerd, J. T. Martin, R. A. Hendrickson, and R. E Maine.
  • Computational Geometry in C,
    by J. O'Rourke.
  • Computational Geometry: Algorithms and Applications,
    by M. de Berg, M. van Kreveld, M. Overmars, and O. Schwarzkopf.
  • Python Scripting for Computational Science,
    by H. P. Langtangen

  • Algorithms in C,
    by R. Sedgewick.
  • Memory as a Programming Concept in C and C++,
    by F. Franek.
  • Geometric Data Structures for Computer Graphics,
    by E. Langetepe, and G. Zachmann
  • C: A Reference Manual,
    by S. P. Harbison III, and G. L. Steele Jr.
  • Numerical Analysis,
    by T. Sauer

Honor Code

As in any class, you are allowed to study with other students. However, tests and homework assignments (unless otherwise specified) must be completed on your own. SPECIFICALLY - YOU MAY NOT COPY ANY TEXT OR MATERIAL AND REPRESENT IT AS YOUR OWN WORK. For both papers and for code, you may reference or link to other peoples work (if it is consistent with the assignment), but you MUST cite the source it came from. Failure to follow these guidelines will be considered a violation of GMU's academic honor code and will be treated as such.

Class Material

    The class notes will be posted in Blackboard.

Grading

  • Homeworks - 70%
  • Final Exam - 30%

Office hours

Wednesdays from 3:00 pm to 4:00 pm

Useful Links