|
1 | 1 | """ |
2 | | - LUMP, SPRAY, v_c = lump_and_spray(wet3D, volume; f=Returns(true),di=2, dj=2, dk=1) |
| 2 | + LUMP, SPRAY, v_c = lump_and_spray(wet3D, vol, T, mask=trues(size(wet3D)); di=2, dj=2, dk=1) |
3 | 3 |
|
4 | 4 | returns the LUMP and SPRAY matrices, and the coarsened volume vector. |
5 | 5 |
|
| 6 | +The `vol` vector of volumes is used to make the LUMP operator volume-conserving. |
| 7 | +The `T` matrix is used to determine connectivity of the grid cells, so as to avoid lumping disconnected cells. |
| 8 | +The `mask` boolean array (same size as `wet3D`) can be used to restrict the lumping to a certain region. |
| 9 | +
|
6 | 10 | To get the coarsened vector from fine vector x, use |
7 | 11 |
|
8 | 12 | LUMP * x |
@@ -108,20 +112,6 @@ function lump_and_spray(wet3D, vol, T, mask=trues(size(wet3D)); di=2, dj=2, dk=1 |
108 | 112 | end |
109 | 113 |
|
110 | 114 |
|
111 | | -""" |
112 | | -diconnected_cells(wet3D, T; di=2, dj=2, dk=1) |
113 | | -
|
114 | | -""" |
115 | | -function connected_cells(wet3D, T; di=2, dj=2, dk=1) |
116 | | - i, j = findnz(SPRAY * LUMP) |
117 | | - connected_by_grid = sparse(i, j, true, size(T)...) |
118 | | - i, j = findnz(T) |
119 | | - connected_by_T = sparse(i, j, true, size(T)...) |
120 | | - connected = connected_by_grid .& connected_by_T |
121 | | - connected = ((connected^di)^dj)^dk |
122 | | -end |
123 | | - |
124 | | - |
125 | 115 |
|
126 | 116 | """ |
127 | 117 | as2D(x, wet3D) |
|
0 commit comments