Solving_PDEs_in_C++.pdf
(
22139 KB
)
Pobierz
Solving PDEs in C++
COMPUTATIONAL SCIENCE & ENGINEERING
Computational Science and Engineering (CS&E) is widely accepted, along with theory and experiment,
as a crucial third mode of scientific investigation and engineering design. This series publishes research
monographs, advanced undergraduate- and graduate-level textbooks, and other volumes of interest to a
wide segment of the community of computational scientists and engineers.The series also includes volumes
addressed to users of CS&E methods by targeting specific groups of professionals whose work relies
extensively on computational science and engineering.
Editor-in-Chief
Omar Ghattas
University of Texas–Austin
Editorial Board
David Keyes, Associate Editor
Columbia University
Kim Baldridge
San Diego State University and
University of Zurich
Lori Freitag Diachin
Lawrence Livermore National Laboratory
Charbel Farhat
University of Colorado–Boulder
James Glimm
SUNY–Stony Brook
Teresa Head-Gordon
University of California–Berkeley and
Lawrence Berkeley National Laboratory
Rolf Jeltsch
ETH Zurich
Chris Johnson
University of Utah
Laxmikant Kale
University of Illinois
Jelena Kovacevic
Carnegie Mellon University
Habib Najm
Sandia National Laboratory
Alan Needleman
Brown University
Alex Pothen
Old Dominion University
Mary Wheeler
University of Texas–Austin
Series Volumes
Shapira,Yair,
Solving PDEs in
C++
: Numerical Methods in a Unified Object-Oriented Approach
Solving PDEs in C++
Numerical Methods in a
Unified Object-Oriented Approach
Yair Shapira
Technion–Israel Institute of Technology
Haifa, Israel
Copyright © 2006 by the Society for Industrial and Applied Mathematics.
10 9 8 7 6 5 4 3 2 1
All rights reserved. Printed in the United States of America. No part of this book may be
reproduced, stored, or transmitted in any manner without the written permission of the
publisher. For information, write to the Society for Industrial and Applied Mathematics,
3600 University City Science Center, Philadelphia, PA 19104-2688.
The examples represented in this book have been included for their instructional value.
They have been tested with care but are not guaranteed for any particular purpose. The
publisher does not offer any warranties or representations, nor does it accept any liabilities
with respect to use of the examples.
MATLAB is a registered trademark of The MathWorks, Inc. and is used with permission.
The MathWorks does not warrant the accuracy of the text or exercises in this book.
This book’s use or discussion of MATLAB software or related products does not constitute
endorsement or sponsorship by The MathWorks of a particular pedagogical approach or
particular use of the MATLAB software. For MATLAB information, contact The MathWorks,
3 Apple Hill Drive, Natick, MA 01760-2098 USA,Tel: 508-647-7000, Fax: 508-647-7001
info@mathworks.com, www.mathworks.com
Windows is a registered trademark of Microsoft Corporation in the United States and/or
other countries.
Library of Congress Cataloging-in-Publication Data
Shapira,Yair, 1960-
Solving PDEs in C++ : numerical methods in a unified object-oriented approach / Yair
Shapira.
p. cm. — (Computational science and engineering)
Includes bibliographical references and index.
ISBN 0-89871-601-2 (pbk. : alk. paper)
1. Differential equations, Partial. 2. C++ (Computer program language) 3.
Object-oriented programming (Computer science) I.Title: Solving partial differential
equations in C++. II.Title. III. Series.
QA377.S466 2006
518’.64’02855133—dc22
2005054086
Partial royalties from the sale of this book are placed in a fund to help students
attend SIAM meetings and other SIAM-related activities.This fund is administered
by SIAM, and qualified individuals are encouraged to write directly to SIAM for
guidelines.
Contents
List of Figures
xiii
List of Tables
xxi
Preface
xxiii
I
Programming
1
1
Introduction to C
7
1.1
Variables and Types
...........................
7
1.2
Assignment
...............................
8
1.3
Initialization ...............................
8
1.4
Conversion ................................
9
1.5
Arithmetic Operations ..........................
9
1.6
Functions ................................. 11
1.7
Printing Output
............................. 13
1.8
Conditions ................................ 14
1.9
Scope of Variables ............................ 15
1.10
Loops
.................................. 17
1.11
Examples with Loops
.......................... 19
1.12
Example: Reversed Integer
....................... 20
1.13
Pointers
................................. 22
1.14
Arrays
.................................. 23
1.15
Passing Arguments to Functions ..................... 24
1.16
I/O
.................................... 25
1.17
Recursion
................................ 26
1.18
Example: Binary Representation
.................... 27
1.19
Example: Pascal’s Triangle
....................... 29
1.20
Example: Local Maximum
....................... 30
1.21
Example: Arithmetic Expression
.................... 36
1.22
Example: The Exponent Function .................... 40
1.23
Exercises ................................. 43
v
Plik z chomika:
newk
Inne pliki z tego folderu:
C++_cookbook.pdf
(22184 KB)
Solving_PDEs_in_C++.pdf
(22139 KB)
Programming_in_Objective-C.rar
(12859 KB)
Qt_C++_Gui_Prog.rar
(21867 KB)
Optimizing_C++.pdf
(11203 KB)
Inne foldery tego chomika:
bezpieczenstwo
shell scripting
Zgłoś jeśli
naruszono regulamin