Skip to content

Commit

Permalink
Fix AMReX Init for test_wake
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Sep 23, 2024
1 parent 32dc886 commit be5c705
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/python/test_wake.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
np.set_printoptions(threshold=sys.maxsize)
from conftest import basepath

import impactx

Check notice

Code scanning / CodeQL

Module is imported with 'import' and 'import from' Note test

Module 'impactx' is imported with both 'import' and 'import from'.
from amrex.space3d import PODVector_real_std # Import amrex array
from impactx import ImpactX, amr, wakeconvolution
from impactx import ImpactX, wakeconvolution


def test_wake(save_png=True):
amr.initialize([])
try:
sim = ImpactX()
sim.n_cell = [16, 24, 32]
sim.load_inputs_file(basepath + "/../../examples/chicane/input_chicane_csr.in")
sim.load_inputs_file(basepath + "/examples/chicane/input_chicane_csr.in")
sim.slice_step_diagnostics = False

sim.init_grids()
Expand Down Expand Up @@ -139,4 +139,8 @@ def test_wake(save_png=True):


if __name__ == "__main__":
# Call MPI_Init and MPI_Finalize only once:
if impactx.Config.have_mpi:
from mpi4py import MPI # noqa

test_wake()

0 comments on commit be5c705

Please sign in to comment.