yasfpy.fields#
Sampling-point field evaluation.
This module contains the implementation that used to live in yasfpy.simulation.Simulation.compute_fields, extracted to keep yasfpy/simulation.py smaller.
Given computed scattered-field expansion coefficients (VSWF coefficients about
particle centers), the main routine compute_fields() evaluates the
scattered field at user-provided sampling points. For plane-wave illumination it
also evaluates the incident field and reports the total field as incident plus
scattered.
Notes
The evaluation relies on precomputed lookup tables for particle-to-point VSWF
translations (computed via yasfpy.functions.misc.mutual_lookup()) and then
dispatches to a CPU (Numba) or CUDA implementation.
References
The use of VSWFs and translation operators for multiple scattering is described in [Waterman, 1971] and in the CELES implementation context [Egel et al., 2017].
Functions#
|
Compute scattered (and optionally total) fields at sampling points. |
Module Contents#
- yasfpy.fields.compute_fields(sim, sampling_points)#
Compute scattered (and optionally total) fields at sampling points.
- Parameters:
sim – Simulation instance providing particle positions, the computed scattered field coefficients (
sim.scattered_field_coefficients), and configuration flags such assim.numerics.gpu.sampling_points – Array of Cartesian sampling points with shape
(N, 3).
- Return type:
None
Notes
This routine mutates
simby setting:sim.sampling_pointssim.scattered_field(evaluated field at sampling points)sim.initial_field_electricandsim.initial_field_magneticfor the plane-wave illumination casesim.total_field_electricequal to incident plus scattered when an incident field is evaluated
The implementation computes particle-to-point lookup tables using
yasfpy.functions.misc.mutual_lookup()(including Hankel-function derivatives) and then evaluates the field either via CPU/Numba (yasfpy.functions.cpu_numba.compute_field()) or CUDA (yasfpy.functions.cuda_numba.compute_field_gpu()).When
sim.numerics.particle_distance_resolution > 0, a radial interpolation scheme is used to reduce repeated special-function evaluation for large sampling grids.References
VSWF translation-based field evaluation is consistent with CELES-style formulations [Egel et al., 2017].