From f6dd7a697a15ff568bfd33abed62066bbd2639c8 Mon Sep 17 00:00:00 2001 From: Dave Grote Date: Wed, 28 Jun 2017 16:14:16 -0700 Subject: Various fixes to conform to Python PICMI standard --- Python/pywarpx/AMReX.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Python/pywarpx/AMReX.py') diff --git a/Python/pywarpx/AMReX.py b/Python/pywarpx/AMReX.py index 581133695..bdadc49bd 100644 --- a/Python/pywarpx/AMReX.py +++ b/Python/pywarpx/AMReX.py @@ -6,6 +6,7 @@ from .Geometry import geometry from .Algo import algo from .Langmuirwave import langmuirwave from .Interpolation import interpolation +from . import Particles from .Particles import particles, particles_list import ctypes @@ -24,6 +25,12 @@ class AMReX(object): argv += interpolation.attrlist() argv += particles.attrlist() + if not particles_list: + # --- This is needed in case only species_names has been set, + # --- assuming that only the built in particle types are being used. + for pstring in particles.species_names.split(' '): + particles_list.append(getattr(Particles, pstring)) + for particle in particles_list: argv += particle.attrlist() -- cgit v1.2.3