Installation

This package is a registered package.

Install via

using Pkg; pkg"add SolidStateDetectors"

Visualization / Plotting (Optional)

This package provides serveral plot recipes for different outputs for the plotting package Plots.jl.

In order to use these also install the Plots.jl package via

using Pkg; pkg"add Plots"

Load the Plots.jl package (and optionally the backend pyplot) via

using Plots

The backends supported by SolidStateDetectors.jl are gr and pyplot. By default, gr is loaded when importing Plots.

For more information about the plot recipes of this package look up the Plotting section.

This documentation was build with

Plots: v1.40.2 - GR: v0.73.3

GPU Support in Field Calculations

The Electric Potential and individual Weighting Potentials can also be calculated on GPUs. SolidStateDetectors.jl uses KernelAbstractions.jl for GPU support.

In order to use your GPU, the Julia Packages CUDA.jl or AMDGPU.jl have to be installed and loaded. SolidStateDetectors.jl may run on other GPU types supported by KernelAbstractions.jl, but has not been tested with oneAPI.jl or Metal.jl yet.

For NVIDIA GPUs use:

using CUDA, SolidStateDetectors
# *Only* for KernelAbstractions < v0.9:
# using CUDAKernels

For AMD GPUs use:

using AMDGPU, SolidStateDetectors
# *Only* for KernelAbstractions < v0.9:
# using ROCKernels

Then, in any field calculation (calculate_electric_potential!, calculate_weighting_potential!, simulate!(::Simulation)) the keyword device_array_type can be set to choose the device on which the calculations should be performed. The possibilities are:

device_array_type = Array # -> CPU (default)
device_array_type = CuArray # -> NVIDIA GPU
device_array_type = ROCArray # -> AMD GPU

Example (NVIDIA)

using CUDA, SolidStateDetectors
# *Only* for KernelAbstractions < v0.9:
# using CUDAKernels

sim = Simulation(SSD_examples[:CGD])
calculate_electric_potential!( 
    sim, 
    device_array_type = CuArray, 
    refinement_limits = [0.2, 0.1, 0.05],
    depletion_handling = true
)
Note

The AMD backend was not yet tested due to lack of an AMD GPU (we are working on that).