Grid Classes
Arakawa C-grid spatial discretization containers for 1-D, 2-D, and 3-D domains.
1-D Grid
finitevolx.ArakawaCGrid1D
Bases: Module
1-D Arakawa C-grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Nx
|
int
|
Total number of cells in x (including 2 ghost cells). |
required |
Lx
|
float
|
Physical domain length in x. |
required |
dx
|
float
|
Grid spacing in x. |
required |
Source code in finitevolx/_src/grid/grid.py
from_interior(nx_interior, Lx)
classmethod
Construct grid from interior cell count.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nx_interior
|
int
|
Number of interior (physical) cells. |
required |
Lx
|
float
|
Physical domain length. |
required |
Returns:
| Type | Description |
|---|---|
ArakawaCGrid1D
|
|
Source code in finitevolx/_src/grid/grid.py
2-D Grid
finitevolx.ArakawaCGrid2D
Bases: Module
2-D Arakawa C-grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Nx
|
int
|
Total number of cells in x (including 2 ghost cells). |
required |
Ny
|
int
|
Total number of cells in y (including 2 ghost cells). |
required |
Lx
|
float
|
Physical domain length in x. |
required |
Ly
|
float
|
Physical domain length in y. |
required |
dx
|
float
|
Grid spacing in x. |
required |
dy
|
float
|
Grid spacing in y. |
required |
Notes
Array layout (total shape [Ny, Nx])::
j=Ny-1 +--+--+--+ ghost row (north)
| | | |
j=2 +--+--+--+
j=1 +--+--+--+ physical interior [1:-1, 1:-1]
j=0 +--+--+--+ ghost row (south)
i=0 ... i=Nx-1
ghost ghost
(west) (east)
Colocation convention::
T[j, i] cell centre at (i*dx, j*dy )
U[j, i] east face at ((i+1/2)*dx, j*dy )
V[j, i] north face at (i*dx, (j+1/2)*dy)
X[j, i] NE corner at ((i+1/2)*dx,(j+1/2)*dy)
Source code in finitevolx/_src/grid/grid.py
from_interior(nx_interior, ny_interior, Lx, Ly)
classmethod
Construct grid from interior cell counts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nx_interior
|
int
|
Number of interior (physical) cells in x. |
required |
ny_interior
|
int
|
Number of interior (physical) cells in y. |
required |
Lx
|
float
|
Physical domain length in x. |
required |
Ly
|
float
|
Physical domain length in y. |
required |
Returns:
| Type | Description |
|---|---|
ArakawaCGrid2D
|
|
Source code in finitevolx/_src/grid/grid.py
3-D Grid
finitevolx.ArakawaCGrid3D
Bases: Module
3-D Arakawa C-grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Nx
|
int
|
Total number of cells in x (including 2 ghost cells). |
required |
Ny
|
int
|
Total number of cells in y (including 2 ghost cells). |
required |
Nz
|
int
|
Total number of cells in z (including 2 ghost cells). |
required |
Lx
|
float
|
Physical domain length in x. |
required |
Ly
|
float
|
Physical domain length in y. |
required |
Lz
|
float
|
Physical domain length in z. |
required |
dx
|
float
|
Grid spacing in x. |
required |
dy
|
float
|
Grid spacing in y. |
required |
dz
|
float
|
Grid spacing in z. |
required |
Source code in finitevolx/_src/grid/grid.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
from_interior(nx_interior, ny_interior, nz_interior, Lx, Ly, Lz)
classmethod
Construct grid from interior cell counts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nx_interior
|
int
|
Number of interior cells in x. |
required |
ny_interior
|
int
|
Number of interior cells in y. |
required |
nz_interior
|
int
|
Number of interior cells in z. |
required |
Lx
|
float
|
Physical domain length in x. |
required |
Ly
|
float
|
Physical domain length in y. |
required |
Lz
|
float
|
Physical domain length in z. |
required |
Returns:
| Type | Description |
|---|---|
ArakawaCGrid3D
|
|
Source code in finitevolx/_src/grid/grid.py
horizontal_grid()
Extract the horizontal 2-D grid from this 3-D grid.
Returns:
| Type | Description |
|---|---|
ArakawaCGrid2D
|
A 2-D grid with the same Nx, Ny, Lx, Ly, dx, dy. |