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.22.6 - GR: v0.61.0
GPU Support in Field Calculations
The Electric Potential and individual Weighting Potentials can also be calculated on GPUs.
In order to use your GPU, the Julia Packages CUDAKernels or ROCKernels have to be installed and be loaded before SolidStateDetectors.jl
is loaded.
In case of an NVIDIA GPU:
using CUDAKernels, SolidStateDetectors # CUDAKernels has to be loaded before SSD
In case of an AMD GPU:
using ROCKernels, SolidStateDetectors # ROCKernels has to be loaded before SSD
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
The GPU Array types are available through CUDAKernels
and ROCKernels
:
using CUDAKernels.CUDA: CuArray
using ROCKernels.AMDGPU: ROCArray
Example (NVIDIA)
using CUDAKernels, SolidStateDetectors # CUDAKernels has to be loaded before SSD
using CUDAKernels.CUDA: CuArray
sim = Simulation(SSD_examples[:CGD])
calculate_electric_potential!(
sim,
device_array_type = CuArray,
max_n_iterations = 5000, # Performs `max_n_iterations` iterations after each refinement
refinement_limits = [0.2, 0.1, 0.05],
depletion_handling = true
)
There is no convergence check implemented yet on the GPU backend. Take care that max_n_iterations
is large enough. The keyword convergence_limit
is ignored with the GPU backend for now.
The AMD backend was not yet tested due to lack of an AMD GPU (we are working on that).