The Discrete-Dipole Approximation (DDA) is a numerical method that represents an arbitrarily-shaped particle as electric dipoles on a cubic lattice. This representation yields a system of linear equations for the induced dipole moments (light-matter interaction). If there are
There are many implementations, but the one I used was OpenDDA. In particular, I made some modifications to use the parallelized version using the Message-Passing Interface (MPI) for distributed memory clusters. See below for more details.
This repository contains the modifications I did to the double-precision MPI implementation of OpenDDA, namely:
- Implemented a Corrected Lattice Dispersion Relation in
dipole_polarisabilities_MPI.c
- Added a new function
scattered_field_MPI.c
that calculates the scattered field in terms of 4-by-4 complex-valued matrix, according to the conventions outlined in this article - Miscellaneous updates to deprecated MPI functions, and modifications to the standard output in the main
opendda_MPI.c
file
- Download the source code
- Install the two main library dependencies:
- Update the Makefile with path to
include
andlib
folders. The specific location will be installation-dependent - Update Makefile with compiler (
CC
) and relevant flags (CFLAGS
) - Type
make
in the terminal to compile the program. The executable isopendda_MPI
- Open your terminal and change to the folder containing
opendda_MPI
- Type
mpirun -np X opendda_MPI
where X is the number of processors available
To learn more about Open DDA, see the About OpenDDA file.