rapid DDA simulations for multiple values of refractive index

77 views
Skip to first unread message

Maxim Yurkin

unread,
Oct 5, 2023, 1:05:28 PM10/5/23
to adda-d...@googlegroups.com

Dear colleagues,

Let me bring your attention to the work in progress, which can accelerate many different parameter sweeps computed with the DDA. Konstantin Inzhevatkin has recently extended ADDA to perform calculation for many values of refractive index (m) at once. We have presented the corresponding results at AERSS 2023 Annual Meeting (Wuhan, China):

abstract - https://www.researchgate.net/publication/374088252_Rapid_DDA_simulations_for_multiple_values_of_refractive_index_of_the_same_particle
slides - https://www.researchgate.net/publication/374088136_Slides_AERSS_2023_manyM

We have tested variation of real part of m for fixed imaginary part (and other particle parameters), reaching the acceleration of 33 times (see the slides). However, based on the discussions after this talk, we realized that we can vary imaginary part of m together with the real one, so any number of complex values of refractive index can be considered at once, leading to even larger acceleration.

The corresponding code is already available at the development branch: https://github.com/inzhevatkin/adda/tree/Shifted_CG . After compilation, you may run it as usual ADDA, but specifying multiple values of refractive index in the command line option "-m ..." (the same as with standard ADDA when simulating inhomogeneous particles) and adding "-iter scg -init_field zero" (special iterative solver and choice of initial starting vector that work magic). For instance,
adda -size 10 -grid 20 -m 1.1 0 1.3 1 1.5 0.1 -iter scg -init_field zero
(for default spherical shape). When using this option, you should not rely on ADDA choice of dpl (dipole size) since it is currently based on the latest refractive index (while any order of refractive indices is fine for simulation). Thus, it is recommended to specify both -size (or -eq_rad) and -grid explicitly.

When considering q values of refractive index, the total memory is approximately (1+q/8.5) times larger than for a single run with Bi-CG iterative solver. So q is limited only by the available memory (still hundreds are possible for some cases). ADDA produces a separate sub-folder with output for each refractive index - this is convenient for parsing by external scripts. The only significant limitation is that currently the code computes only cross sections and efficiencies - other scattering quantities are also produced, but they are erroneously the same for each refractive indices. We plan to fix the calculation of the angle-resolved Mueller (and amplitude) scattering matrices soon, as well as orientational averaging (currently, the latter will cause an error).

If you plan any massive parameter sweeps, which can benefit from this new feature, please let us know, so we can tune ADDA to your specific application.

Maxim.

Clement Argentin

unread,
Apr 16, 2026, 8:55:22 AM (6 days ago) Apr 16
to ADDA questions and answers
Dear colleagues,

We have recently extended the Shifted_CG branch further. In particular, the issue with angle-resolved scattering outputs has now been fixed: the Mueller and amplitude matrices are now correctly saved separately for each refractive index. We also added support for `-orient avg` and `-scat_grid_inp` in both sequential and MPI modes. OpenCL mode is still not usable at the moment.

For `-orient avg`, one important point is the convergence criterion of the outer Romberg integration. It is now based on the maximum relative `Cext` error across all refractive indices. This is robust, but it also means that the averaging may require more outer evaluations than in a single-index run.

By default, the number of refractive indices is limited to 300 through the `MAX_N_SCG` constant in `const.h`, but this limit can be increased if needed.

Finally, if very large refractive-index grids are planned, it may be inconvenient to type all values manually in `-m ...`. In that case, generating the command line with shell tools such as `seq` or `awk` is a practical solution, for example:

./adda -iter scg -m $(
  for mr in $(seq 1.40 0.01 1.60); do
    for mi in $(seq 0.01 0.01 0.20); do
      printf "%.2f %.2f " "$mr" "$mi"
    done
  done
) -size 20 -grid 10 -init_field zero

Clément
Reply all
Reply to author
Forward
0 new messages