Skip to content

Commit 9d628ae

Browse files
piotrbartmanslayoo
andauthored
rename omega -> position_in_cell (#979)
Co-authored-by: Sylwester Arabas <[email protected]>
1 parent 4092982 commit 9d628ae

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

PySDM/backends/impl_numba/methods/displacement_methods.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
def calculate_displacement_body_common(
1414
dim, droplet, scheme, _l, _r, displacement, courant, position_in_cell, n_substeps
1515
):
16-
omega = position_in_cell[dim, droplet]
1716
displacement[dim, droplet] = scheme(
18-
omega, courant[_l] / n_substeps, courant[_r] / n_substeps
17+
position_in_cell[dim, droplet],
18+
courant[_l] / n_substeps,
19+
courant[_r] / n_substeps,
1920
)
2021

2122

PySDM/backends/impl_thrust_rtc/methods/displacement_methods.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,11 @@ def __init__(self):
4646
_r += _r_2 * courant_shape_0 * courant_shape_1;
4747
}}
4848
49-
auto omega = position_in_cell[i + n_sd * dim];
50-
auto c_r = courant[_r] / n_substeps;
51-
auto c_l = courant[_l] / n_substeps;
5249
displacement[i + n_sd * dim] = {
5350
self.formulae.particle_advection.displacement.c_inline(
54-
c_l="c_l", c_r="c_r", omega="omega"
51+
position_in_cell="position_in_cell[i + n_sd * dim]",
52+
c_l="courant[_l] / n_substeps",
53+
c_r="courant[_r] / n_substeps"
5554
)
5655
};
5756
""".replace(

PySDM/physics/particle_advection/explicit_in_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ def __init__(self, _):
88
pass
99

1010
@staticmethod
11-
def displacement(_, omega, c_l, c_r):
12-
return c_l * (1 - omega) + c_r * omega
11+
def displacement(_, position_in_cell, c_l, c_r):
12+
return c_l * (1 - position_in_cell) + c_r * position_in_cell

PySDM/physics/particle_advection/implicit_in_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ def __init__(self, _):
88
pass
99

1010
@staticmethod
11-
def displacement(_, omega, c_l, c_r):
12-
return (omega * c_r + c_l * (1 - omega)) / (1 - c_r + c_l)
11+
def displacement(_, position_in_cell, c_l, c_r):
12+
return (c_l * (1 - position_in_cell) + c_r * position_in_cell) / (1 - c_r + c_l)

0 commit comments

Comments
 (0)