|
Part I Introduction to Scientific Python |
|
|
|
|
3 | (12) |
|
|
3 | (1) |
|
|
4 | (1) |
|
1.3 Programming or Scripting |
|
|
5 | (1) |
|
|
5 | (3) |
|
1.4.1 IPython: Interactive Python |
|
|
6 | (2) |
|
|
8 | (2) |
|
|
10 | (1) |
|
1.6.1 Importing Libraries |
|
|
11 | (1) |
|
1.7 NumPy: Numerical Python |
|
|
11 | (1) |
|
|
12 | (3) |
|
|
13 | (1) |
|
|
13 | (2) |
|
|
15 | (20) |
|
2.1 The MatPlotLib Visualization Library |
|
|
16 | (8) |
|
2.1.1 Plotting a 2D Field |
|
|
17 | (1) |
|
|
18 | (2) |
|
|
20 | (2) |
|
2.1.4 Plotting a Seismic Waveform |
|
|
22 | (2) |
|
2.2 Plotting in 3D with MatPlotLib |
|
|
24 | (3) |
|
|
26 | (1) |
|
2.3 Example: Length of the Day |
|
|
27 | (2) |
|
2.4 IPython and Jupyter Notebooks |
|
|
29 | (1) |
|
|
30 | (1) |
|
2.6 Python as a wrapper: SEATREE and Underworld |
|
|
31 | (4) |
|
|
32 | (1) |
|
|
32 | (3) |
|
3 Fast Python: NumPy and Cython |
|
|
35 | (28) |
|
3.1 How Fast is Your Computing Machine? |
|
|
36 | (1) |
|
|
37 | (5) |
|
|
38 | (1) |
|
|
39 | (3) |
|
|
42 | (5) |
|
3.3.1 N-Dimensional Indexing |
|
|
44 | (1) |
|
|
44 | (2) |
|
3.3.3 Transposing and Axis Rotation |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
48 | (2) |
|
|
50 | (2) |
|
|
52 | (2) |
|
|
53 | (1) |
|
3.8 Going Parallel: mpi4py and PETSc4py |
|
|
54 | (4) |
|
3.9 Other Computational Modules |
|
|
58 | (5) |
|
|
59 | (1) |
|
|
60 | (3) |
|
Part II Second Part: Mechanics |
|
|
|
4 Mechanics I: Kinematics |
|
|
63 | (14) |
|
4.1 Computation of Velocity and Acceleration |
|
|
64 | (4) |
|
4.2 Integrate Acceleration |
|
|
68 | (3) |
|
4.3 Projectile Trajectory |
|
|
71 | (2) |
|
|
73 | (4) |
|
|
74 | (1) |
|
|
74 | (3) |
|
5 Mechanics II: Newtonian Dynamics |
|
|
77 | (16) |
|
5.1 Analytical Solutions for ID Dynamics |
|
|
77 | (7) |
|
|
79 | (1) |
|
|
80 | (2) |
|
5.1.3 Potential, Dissipated, Kinetic, Mechanical Energies for the Droplet |
|
|
82 | (2) |
|
5.2 Monte Carlo Simulation of the Pyroclastic flow During the 1944 Mt Vesuvio Volcanic Eruption |
|
|
84 | (3) |
|
5.3 Precession of a Gyroscope |
|
|
87 | (6) |
|
|
90 | (1) |
|
|
90 | (3) |
|
|
93 | (14) |
|
6.1 Momentum and Continuity Equations |
|
|
93 | (5) |
|
6.1.1 Navier Stokes Equation |
|
|
96 | (2) |
|
6.2 Stokes Flow: Simple but Not Obvious |
|
|
98 | (4) |
|
|
98 | (2) |
|
|
100 | (1) |
|
6.2.3 Origin of the Paradoxes |
|
|
101 | (1) |
|
6.3 Fundamental Solutions of Stokes Flow |
|
|
102 | (5) |
|
|
103 | (1) |
|
|
103 | (1) |
|
|
104 | (3) |
|
|
|
|
107 | (22) |
|
7.1 Strain and Strain Rate |
|
|
107 | (2) |
|
|
109 | (7) |
|
7.2.1 Cell-Particles Projections |
|
|
112 | (2) |
|
7.2.2 Motion of the Particles |
|
|
114 | (2) |
|
|
116 | (3) |
|
7.4 Lagrangian Advection of a Continuous Field |
|
|
119 | (6) |
|
7.5 Upwind Scheme Versus Lagrangian Transport |
|
|
125 | (4) |
|
|
127 | (1) |
|
|
127 | (2) |
|
|
129 | (14) |
|
|
131 | (3) |
|
8.2 Cell-Centered Strain Rates from Linear Operators |
|
|
134 | (5) |
|
8.2.1 Sparse Derivative Operator |
|
|
138 | (1) |
|
8.3 Reversible and Irreversible |
|
|
139 | (4) |
|
|
140 | (1) |
|
|
141 | (2) |
|
9 Laplacian Operator and Diffusion |
|
|
143 | (18) |
|
9.1 Diffusion Processes in Geodynamics |
|
|
144 | (2) |
|
9.2 Explicit Diffusion Implementation |
|
|
146 | (2) |
|
9.3 Explicit Formulation Using Operators |
|
|
148 | (2) |
|
|
150 | (3) |
|
9.5 Two-Dimensional Diffusion Equation |
|
|
153 | (4) |
|
|
157 | (4) |
|
|
160 | (1) |
|
|
160 | (1) |
|
|
161 | (20) |
|
10.1 Operator Form of the Stokes Equation |
|
|
161 | (2) |
|
10.2 Implementation of the Homogeneous Stokes Equation |
|
|
163 | (2) |
|
10.3 The Finite Volume Method |
|
|
165 | (2) |
|
10.4 Implementation of the Nonhomogenous Stokes Equation |
|
|
167 | (3) |
|
10.5 Long-Range Interaction |
|
|
170 | (5) |
|
10.6 Advection--Diffusion Equation |
|
|
175 | (6) |
|
|
176 | (1) |
|
|
176 | (5) |
|
Part IV Advanced Techniques |
|
|
|
11 Trees, Particles, and Boundaries |
|
|
181 | (20) |
|
|
182 | (4) |
|
11.1.1 The Barnes and Hut Tree |
|
|
182 | (1) |
|
11.1.2 The Warren and Salmon Solution |
|
|
183 | (3) |
|
|
186 | (1) |
|
11.3 Boundary-Based Simulations |
|
|
186 | (4) |
|
11.3.1 Drag over a Rigid Particle |
|
|
189 | (1) |
|
11.4 Quadratic Triangular Elements Mesh |
|
|
190 | (11) |
|
11.4.1 Calculation of the influence matrix |
|
|
193 | (3) |
|
11.4.2 Calculation of the Resistance Matrix |
|
|
196 | (3) |
|
|
199 | (1) |
|
|
199 | (2) |
|
12 Applications to Geodynamics |
|
|
201 | (8) |
|
|
201 | (2) |
|
12.2 Raise of Gas in a Volcanic Conduit |
|
|
203 | (2) |
|
12.3 Interaction Between Faults |
|
|
205 | (1) |
|
|
205 | (4) |
|
|
209 | (8) |
|
|
209 | (1) |
|
|
210 | (5) |
|
13.2.1 Theano and Tensor Flow |
|
|
212 | (3) |
|
|
215 | (1) |
|
|
216 | (1) |
References |
|
217 | (8) |
Index |
|
225 | |