aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/PGroup.py
diff options
context:
space:
mode:
authorGravatar Dave Grote <grote1@llnl.gov> 2017-05-04 16:24:16 -0700
committerGravatar Dave Grote <grote1@llnl.gov> 2017-05-04 16:24:16 -0700
commita8548b2890473b5d1834d151246a22d441fa059f (patch)
tree01bde3ee687e625da6e64f5fb59252560db5c547 /Python/pywarpx/PGroup.py
parent902894c1fbc3b4384fea8331f98cd59e3361d3e1 (diff)
downloadWarpX-a8548b2890473b5d1834d151246a22d441fa059f.tar.gz
WarpX-a8548b2890473b5d1834d151246a22d441fa059f.tar.zst
WarpX-a8548b2890473b5d1834d151246a22d441fa059f.zip
Minor fixes for Python interface
Diffstat (limited to 'Python/pywarpx/PGroup.py')
-rw-r--r--Python/pywarpx/PGroup.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/pywarpx/PGroup.py b/Python/pywarpx/PGroup.py
index 92f6b4484..bb8ad11e2 100644
--- a/Python/pywarpx/PGroup.py
+++ b/Python/pywarpx/PGroup.py
@@ -55,6 +55,10 @@ class PGroup(object):
def addspecies(self):
pass
+ def getnpid(self):
+ # --- The -3 is because the comps include the velocites
+ return _labwarpx.warpx_nComps() - 3
+ npid = property(getnpid)
def getnps(self):
return np.array([len(self.xp)], dtype='l')
@@ -104,7 +108,7 @@ class PGroup(object):
uxp = self.getuxp(js)
uyp = self.getuyp(js)
uzp = self.getuzp(js)
- return sqrt(1. - (uxp**2 + uyp**2 + uzp**2)/warpxC.c**2)
+ return np.sqrt(1. - (uxp**2 + uyp**2 + uzp**2)/_libwarpx.clight**2)
gaminv = property(getgaminv)
def getex(self, js=0):