Utilities for the ctypes interface. More...
Functions | |
| def | PyPO.BindUtils.sfieldConv (field, c_field, size, ct_t) |
| Convert a PyPO scalarfield object to a ctypes struct. More... | |
| def | PyPO.BindUtils.arrC1ToObj (res, shape, np_t) |
| Convert a ctypes arrC1 or arrC1f struct to a PyPO scalarfield. More... | |
| def | PyPO.BindUtils.c2BundleToObj (res, shape, obj_t, np_t) |
| Convert a ctypes c2Bundle or c2Bundlef to a PyPO fields or currents object. More... | |
| def | PyPO.BindUtils.c4BundleToObj (res, shape, np_t) |
| Convert a ctypes c4Bundle or c4Bundlef to a PyPO fields and currents object. More... | |
| def | PyPO.BindUtils.c2rBundleToObj (res, shape, np_t) |
| Convert a ctypes c2rBundle or c2rBundlef to a PyPO fields and rfield object. More... | |
| def | PyPO.BindUtils.allocate_arrC1 (res, size, ct_t) |
| allocate a ctypes arrC1 or arrC1f struct. More... | |
| def | PyPO.BindUtils.allocate_c2Bundle (res, size, ct_t) |
| allocate a ctypes c2Bundle or c2Bundlef struct. More... | |
| def | PyPO.BindUtils.allocate_c4Bundle (res, size, ct_t) |
| allocate a ctypes c4Bundle or c4Bundlef struct. More... | |
| def | PyPO.BindUtils.allocate_c2rBundle (res, size, ct_t) |
| allocate a ctypes c2rBundle or c2rBundlef struct. More... | |
| def | PyPO.BindUtils.allfill_reflparams (inp, reflparams_py, ct_t) |
| Allocate and fill ctypes reflparams or reflparamsf from a reflDict. More... | |
| def | PyPO.BindUtils.allocate_reflcontainer (res, size, ct_t) |
| Allocate ctypes reflcontainer or reflcontainerf. More... | |
| def | PyPO.BindUtils.allocate_cframe (res, size, ct_t) |
| Allocate a ctypes cframe or cframef struct. More... | |
| def | PyPO.BindUtils.allfill_cframe (res, frame_py, size, ct_t) |
| Allocate and fill a ctypes cframe or cframef struct. More... | |
| def | PyPO.BindUtils.allfill_c2Bundle (res, obj_py, size, ct_t) |
| Allocate and fill a ctypes c2Bundle or c2Bundleff struct. More... | |
| def | PyPO.BindUtils.allfill_RTDict (res, rdict_py, ct_t) |
| Allocate and fill an RTDict struct, for generating a tubular ray-trace frame. More... | |
| def | PyPO.BindUtils.allfill_GRTDict (res, grdict_py, ct_t) |
| Allocate and fill a GRTDict, for generating a Gaussian ray-trace frame. More... | |
| def | PyPO.BindUtils.allfill_GPODict (res, gdict_py, ct_t) |
| Allocate and fill a GPODict, for generating a Gaussian beam field and current. More... | |
| def | PyPO.BindUtils.allfill_SGPODict (res, sgdict_py, ct_t) |
| Allocate and fill a ScalarGPODict, for generating a scalar Gaussian beam field. More... | |
| def | PyPO.BindUtils.allfill_mat4D (mat, ct_t) |
| Allocate and fill a 4D matrix for transforming frames and fields/currents. More... | |
| def | PyPO.BindUtils.creflToObj (res, shape, np_t) |
| Convert a reflector grids struct to a PyPO grids object. More... | |
| def | PyPO.BindUtils.frameToObj (res, np_t, shape) |
| Convert a cframe struct to a PyPO frame object. More... | |
Utilities for the ctypes interface.
These methods are mostly for allocating and deallocating data. Also, Python types and PyPO objects are converted to ctypes structs here and vice versa. After converting to a ctypes struct, the struct is passed to the C/C++ source code and converted to a proper C/C++ struct for further usage.
| def PyPO.BindUtils.allfill_c2Bundle | ( | res, | |
| obj_py, | |||
| size, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allfill_cframe | ( | res, | |
| frame_py, | |||
| size, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allfill_GPODict | ( | res, | |
| gdict_py, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allfill_GRTDict | ( | res, | |
| grdict_py, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allfill_mat4D | ( | mat, | |
| ct_t | |||
| ) |
Allocate and fill a 4D matrix for transforming frames and fields/currents.
| mat | Matrix containing transformation. |
| ct_t | Type of field in matrix. |
| def PyPO.BindUtils.allfill_reflparams | ( | inp, | |
| reflparams_py, | |||
| ct_t | |||
| ) |
Allocate and fill ctypes reflparams or reflparamsf from a reflDict.
| inp | A ctypes reflparams or reflparamsf struct. |
| reflparams_py | PyPO reflDict dictionary. |
| ct_t | Type of point in struct. |
| def PyPO.BindUtils.allfill_RTDict | ( | res, | |
| rdict_py, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allfill_SGPODict | ( | res, | |
| sgdict_py, | |||
| ct_t | |||
| ) |
Allocate and fill a ScalarGPODict, for generating a scalar Gaussian beam field.
| res | A ScalarGPODict or ScalarGPODictf struct. |
| sgdict_py | A GPODict. |
| ct_t | Type of field in struct. |
| def PyPO.BindUtils.allocate_arrC1 | ( | res, | |
| size, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allocate_c2Bundle | ( | res, | |
| size, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allocate_c2rBundle | ( | res, | |
| size, | |||
| ct_t | |||
| ) |
allocate a ctypes c2rBundle or c2rBundlef struct.
Struct is then passed to and filled by the C/C++ code.
| res | The c2rBundle or c2rBundlef struct. |
| size | Number of points in struct. |
| ct_t | Type of point in struct. |
| def PyPO.BindUtils.allocate_c4Bundle | ( | res, | |
| size, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allocate_cframe | ( | res, | |
| size, | |||
| ct_t | |||
| ) |
| def PyPO.BindUtils.allocate_reflcontainer | ( | res, | |
| size, | |||
| ct_t | |||
| ) |
Allocate ctypes reflcontainer or reflcontainerf.
| res | A ctypes reflcontainer or reflcontainerf struct. |
| size | Number of points on reflector. |
| ct_t | Type of point in struct. |
| def PyPO.BindUtils.arrC1ToObj | ( | res, | |
| shape, | |||
| np_t | |||
| ) |
| def PyPO.BindUtils.c2BundleToObj | ( | res, | |
| shape, | |||
| obj_t, | |||
| np_t | |||
| ) |
Convert a ctypes c2Bundle or c2Bundlef to a PyPO fields or currents object.
| res | A c2Bundle or c2Bundlef struct. |
| shape | Shape of the fields or currents object. |
| obj_t | Whether to convert to a fields or currents object. |
| np_t | Type of data in numpy array to be filled. |
| def PyPO.BindUtils.c2rBundleToObj | ( | res, | |
| shape, | |||
| np_t | |||
| ) |
Convert a ctypes c2rBundle or c2rBundlef to a PyPO fields and rfield object.
The rfield will be filled by the calculated Poynting vectors.
| res | A c2Bundle or c2rBundlef struct. |
| shape | Shape of the fields and rfield object. |
| np_t | Type of data in numpy array to be filled. |
| def PyPO.BindUtils.c4BundleToObj | ( | res, | |
| shape, | |||
| np_t | |||
| ) |
Convert a ctypes c4Bundle or c4Bundlef to a PyPO fields and currents object.
| res | A c4Bundle or c4Bundlef struct. |
| shape | Shape of the fields and currents object. |
| np_t | Type of data in numpy array to be filled. |
| def PyPO.BindUtils.creflToObj | ( | res, | |
| shape, | |||
| np_t | |||
| ) |
Convert a reflector grids struct to a PyPO grids object.
| res | A reflcontainer or reflcontainerf struct. |
| shape | Shape of the reflector grid. |
| np_t | Type of field in PyPO object. |
| def PyPO.BindUtils.frameToObj | ( | res, | |
| np_t, | |||
| shape | |||
| ) |
| def PyPO.BindUtils.sfieldConv | ( | field, | |
| c_field, | |||
| size, | |||
| ct_t | |||
| ) |