class documentation
class Backend_CUDA:
Constructor: Backend_CUDA(field_type, distance_limit, length_scale, dc, ...)
Implements the Biot-Savart law for calculating the magnetic flux density (B-field) and vector potential (A-field). Backend: JIT + CUDA.
| Static Method | worker |
Applies the Biot-Savart law for calculating the magnetic flux density (B-field) or vector potential (A-field) for all sampling volume points. |
| Method | __init__ |
Initializes the class attributes. |
| Method | get |
Calculates the field at every point of the sampling volume. |
| Instance Variable | _current |
Undocumented |
| Instance Variable | _dc |
Undocumented |
| Instance Variable | _distance |
Undocumented |
| Instance Variable | _field |
Undocumented |
| Instance Variable | _length |
Undocumented |
| Instance Variable | _progress |
Undocumented |
| Instance Variable | _sampling |
Undocumented |
| Instance Variable | _sampling |
Undocumented |
@staticmethod
@cuda.jit
def worker(field_type: @cuda.jit
int, distance_limit: float, length_scale: float, element_centers: np.ndarray, element_directions: np.ndarray, sampling_volume_points: np.ndarray, sampling_volume_permeabilities: np.ndarray, field_vectors: np.ndarray, total_calculations: np.ndarray, total_skipped_calculations: np.ndarray):
¶
Applies the Biot-Savart law for calculating the magnetic flux density (B-field) or vector potential (A-field) for all sampling volume points.
| Parameters | |
fieldint | Field type |
distancefloat | Distance limit (mitigating divisions by zero) |
lengthfloat | Length scale (m) |
elementnp.ndarray | Ordered list of current elements centers |
elementnp.ndarray | Ordered list of current elements directions |
samplingnp.ndarray | Sampling volume points |
samplingnp.ndarray | Ordered list of sampling volume's relative permeabilities µ_r |
fieldnp.ndarray | Field vectors (output array) |
totalnp.ndarray | Total number of calculations (output array) |
totalnp.ndarray | Total number of skipped calculations (output array) |
def __init__(self, field_type:
int, distance_limit: float, length_scale: float, dc: float, current_elements: np.ndarray, sampling_volume_points: np.ndarray, sampling_volume_permeabilities: np.ndarray, progress_callback: Callable):
¶
Initializes the class attributes.
| Parameters | |
fieldint | Field type |
distancefloat | Distance limit (mitigating divisions by zero) |
lengthfloat | Length scale (m) |
dc:float | Wire current (A) |
currentnp.ndarray | Ordered list of current elements (pairs: [element center, element direction]) |
samplingnp.ndarray | Ordered list of sampling volume points |
samplingnp.ndarray | Ordered list of sampling volume's relative permeabilities µ_r |
progressCallable | Progress callback |