UvA logo

Section Computational Science

Faculty of Science
Informatics Institute

The ADDA code

ADDA is a C software package to calculate scattering and absorption of electromagnetic waves by particles of arbitrary geometry using the Discrete Dipole Approximation (DDA). It has been developed by Maxim A. Yurkin and Alfons G. Hoekstra at the University of Amsterdam. Its main feature is the ability to run on a multiprocessor system or multicore processors (parallelizing a single DDA simulation). ADDA is intended to be a versatile tool, suitable for a wide variety of applications ranging from interstellar dust and atmospheric aerosols to biological particles; its applicability is limited only by available computer resources. As provided, ADDA should be usable for many applications without modification, but the program is written in a modular form, so that modifications, if required, should be fairly straightforward.

The current version of ADDA is 0.79.

This software is available under GNU GPL. If you choose to use it, please subcribe to announcement mailing list; "registered" users of ADDA will be notified when updates to the code are made. The authors would also appreciate any comments and/or bug reports. If you publish results obtained using ADDA, you should acknowledge the source of the code. A general reference [6] is recommended for that. To ask questions it is recommended to use the discussion group, but you may also contact authors directly. You will find the following below:


Downloading the latest release of ADDA

Download ADDA 0.79:

If you want to use the latest features or track the development progress, you may download the recent source directly from the ADDA subversion repository using web browser or any subversion client (svn checkout http://a-dda.googlecode.com/svn/trunk/). Please mind, however, that the latest pre-release version may be unstable. If you decide to try it and discover any problems, comment on this in the issue tracker.

Older versions of ADDA are also available for download.


Known bugs of the latest release

Please see issue tracker. If you have found a bug, please look here.


Documentation of ADDA

An extensive User Manual is available. It is included in the main package: doc/manual.pdf. A source of the manual in the MS Word format is also available - doc/manual.doc. You may as well download them separately: DOC, PDF.


History of recent releases

ADDA 0.79 has been released on May 29, 2009. The most important changes since version 0.78.2 are the following:

History of older versions is available here.


Benchmark caculations and comparisons with other codes.

Comparison of four different DDA codes, including ADDA 0.7a and DDSCAT 6.1, was performed by Penttila et al. [7] for simulation of different wavelength-sized particles both in single and random orientations. This paper showed that ADDA is faster than other codes by a factor of 2.3 to 16 and it is the least memory consuming code. For a sphere in a fixed orientation all codes result in almost identical scattering quantities. However, the results differ for particles in random orientations due to the different orientation averaging schemes of the codes. For asymmetric particles (aggregates composed of 4 or 50 spheres) the errors of the codes are generally comparable, ADDA is only slightly less accurate than other codes.

The results for axisymmetric particles are principally different - ADDA is much less accurate than other codes. For instance, we show a figure from [7], which shows relative errors of scattered intensity versus the scattering angle for a prolate spheroid with aspect ratio 2, volume-equivalent size parameter 5.1, and refractive index 1.313 (click on the figure to see larger image). Using ADDA with general parameters for orientation averaging results in black line in the figure. However, ADDA can exploit particle symmetries when performing orientation averaging, but modification of the parameters file by user is required. This was not done in the paper, since it was considered a 'fine-tuning'. However, the results are added to the figure here as azure line (obtained with ADDA 0.76). One can see that it is comparable to or even better that other codes.

We may conclude that the drawback of ADDA is inflexibility of its orientation averaging scheme, especially when small number of sample angles is used. However, in most cases it results in accuracy not worse than that of other codes, if particle symmetries are properly accounted for. Moreover, inflexibility is compensated by the adaptability of the ADDA orientation averaging scheme and its ability to estimate the averaging error. More details on the shown results and extensive discussion of ADDA orientation averaging scheme can be found in the manual.

Comparison of 4 DDA codes
  for spheroid in random orientation. New results by ADDA using the symmetry are also shown

To validate the part of ADDA, which simulates scattering by a Gaussian beam, we conducted a simple test and compared results with Multiple Multipole Program (MMP). The MMP results were provided by Roman Schuh and Thomas Wriedt. Sphere with size parameter 5 and refractive index 1.5 is illuminated with a Gaussian beam with wavelength 1 μm, width 2 μm, and position of the beam center (1,1,1) μm. The beam propagates along the z-axis. We calculated S11(θ) in yz-plane, scattering angle θ was considered from z-axis to y-axis. We used 64 dipoles per diameter of the sphere. ADDA 0.76 was used with a command line:

adda -grid 64 -lambda 1 -size 1.59155 -beam barton5 2 1 1 1 -ntheta 180

The results are shown in the figure, showing perfect agreement between two methods. Click on the figure to see larger image.

Comparison of ADDA and MMP for
  simulation of scattering of a Gaussian beam

FAQ: Frequently Asked Questions.

Q: I have found a bug in ADDA. What should I do?
A: (1) Make sure you are using the latest version of ADDA. If you modified the code yourself, try the original release. (2) Look at the list of known bugs at issue tracker, maybe your bug is already known. (3) Try to understand how exactly the bug occurs, write down the sequence of actions that lead to it. (4) Please try to localize the bug, i.e. try to remove as much command line parameters as possible without removing the bug. Also try to use default versions of input files, which you have modified. (5) Submit your bug to issue tracker, including input files and Makefiles that you used for compilation. Do not forget to include all the relevant output files, at least log. Please also include a brief description of your operation system and hardware. We will try to fix the bug as soon as possible.

Q: I do not understand how to ...? I run ADDA and get strange output or something different from what I have expected. What should I do?
A: (1) Make sure you are using the latest version of ADDA. Read carefully the relevant parts of the manual. (2) Check this FAQ. (3) If that does not help, you're encouraged to send your question to the discussion group. Please try to make your question as specific as possible. If your question is based on a particular run, provide all relevant input and output files, at least log.

Q: Can I use ADDA to calculate scattering by a particle near the infinite dielectric plane surface?
A: Basically, no. ADDA can not rigorously solve such light scattering problem. Such a rigorous solution requires a significant modification of the code, therefore it will not be implemented in the near future. However, you may approach this problem using the current version of ADDA. 1) You may completely ignore the surface, this may be accurate enough if particle is far from the surface and the refractive index change when crossing the surface is small. 2) A little more accurate approach is to consider the "incident field" in ADDA as a sum of incident and reflected plane waves. However, currently such incident field is not implemented, therefore it need first to be coded into ADDA. 3) Another approach is to take a large computational box around the particle, and discretize the surface that falls into it. This is rigorous in the limit of infinite size of computational box, but requires enormous computational time. It also requires you to specify the shape files for all different sizes of the computational box.

Q: Can I calculate near-field using ADDA?
A: We are currently working to implement this feature in a convenient manner. For now there are two possible workarounds: 1) You may save dipole polarizations to file by ADDA and then compute the near-field yourself, using a simple formula. 2) Or you may extend the computational box with "dummy" dipoles located at points where you wish to calculate near-field. Saving the internal fields by ADDA will then produce the desired result, but at expense of extra computational time. Please see the manual for details.

Q: How can I simulate light scattering by a particle which shape can not be described by any of the ADDA predefined shapes?
A: The simplest is to specify your particle by a shape file. However, if your shape can easily be described in some parametric form and you are going to simulate a lot of particles with shapes from this class or if you think other users will probably simulate the same shapes, you are encouraged to implement new shape inside ADDA. There is an extensive instruction in the appendix of the manual on how to do it. Afterwards, please send modified source files to the authors so they would be incorporated in the next release for the benefit of the community.

Q: How is the Mueller matrix, produced by ADDA, defined and/or normalized?
A: It is defined as in Bohren & Huffman "Absorption and scattering of Light by Small Particles" (1983), and it is not normalized. Some other codes may compute Stokes scattering matrix, which is normalized so that 1,1-element is equal to 1 after averaging over the whole solid angle. This matrix should be multiplied by πCsca/λ2 to get Mueller matrix. Csca is the scattering cross section for unpolarized light, equal to average of scattering cross sections for any two perpendicular incident polarizations.

This list is included in the in the main package: doc/faq. It is far from being complete, therefore please send your questions to the discussion group.


Future plans.

If you are interested in the planned direction of further ADDA development, please look at issues listed in the issue tracker. Users may "star" issues, which they consider important, to influence their priorities (Google account is required for that). Specific suggestions for improving the code, the manual, or this page are welcomed. You may either submit it directly to the issue tracker or discuss it in the discussion group. Help us make ADDA better!


References showing ADDA development.

Click on a number to see an abstract on a journal's webpage.

[1] A. G. Hoekstra and P. M. A. Sloot, "New computational techniques to simulate light-scattering from arbitrary particles," Part. Part. Sys. Charact. 11, 189-193 (1994).

[2] A. G. Hoekstra and P. M. A. Sloot, "Coupled dipole simulations of elastic light scattering on parallel systems," Int. J. Mod. Phys. C 6, 663-679 (1995).

[3] A. G. Hoekstra, M. D. Grimminck, and P. M. A. Sloot, "Large scale simulations of elastic light scattering by a fast discrete dipole approximation," Int. J. Mod. Phys. C 9, 87-102 (1998).

[4] A. G. Hoekstra, M. Frijlink, L. B. F. M. Waters, and P. M. A. Sloot, "Radiation forces in the discrete-dipole approximation," J. Opt. Soc. Am. A 18, 1944-1953 (2001).

[5] M. A. Yurkin, K. A. Semyanov, P. A. Tarasov, A. V. Chernyshev, A. G. Hoekstra, and V. P. Maltsev, "Experimental and theoretical study of light scattering by individual mature red blood cells with scanning flow cytometry and discrete dipole approximation," Appl. Opt. 44, 5249-5256 (2005).

[6] M. A. Yurkin, V. P. Maltsev, and A.G. Hoekstra, "The discrete dipole approximation for simulation of light scattering by particles much larger than the wavelength", J. Quant. Spectros. Radiat. Transf. 106, 546-557 (2007).

[7] A. Penttila, E. Zubko, K. Lumme, K. Muinonen, M. A. Yurkin, B. T. Draine, J. Rahola, A. G. Hoekstra, and Y. Shkuratov, "Comparison between discrete dipole implementations and exact techniques", J. Quant. Spectros. Radiat. Transf. 106, 417-436 (2007).

[8] M. A. Yurkin, "Discrete dipole simulations of light scattering by blood cells," PhD thesis (University of Amsterdam, Amsterdam, 2007).

[9] M. A. Yurkin, K. A. Semyanov, V. P. Maltsev, and A. G. Hoekstra. "Discrimination of granulocyte subtypes from light scattering: theoretical analysis using a granulated sphere model", Opt. Express 15, 16561-16580 (2007).



Most recent modification: May 29, 2009 by
Maxim Yurkin
219 hits in
November 2009
Valid HTML 4.01!