Skip to content

Commit 6961e02

Browse files
author
Michael Zingale
committed
docstrings
1 parent 8d8077a commit 6961e02

1 file changed

Lines changed: 52 additions & 17 deletions

File tree

mesh/patch.py

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
"""
2-
The patch module allows for a grid to be created and for data to be
3-
defined on that grid.
2+
The patch module defines the classes necessary to describe finite-volume
3+
data and the grid that it lives on.
44
55
Typical usage:
66
7-
create the grid
7+
-- create the grid
88
9-
grid = Grid2d(nx, ny)
9+
grid = Grid2d(nx, ny)
1010
1111
12-
create the data that lives on that grid
12+
-- create the data that lives on that grid
1313
14-
data = CellCenterData2d(grid)
14+
data = CellCenterData2d(grid)
1515
16-
bc = BCObject(xlb="reflect", xrb="reflect",
17-
ylb="outflow", yrb="outflow")
18-
data.register_var("density", bc)
19-
...
16+
bc = BCObject(xlb="reflect", xrb="reflect",
17+
ylb="outflow", yrb="outflow")
18+
data.register_var("density", bc)
19+
...
2020
21-
data.create()
21+
data.create()
2222
2323
24-
initialize some data
24+
-- initialize some data
2525
26-
dens = data.get_var("density")
27-
dens[:,:] = ...
26+
dens = data.get_var("density")
27+
dens[:,:] = ...
2828
2929
30-
fill the ghost cells
30+
-- fill the ghost cells
3131
32-
data.fill_BC("density")
32+
data.fill_BC("density")
3333
3434
"""
3535

@@ -59,15 +59,50 @@ def define_bc(type, function):
5959

6060
class BCObject:
6161
"""
62-
boundary condition container -- hold the BCs on each boundary
62+
Boundary condition container -- hold the BCs on each boundary
6363
for a single variable
6464
"""
6565

6666
def __init__ (self,
6767
xlb="outflow", xrb="outflow",
6868
ylb="outflow", yrb="outflow",
6969
odd_reflect_dir=""):
70+
"""
71+
Create the BCObject.
72+
73+
Parameters
74+
----------
75+
xlb : {'outflow', 'periodic', 'reflect', 'reflect-even',
76+
'reflect-odd', 'dirichlet', 'neumann',
77+
user-defined}, optional
78+
The type of boundary condition to enforce on the lower
79+
x boundary. user-defined requires one to have defined
80+
a new boundary condition type using define_bc()
81+
xrb : {'outflow', 'periodic', 'reflect', 'reflect-even',
82+
'reflect-odd', 'dirichlet', 'neumann',
83+
user-defined}, optional
84+
The type of boundary condition to enforce on the upper
85+
x boundary. user-defined requires one to have defined
86+
a new boundary condition type using define_bc()
87+
ylb : {'outflow', 'periodic', 'reflect', 'reflect-even',
88+
'reflect-odd', 'dirichlet', 'neumann',
89+
user-defined}, optional
90+
The type of boundary condition to enforce on the lower
91+
y boundary. user-defined requires one to have defined
92+
a new boundary condition type using define_bc()
93+
yrb : {'outflow', 'periodic', 'reflect', 'reflect-even',
94+
'reflect-odd', 'dirichlet', 'neumann',
95+
user-defined}, optional
96+
The type of boundary condition to enforce on the upper
97+
y boundary. user-defined requires one to have defined
98+
a new boundary condition type using define_bc()
99+
odd_reflect_dir : {'x', 'y'}, optional
100+
The direction along which reflection should be odd
101+
(sign changes). If not specified, a boundary condition
102+
of 'reflect' will always be set to 'reflect-even'
70103
104+
"""
105+
71106
# note: "reflect" is ambiguous and will be converted into
72107
# either reflect-even (the default) or reflect-odd if
73108
# odd_reflect_dir specifies the corresponding direction ("x",

0 commit comments

Comments
 (0)