Scientific Software Design: The Object-Oriented Way

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This book concerns software design. Although many current discussions of scientific programming focus on scalable performance, this book focuses on scalable design. The authors analyze how the structure of a package determines its developmental complexity according to such measures as bug search times and documentation information content. The work presents arguments for why these issues impact solution cost and time more than does scalable performance. The final chapter explores the question of scalable execution and shows how scalable design relates to scalable execution. The book's focus is on program organization, which has received considerable attention in the broader software engineering community, where graphical description standards for modeling software structure and behavior have been developed by computer scientists. These discussions might be enriched by engineers who write scientific codes. This book aims to bring such scientific programmers into discussion with computer scientists. The authors do so by introducing object-oriented software design patterns in the context of scientific simulation.

Author(s): Damian Rouson, Jim Xia, Xiaofeng Xu
Edition: 1
Publisher: Cambridge University Press
Year: 2011

Language: English
Pages: 406
Tags: Информатика и вычислительная техника;Технология программирования;

Half-title......Page 3
Title......Page 5
Copyright......Page 6
Dedication......Page 7
Contents......Page 9
List of Figures......Page 13
List of Tables......Page 17
Preface......Page 19
Acknowledgment......Page 23
Disclaimer......Page 24
PART I: The Tao of Scientific OOP......Page 25
1.1 Introduction......Page 27
1.2 Conventional Scientific Programming Costs......Page 31
1.3 Conventional Programming Complexity......Page 35
1.4 Alternative Programming Paradigms......Page 43
1.5 How Performance Informs Design......Page 48
1.6 How Design Informs Performance......Page 49
1.7 Elements of Style......Page 51
EXERCISES......Page 54
2.1 Nomenclature......Page 55
2.2 Object-Oriented Analysis and Design......Page 57
2.3 Encapsulation and Information Hiding......Page 60
2.4 Wrapping Legacy Software......Page 64
2.5 Composition, Aggregation, and Inheritance......Page 72
2.6 Static and Dynamic Polymorphism......Page 77
2.7 OOP Complexity......Page 78
2.8 More on Style......Page 79
EXERCISES......Page 80
3.1 Abstract Data Type Calculus......Page 81
3.2 Analysis-Driven Design......Page 90
3.2.1 Design Metrics......Page 93
3.2.2 Complexity Theory......Page 95
3.2.3 Information Theory......Page 97
3.3 Still More on Style......Page 101
3.4 The Tao of SOOP......Page 103
EXERCISES......Page 104
PART II: SOOP TO NUTS AND BOLTS......Page 107
4.1 Essentials......Page 109
4.2 Foundations......Page 110
4.2.1 Building Architecture......Page 111
4.2.2 Software Architecture......Page 117
4.2.3 Scientific Software Architecture......Page 122
4.3 Canonical Contexts......Page 123
4.3.1 The Lorenz Equations: A Chaotic Dynamical System......Page 124
4.3.2 Quantum Vortex Dynamics in a Super fluid......Page 126
4.3.3 Burgers’ Equation: Shock Formation and Dissipation......Page 128
EXERCISES......Page 130
5.1 The Problem......Page 131
5.2 The Solution......Page 132
5.2.1 Fortran Implementation......Page 134
5.2.2.1 Reference Counting......Page 140
5.2.3 C++ Implementation of Vortex......Page 146
5.4 Related Patterns......Page 151
EXERCISES......Page 152
6.1 The Problem......Page 153
6.2 The Solution......Page 154
6.2.1 Fortran Implementation......Page 155
6.2.2 C++ Implementation......Page 161
6.3 The Consequences......Page 164
6.4 Related Patterns......Page 165
EXERCISES......Page 166
7.1 The Problem......Page 167
7.2 The Solution......Page 168
7.2.1 Fortran Implementation......Page 170
7.2.2 C++ Implementation......Page 179
7.4 Related Patterns......Page 188
EXERCISES......Page 189
8.1 The Problem......Page 191
8.2 The Solution......Page 193
8.2.1 Fortran Implementation......Page 194
8.2.2 A C++ Tool: 2D Allocatable Arrays......Page 209
8.2.3 C++ Implementation......Page 215
8.3 The Consequences......Page 223
EXERCISES......Page 225
9.1 The Problem......Page 226
9.2 The Solution......Page 227
9.2.1 Fortran Implementation......Page 229
9.2.2 C++ Implementation......Page 240
9.3 The Consequences......Page 250
9.4 Related Patterns......Page 251
EXERCISES......Page 252
PART III: Gumbo SOOP......Page 253
10.1 Why Be Formal?......Page 255
10.2 Problem Statement......Page 257
10.3 Side Effects in Abstract Calculus......Page 261
10.4.1 Modeling Arrays with OCL......Page 262
10.4.2 Hermeticity......Page 263
10.4.3 Economy......Page 266
10.5 The Shell Pattern......Page 268
10.6 An Assertion Utility for Fortran......Page 269
10.7 Case Study: A Fluid Turbulence Solver......Page 271
EXERCISES......Page 274
11.1 Automated Interoperability Tools......Page 275
11.2 Manual Interoperability: C++/Fortran 95......Page 278
11.3 Case Study: ForTrilinos and CTrilinos......Page 283
11.3.1 C Interoperability in Fortran 2003......Page 285
11.3.2 Method Invocation......Page 293
11.3.3 Tabulation, Construction, and Destruction......Page 297
11.3.4 Polymorphism and Hierarchy Mirroring......Page 302
11.3.5 Discussion......Page 305
EXERCISES......Page 308
12.1 Toward a Scalable Abstract Calculus......Page 309
12.1.1 Amdahl’s Law and Parallel Efficiency......Page 310
12.1.2 Automatic Parallelization: Compiler Technology......Page 316
12.1.3 Directive-Based Parallelization: OpenMP......Page 319
12.1.4 Library-Based Parallelization: ForTrilinos and MPI......Page 321
12.1.5 Intrinsic Parallelization: Fortran 2008 Coarrays......Page 333
12.2 Case Studies: Multiphysics Modeling......Page 341
12.2.1 Quantum Turbulence in Super fluid Liquid Helium......Page 342
12.2.2 Lattice-Boltzman Biofluid Dynamics......Page 345
12.2.3 Particle Dispersion in Magnetohydrodynamics......Page 349
12.2.4 Radar Scattering in the Atmospheric Boundary Layer......Page 350
12.3 The Morfeus Framework......Page 354
EXERCISES......Page 357
A.1.1 Lagrange Interpolation......Page 359
A.2.1 Gaussian Elimination......Page 361
A.2.2 LU Decomposition......Page 366
A.3.1 Newton’s Method in 1D......Page 367
A.3.2 Newton’s Method in Multiple Dimensions......Page 368
A.4.1 The Heat Equation......Page 369
A.4.2 The Burgers Equation......Page 370
A.5.1 Finite Differences......Page 371
A.5.2.1 Euler Method......Page 374
A.5.2.2 Trapezoidal Method......Page 376
A.5.2.3 Runge-Kutta Method......Page 377
A.5.2.4 Semi-implicit Methods......Page 378
A.5.2.5 Stability of PDE solvers......Page 379
B.1 Use Case Diagrams......Page 381
B.2.1 Classes......Page 383
B.2.2.1 Dependency......Page 386
B.2.2.2 Generalization and Realization......Page 387
B.2.2.3 Association......Page 388
B.3 Object Diagrams......Page 390
B.4 Sequence Diagrams......Page 391
B.4.2 Sequence Diagrams......Page 392
B.5.1 The Context of OCL Expression......Page 394
B.5.4 Adding Pre- and Postconditions to Operations......Page 395
Bibliography......Page 397
Index......Page 403