diff --git a/examples/beam_in_vacuum/analysis.py b/examples/beam_in_vacuum/analysis.py index 1dcc2b12eb..d1a8ecba2e 100755 --- a/examples/beam_in_vacuum/analysis.py +++ b/examples/beam_in_vacuum/analysis.py @@ -18,13 +18,13 @@ # Note: the simulation may take some time, as the box size must be high to have # decent agreement +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import matplotlib import numpy as np import scipy.constants as scc import argparse import sys -from openpmd_viewer import OpenPMDTimeSeries parser = argparse.ArgumentParser(description='Script to analyze the correctness of the beam in vacuum') parser.add_argument('--normalized-units', diff --git a/examples/beam_in_vacuum/analysis_2ranks.py b/examples/beam_in_vacuum/analysis_2ranks.py index 90192eb4d3..4211e19a4d 100755 --- a/examples/beam_in_vacuum/analysis_2ranks.py +++ b/examples/beam_in_vacuum/analysis_2ranks.py @@ -8,10 +8,10 @@ # License: BSD-3-Clause-LBNL +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import numpy as np import argparse -from openpmd_viewer import OpenPMDTimeSeries do_plot = False diff --git a/examples/beam_in_vacuum/analysis_beam_push.py b/examples/beam_in_vacuum/analysis_beam_push.py index 65fdb3c43b..666ecca7c3 100755 --- a/examples/beam_in_vacuum/analysis_beam_push.py +++ b/examples/beam_in_vacuum/analysis_beam_push.py @@ -8,12 +8,11 @@ # License: BSD-3-Clause-LBNL +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt -import matplotlib import argparse import numpy as np import scipy.constants as scc -from openpmd_viewer import OpenPMDTimeSeries do_plot = True diff --git a/examples/beam_in_vacuum/analysis_from_file.py b/examples/beam_in_vacuum/analysis_from_file.py index dbee4a961e..b296917a4b 100755 --- a/examples/beam_in_vacuum/analysis_from_file.py +++ b/examples/beam_in_vacuum/analysis_from_file.py @@ -12,14 +12,10 @@ # one from the write_beam script, two from hipace, # with each other and asserts if they are different. -import matplotlib.pyplot as plt +import openpmd_api as io # to have access to Attribute Metadata import scipy.constants as scc -import matplotlib -import sys import numpy as np -import math import argparse -import openpmd_api as io # to have access to Attribute Metadata parser = argparse.ArgumentParser(description='Script to analyze the correctness of beam from_file') parser.add_argument('--beam-py', diff --git a/examples/beam_in_vacuum/analysis_transverse.py b/examples/beam_in_vacuum/analysis_transverse.py index c3990d06c6..4cc8a368b4 100755 --- a/examples/beam_in_vacuum/analysis_transverse.py +++ b/examples/beam_in_vacuum/analysis_transverse.py @@ -11,6 +11,7 @@ # This script compares the transverse field By from a serial and a parallel simulation # with transverse beam currents and asserts that the results are the same +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import scipy.constants as scc import matplotlib @@ -18,7 +19,6 @@ import numpy as np import math import argparse -from openpmd_viewer import OpenPMDTimeSeries parser = argparse.ArgumentParser( description='Script to analyze the correctness of beam with transverse current') diff --git a/examples/blowout_wake/analysis.py b/examples/blowout_wake/analysis.py index c5ed184df9..07ce9e19e7 100755 --- a/examples/blowout_wake/analysis.py +++ b/examples/blowout_wake/analysis.py @@ -18,6 +18,7 @@ # Note: the simulation may take some time, as the box size must be high to have # decent agreement +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import scipy.constants as scc import matplotlib @@ -25,7 +26,6 @@ import numpy as np import math import argparse -from openpmd_viewer import OpenPMDTimeSeries parser = argparse.ArgumentParser(description='Script to analyze the correctness of the beam in vacuum') parser.add_argument('--normalized-data', diff --git a/examples/blowout_wake/analysis_coarsening.py b/examples/blowout_wake/analysis_coarsening.py index 893a606d6d..655b823565 100755 --- a/examples/blowout_wake/analysis_coarsening.py +++ b/examples/blowout_wake/analysis_coarsening.py @@ -9,6 +9,7 @@ # This script compares a field from a simulation with full IO and from a simulation with coarse IO +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import scipy.constants as scc import matplotlib @@ -16,7 +17,6 @@ import numpy as np import math import argparse -from openpmd_viewer import OpenPMDTimeSeries fields = ['Ez', 'ExmBy', 'EypBx'] @@ -40,4 +40,3 @@ del ts1 del ts2 - diff --git a/examples/blowout_wake/analysis_slice_IO.py b/examples/blowout_wake/analysis_slice_IO.py index aef2d71d89..56732dbfcb 100755 --- a/examples/blowout_wake/analysis_slice_IO.py +++ b/examples/blowout_wake/analysis_slice_IO.py @@ -11,6 +11,7 @@ # This script compares a field from a simulation with # full IO and from a simulation with only slice IO +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import scipy.constants as scc import matplotlib @@ -18,7 +19,6 @@ import numpy as np import math import argparse -from openpmd_viewer import OpenPMDTimeSeries do_plot = False field = 'Ez' diff --git a/examples/gaussian_weight/analysis.py b/examples/gaussian_weight/analysis.py index c1e766c6b3..ec6bc12c84 100755 --- a/examples/gaussian_weight/analysis.py +++ b/examples/gaussian_weight/analysis.py @@ -7,12 +7,11 @@ # Authors: MaxThevenet, Severin Diederichs # License: BSD-3-Clause-LBNL - +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import numpy as np import scipy.constants as scc import argparse -from openpmd_viewer import OpenPMDTimeSeries parser = argparse.ArgumentParser(description='Script to analyze the correctness of the beam in vacuum') parser.add_argument('--normalized-units', diff --git a/examples/linear_wake/analysis.py b/examples/linear_wake/analysis.py index c89345c9ec..733c10958a 100755 --- a/examples/linear_wake/analysis.py +++ b/examples/linear_wake/analysis.py @@ -21,6 +21,7 @@ # Note: the simulation may take some time, as the box size must be high to have # decent agreement +from openpmd_viewer import OpenPMDTimeSeries import matplotlib.pyplot as plt import scipy.constants as scc from scipy.stats import norm @@ -29,7 +30,6 @@ import numpy as np import math import argparse -from openpmd_viewer import OpenPMDTimeSeries parser = argparse.ArgumentParser(description='Script to analyze the correctness of the beam in vacuum') parser.add_argument('--normalized-units', diff --git a/src/particles/pusher/GetAndSetPosition.H b/src/particles/pusher/GetAndSetPosition.H index 8883affd0b..041a3e75ee 100644 --- a/src/particles/pusher/GetAndSetPosition.H +++ b/src/particles/pusher/GetAndSetPosition.H @@ -185,7 +185,9 @@ struct EnforceBC { using namespace amrex::literals; - const bool shifted = enforcePeriodic(m_structs[ip], m_plo, m_phi, m_periodicity); + // TODO: The second m_phi should be amrex::Geometry RoundoffHiArray(), + // however there is no Geometry object to get this. + const bool shifted = enforcePeriodic(m_structs[ip], m_plo, m_phi, m_phi, m_periodicity); const bool invalid = (shifted && !m_is_per[0]); if (invalid) { m_weights[ip] = 0.0_rt; diff --git a/tests/checksum/backend/openpmd_backend.py b/tests/checksum/backend/openpmd_backend.py index b6fb600f15..363f322192 100644 --- a/tests/checksum/backend/openpmd_backend.py +++ b/tests/checksum/backend/openpmd_backend.py @@ -17,7 +17,7 @@ def __init__(self, filename): ''' Constructor: store the dataset object ''' - self.dataset = OpenPMDTimeSeries(filename) + self.dataset = OpenPMDTimeSeries(filename, backend='h5py') def fields_list(self): ''' Return the list of fields defined on the grid