Пример #1
0
libwarpx.warpx_getBfieldCPLoVects.restype = _LP_c_int
libwarpx.warpx_getBfieldFP.restype = _LP_LP_c_double
libwarpx.warpx_getBfieldFPLoVects.restype = _LP_c_int
libwarpx.warpx_getCurrentDensity.restype = _LP_LP_c_double
libwarpx.warpx_getCurrentDensityLoVects.restype = _LP_c_int
libwarpx.warpx_getCurrentDensityCP.restype = _LP_LP_c_double
libwarpx.warpx_getCurrentDensityCPLoVects.restype = _LP_c_int
libwarpx.warpx_getCurrentDensityFP.restype = _LP_LP_c_double
libwarpx.warpx_getCurrentDensityFPLoVects.restype = _LP_c_int

#libwarpx.warpx_getPMLSigma.restype = _LP_c_double
#libwarpx.warpx_getPMLSigmaStar.restype = _LP_c_double
#libwarpx.warpx_ComputePMLFactors.argtypes = (ctypes.c_int, ctypes.c_double)

libwarpx.warpx_addNParticles.argtypes = (ctypes.c_int, ctypes.c_int,
                                         _ndpointer(ctypes.c_double,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(ctypes.c_double,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(ctypes.c_double,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(ctypes.c_double,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(ctypes.c_double,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(ctypes.c_double,
                                                    flags="C_CONTIGUOUS"),
                                         ctypes.c_int,
                                         _ndpointer(ctypes.c_double,
                                                    flags="C_CONTIGUOUS"),
                                         ctypes.c_int)
Пример #2
0
libwarpx.warpx_getCurrentDensityLoVects.restype = _LP_c_int
libwarpx.warpx_getCurrentDensityCP.restype = _LP_LP_c_real
libwarpx.warpx_getCurrentDensityCPLoVects.restype = _LP_c_int
libwarpx.warpx_getCurrentDensityFP.restype = _LP_LP_c_real
libwarpx.warpx_getCurrentDensityFPLoVects.restype = _LP_c_int
libwarpx.warpx_getCurrentDensityCP_PML.restype = _LP_LP_c_real
libwarpx.warpx_getCurrentDensityCPLoVects_PML.restype = _LP_c_int
libwarpx.warpx_getCurrentDensityFP_PML.restype = _LP_LP_c_real
libwarpx.warpx_getCurrentDensityFPLoVects_PML.restype = _LP_c_int

#libwarpx.warpx_getPMLSigma.restype = _LP_c_real
#libwarpx.warpx_getPMLSigmaStar.restype = _LP_c_real
#libwarpx.warpx_ComputePMLFactors.argtypes = (ctypes.c_int, c_real)

libwarpx.warpx_addNParticles.argtypes = (ctypes.c_int, ctypes.c_int,
                                         _ndpointer(c_particlereal,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(c_particlereal,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(c_particlereal,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(c_particlereal,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(c_particlereal,
                                                    flags="C_CONTIGUOUS"),
                                         _ndpointer(c_particlereal,
                                                    flags="C_CONTIGUOUS"),
                                         ctypes.c_int,
                                         _ndpointer(c_particlereal,
                                                    flags="C_CONTIGUOUS"),
                                         ctypes.c_int)
Пример #3
0
    def run(self, magpat, rect, xrays, yrays, levels, progress=Progress()):
        """Start the actual ray shooting."""
        self.cancel_flag = False
        _rayshoot(self, magpat, rect, xrays, yrays, levels, progress)

# ctypes prototypes for the functions in libll.so
_shoot_single_ray.argtypes = [_c.POINTER(MagpatParams),
                              _c.c_double,
                              _c.c_double,
                              _c.POINTER(_c.c_double),
                              _c.POINTER(_c.c_double)]
_shoot_single_ray.restype = _c.c_int

_rayshoot_rect.argtypes = [_c.POINTER(MagpatParams),
                           _ndpointer(_c.c_uint32, flags="C_CONTIGUOUS"),
                           _c.POINTER(Rect),
                           _c.c_int,
                           _c.c_int]
_rayshoot_rect.restype = None

_get_subpatches.argtypes = [_c.POINTER(MagpatParams),
                            _c.POINTER(Patches)]
_get_subpatches.restype = None

_rayshoot_subpatches.argtypes = [_c.POINTER(BasicRayshooter),
                                 _ndpointer(flags="C_CONTIGUOUS"),
                                 _c.POINTER(Patches),
                                 _c.POINTER(_c.c_double)]
_rayshoot_subpatches.restype = None