xopto.mcvox.mcsurface.base module

BOTTOM = 'bottom'

Identifier of the bottom sample surface.

NONE = 'none'

Identifier used for a surface that is not yet assigned.

class SurfaceLayoutAny(location: str = 'none')[source]

Bases: xopto.mcvox.mcsurface.base.SurfaceLayoutBase

Base class of surface layouts that can be used for both the top or bottom sample surface.

Create a layout for the top or bottom sample surface. By default the location is not initialized.

class SurfaceLayoutBase(location: str = 'top')[source]

Bases: xopto.mcbase.mcobject.McObject

Base class of all the sample surface layouts.

Complex surface layout at the specified sample surface.

Parameters

location (TOP or BOTTOM) – Location of the sample surface to which the layout applies.

property location: str

Location of the surface layout.

class SurfaceLayoutBottom(*args, **kwargs)[source]

Bases: xopto.mcvox.mcsurface.base.SurfaceLayoutBase

Base class of the bottom sample surface layout.

Create a layout for the bottom sample surface.

class SurfaceLayoutDefault(location: str = 'none')[source]

Bases: xopto.mcvox.mcsurface.base.SurfaceLayoutAny

Default / dummy layout for the top or bottom sample surface.

Create a layout for the top or bottom sample surface. By default the location is not initialized.

cl_declaration(mc: xopto.mcbase.mcobject.McObject)str[source]

Structure that defines the dummy reflector in the Monte Carlo simulator.

cl_implementation(mc: xopto.mcbase.mcobject.McObject)str[source]

OpenCL implementation of the default surface layout

static cl_options(mc: xopto.mcbase.mcobject.McObject)str[source]

Raw OpenCL options of the default detector.

cl_pack(mc: xopto.mcbase.mcobject.McObject, target: Optional[xopto.cl.cltypes.Structure] = None)xopto.cl.cltypes.Structure[source]

Fills the structure (target) with the data required by the Monte Carlo simulator. See the SurfaceLayoutDefault.cl_type() for a detailed list of fields.

Parameters
Returns

target – Filled ctypes structure received as an input argument or a new instance if the input argument target is None.

Return type

cltypes.Structure

cl_type(mc: xopto.mcbase.mcobject.McObject)xopto.cl.cltypes.Structure[source]

Structure that is passed to the Monte carlo simulator kernel.

Parameters

mc (McObject) – A Monte Carlo simulator instance.

Returns

  • struct (cltypes.Structure) – A structure type that represents the surface layout in the Monte Carlo kernel.

  • Fields

  • ——

  • dummy (mc_int_t) – Dummy field of the dummy detector.

class SurfaceLayoutTop(*args, **kwargs)[source]

Bases: xopto.mcvox.mcsurface.base.SurfaceLayoutBase

Base class of the top sample surface layout.

Create a layout for the top sample surface.

class SurfaceLayouts(top: Optional[xopto.mcvox.mcsurface.base.SurfaceLayoutTop] = None, bottom: Optional[xopto.mcvox.mcsurface.base.SurfaceLayoutBottom] = None)[source]

Bases: xopto.mcbase.mcobject.McObject

Container of the top and bottom sample surface layouts.

Parameters
property bottom: xopto.mcbase.mcobject.McObject

Bottom sample surface layout.

cl_declaration(mc: xopto.mcbase.mcobject.McObject)str[source]

Declarations of surface layouts in OpenCL.

cl_implementation(mc: xopto.mcbase.mcobject.McObject)str[source]

Implementation of surface layouts.

cl_options(mc: xopto.mcbase.mcobject.McObject)List[Tuple[str, str]][source]

Returns the OpenCL options of the surface layout.

If the top and / or bottom sample surface layouts are specified (not the dummy default SurfaceLayoutDefault), the corresponding OpenCL options that activate the use of surface layouts are set, i.e. MC_USE_TOP_SURFACE_LAYOUT for the top surface and MC_USE_BOTTOM_SURFACE_LAYOUT for the bottom surface.

cl_pack(mc: xopto.mcbase.mcobject.McObject, target: Optional[xopto.cl.cltypes.Structure] = None)xopto.cl.cltypes.Structure[source]

Fills the structure (target) with the data required by the Monte Carlo simulator. See the SurfaceLayouts.cl_type() method for a detailed list of fields.

Parameters
Returns

target – Filled structure received as an input argument or a new instance if the input argument target is None.

Return type

cltypes.Structure

cl_type(mc: xopto.mcbase.mcobject.McObject)xopto.cl.cltypes.Structure[source]

Structure that is passed to the OpenCL simulator.

Parameters

mc (McObject) – A Monte Carlo simulator instance.

Returns

struct – A structure type that represents surface layouts in the Monte Carlo kernel.

The returned structure type implements the following fields:

  • top: SurfaceLayoutTop

    Layout of the top sample surface (z = 0).

  • bottom: SurfaceLayoutBottom

    Layout of the bottom sample surface (z = 0).

Return type

cltypes.Structure

property top: xopto.mcbase.mcobject.McObject

Top sample surface layout.

types()tuple[source]

Returns a tuple of surface layout types assigned to this instance.

TOP = 'top'

Identifier of the top sample surface.