Skip to content

Commit 4762554

Browse files
committed
some style fixes
1 parent a30ec1c commit 4762554

1 file changed

Lines changed: 24 additions & 20 deletions

File tree

examples/multigrid/project_periodic.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
11
#!/usr/bin/env python3
22

3-
# test of a cell-centered, centered-difference approximate projection.
4-
#
5-
# initialize the velocity field to be divergence free and then add to
6-
# it the gradient of a scalar (whose normal component vanishes on the
7-
# boundaries). The projection should recover the original divergence-
8-
# free velocity field.
9-
#
10-
# The test velocity field comes from Almgen, Bell, and Szymczak 1996.
11-
#
12-
# This makes use of the multigrid solver with periodic boundary conditions.
13-
#
14-
# One of the things that this test demonstrates is that the initial
15-
# projection may not be able to completely remove the divergence free
16-
# part, so subsequent projections may be necessary. In this example,
17-
# we add a very strong gradient component.
18-
#
19-
# The total number of projections to perform is given by nproj. Each
20-
# projection uses the divergence of the velocity field from the previous
21-
# iteration as its source term.
3+
"""test of a cell-centered, centered-difference approximate projection.
4+
5+
initialize the velocity field to be divergence free and then add to it
6+
the gradient of a scalar (whose normal component vanishes on the
7+
boundaries). The projection should recover the original divergence-
8+
free velocity field.
9+
10+
The test velocity field comes from Almgen, Bell, and Szymczak 1996.
11+
12+
This makes use of the multigrid solver with periodic boundary conditions.
13+
14+
One of the things that this test demonstrates is that the initial
15+
projection may not be able to completely remove the divergence free
16+
part, so subsequent projections may be necessary. In this example, we
17+
add a very strong gradient component.
18+
19+
The total number of projections to perform is given by nproj. Each
20+
projection uses the divergence of the velocity field from the previous
21+
iteration as its source term.
22+
23+
Note: the output file created stores the original field, the poluted
24+
field, and the recovered field.
25+
"""
2226

2327
import numpy as np
2428

2529
import multigrid.MG as MG
2630
import mesh.boundary as bnd
2731
import mesh.patch as patch
2832

29-
3033
def doit(nx, ny):
34+
"""manage the entire projection"""
3135

3236
nproj = 2
3337

0 commit comments

Comments
 (0)