Skip to content

Commit 6fd9d8e

Browse files
author
sveinlin
committed
updates
1 parent 56fe8f7 commit 6fd9d8e

7 files changed

Lines changed: 14 additions & 12 deletions

File tree

doc/.src/chapters/softeng2/softeng2.do.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,20 +1128,19 @@ The C version of our function `advance` can be coded as follows.
11281128

11291129
idx{`wave2D_u0_loop_c.c`} idx{`wave2D_u0_loop_c.h`}
11301130

1131-
All the code above appears in a file "`wave2D_u0_loop_c.c`":
1132-
"${src_wave}//wave2D_u0/wave2D_u0_loop_c.c".
1131+
All the code above appears in the file
1132+
"`wave2D_u0_loop_c.c`": "${src_softeng2}/wave2D_u0_loop_c.c".
11331133
We need to compile this file together with C wrapper code such that
11341134
`advance` can be called from Python. Cython can be used to generate
11351135
appropriate wrapper code.
11361136
The relevant Cython code for interfacing C is
1137-
placed in a file with extension `.pyx`. Here this file, called
1138-
"`wave2D_u0_loop_c_cy.pyx`":
1139-
"${src_wave}/wave2D_u0/wave2D_u0_loop_c_cy.pyx", looks like
1137+
placed in a file with extension `.pyx`. This file, called
1138+
"`wave2D_u0_loop_c_cy.pyx`": "${src_softeng2}/wave2D_u0_loop_c_cy.pyx", looks like
11401139

11411140
@@@CODE src-softeng2/wave2D_u0_loop_c_cy.pyx
11421141
We first declare the C functions to be interfaced.
1143-
These must also appear in a C header file, "`wave2D_u0_loop_c.h`":
1144-
"${src_wave}/wave2D_u0/wave2D_u0_loop_c.h",
1142+
These must also appear in a C header file,
1143+
"`wave2D_u0_loop_c.h`": "${src_softeng2}/wave2D_u0_loop_c.h",
11451144

11461145
@@@CODE src-softeng2/wave2D_u0_loop_c.h
11471146
The next step is to write a Cython function with Python objects as arguments.

doc/.src/chapters/wave/wave1D_fd2.do.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ label{wave:pde2:Neumann}
44
The boundary condition $u=0$ in a wave equation reflects the wave, but
55
$u$ changes sign at the boundary, while the condition $u_x=0$ reflects
66
the wave as a mirror and preserves the sign, see a "web page":
7-
"${doc_notes}/pub/wave/html/mov-wave/demo_BC_gaussian/index.html" or a
7+
"${doc_notes}/mov-wave/demo_BC_gaussian/index.html" or a
88
"movie file":
9-
"${doc_notes}/pub/wave/html/mov-wave/demo_BC_gaussian/movie.flv" for
9+
"${docraw}/mov-wave/demo_BC_gaussian/movie.flv" for
1010
demonstration.
1111

1212
# #ifdef EXTRA
@@ -158,9 +158,9 @@ The modification of the scheme at the boundary is also required for
158158
the special formula for the first time step. How the stencil moves
159159
through the mesh and is modified at the boundary can be illustrated by
160160
an animation in a "web page":
161-
"${doc_notes}/pub/wave/html/mov-wave/N_stencil_gpl/index.html"
161+
"${doc_notes}/mov-wave/N_stencil_gpl/index.html"
162162
or a "movie file":
163-
"${doc_notes}/pub/wave/html/mov-wave/N_stencil_gpl/movie.ogg".
163+
"${docraw}/mov-wave/N_stencil_gpl/movie.ogg".
164164

165165

166166

doc/.src/chapters/wave/wave1D_prog.do.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ calling `viz` in this application goes as follows:
373373
The associated program has the name "`wave1D_u0.py`":
374374
"${src_wave}/wave1D/wave1D_u0.py". Run
375375
the program and watch the "movie of the vibrating string":
376-
"${doc_notes}/pub/wave/html/mov-wave/guitar_C0.8/movie.html".
376+
"${doc_notes}/mov-wave/guitar_C0.8/movie.html".
377377
The string should ideally consist of straight segments, but these are
378378
somewhat wavy due to numerical approximation. Run the case with the
379379
`wave1D_u0.py` code and $C=1$ to see the exact solution.
-46 Bytes
Binary file not shown.
190 Bytes
Binary file not shown.
-37 Bytes
Binary file not shown.

src/softeng2/wave2D_u0_loop_c.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extern void advance(double* u, double* u_n, double* u_nm1, double* f,
2+
double Cx2, double Cy2, double dt2,
3+
int Nx, int Ny);

0 commit comments

Comments
 (0)