Skip to content

Commit ed9330b

Browse files
committed
Merge branch 'add_cupy_callbacks_picmi' of https://github.com/oshapoval/WarpX into add_cupy_callbacks_picmi
2 parents 52ecfbd + 0314fbb commit ed9330b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Examples/Physics_applications/capacitive_discharge/inputs_test_2d_background_mcc_picmi.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ def __init__(self, grid, **kwargs):
7373
required_precision=1,
7474
**kwargs,
7575
)
76-
self.rho_wrapper = None
77-
self.phi_wrapper = None
7876
self.time_sum = 0.0
7977

8078
def solver_initialize_inputs(self):
@@ -160,15 +158,13 @@ def _run_solve(self):
160158
Poisson's equation."""
161159

162160
# get rho from WarpX
163-
if self.rho_wrapper is None:
164-
self.rho_wrapper = sim.fields.get("rho_fp", level=0)
165-
self.rho_data = self.rho_wrapper[(), ()]
161+
rho_wrapper = sim.fields.get("rho_fp", level=0)
162+
self.rho_data = rho_wrapper[(), ()]
166163

167164
self.solve()
168165

169-
if self.phi_wrapper is None:
170-
self.phi_wrapper = sim.fields.get("phi_fp", level=0)
171-
self.phi_wrapper[(), ()] = self.phi
166+
phi_wrapper = sim.fields.get("phi_fp", level=0)
167+
phi_wrapper[(), ()] = self.phi[...]
172168

173169
def solve(self):
174170
"""The solution step. Includes getting the boundary potentials and

0 commit comments

Comments
 (0)