aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/WarpX.py
blob: e9ec7cca4800bf52f529e081d6b8f704753efb5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from .Bucket import Bucket
from . import warpxC

class WarpX(Bucket):
    """
    A Python wrapper for the WarpX C++ class
    """

    def init(self):
        self.warpx = warpxC.WarpX.GetInstance()
        self.warpx.InitData()

    def evolve(self, nsteps=-1):
        self.warpx.Evolve(nsteps)

    def finalize(self):
        warpxC.WarpX.ResetInstance()

    def getProbLo(self, direction):
        return self.warpx.Geom()[0].ProbLo(direction)
        #return warpxC.warpx_getProbLo(direction)

    def getProbHi(self, direction):
        return self.warpx.Geom()[0].ProbHi(direction)
        #return warpxC.warpx_getProbHi(direction)

warpx = WarpX('warpx')